summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqlayoutiterator.3qt
blob: f7f99fee193d5303b2e5b6f94b56e08e63075d09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
'\" t
.TH TQLayoutIterator 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQLayoutIterator \- Iterators over TQLayoutItem
.SH SYNOPSIS
\fC#include <tqlayout.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQLayoutIterator\fR ( TQGLayoutIterator * gi )"
.br
.ti -1c
.BI "\fBTQLayoutIterator\fR ( const TQLayoutIterator & i )"
.br
.ti -1c
.BI "\fB~TQLayoutIterator\fR ()"
.br
.ti -1c
.BI "TQLayoutIterator & \fBoperator=\fR ( const TQLayoutIterator & i )"
.br
.ti -1c
.BI "TQLayoutItem * \fBoperator++\fR ()"
.br
.ti -1c
.BI "TQLayoutItem * \fBcurrent\fR ()"
.br
.ti -1c
.BI "TQLayoutItem * \fBtakeCurrent\fR ()"
.br
.ti -1c
.BI "void \fBdeleteCurrent\fR ()"
.br
.in -1c
.SH DESCRIPTION
The TQLayoutIterator class provides iterators over TQLayoutItem.
.PP
Use TQLayoutItem::iterator() to create an iterator over a layout.
.PP
TQLayoutIterator uses \fIexplicit\fR sharing with a reference count. If an iterator is copied and one of the copies is modified, both iterators will be modified.
.PP
A TQLayoutIterator is not protected against changes in its layout. If the layout is modified or deleted the iterator will become invalid. It is not possible to test for validity. It is safe to delete an invalid layout; any other access may lead to an illegal memory reference and the abnormal termination of the program.
.PP
Calling takeCurrent() or deleteCurrent() leaves the iterator in a valid state, but may invalidate any other iterators that access the same layout.
.PP
The following code will draw a rectangle for each layout item in the layout structure of the widget.
.PP
.nf
.br
    static void paintLayout( TQPainter *p, TQLayoutItem *lay )
.br
    {
.br
        TQLayoutIterator it = lay->iterator();
.br
        TQLayoutItem *child;
.br
        while ( (child = it.current()) != 0 ) {
.br
            paintLayout( p, child );
.br
            ++it;
.br
        }
.br
        p->drawRect( lay->geometry() );
.br
    }
.br
    void ExampleWidget::paintEvent( TQPaintEvent * )
.br
    {
.br
        TQPainter p( this );
.br
        if ( layout() )
.br
            paintLayout( &p, layout() );
.br
    }
.br
.fi
.PP
All the functionality of TQLayoutIterator is implemented by subclasses of TQGLayoutIterator. TQLayoutIterator itself is not designed to be subclassed.
.PP
See also Widget Appearance and Style and Layout Management.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQLayoutIterator::TQLayoutIterator ( TQGLayoutIterator * gi )"
Constructs an iterator based on \fIgi\fR. The constructed iterator takes ownership of \fIgi\fR and will delete it.
.PP
This constructor is provided for layout implementors. Application programmers should use TQLayoutItem::iterator() to create an iterator over a layout.
.SH "TQLayoutIterator::TQLayoutIterator ( const TQLayoutIterator & i )"
Creates a shallow copy of \fIi\fR, i.e. if the copy is modified, then the original will also be modified.
.SH "TQLayoutIterator::~TQLayoutIterator ()"
Destroys the iterator.
.SH "TQLayoutItem * TQLayoutIterator::current ()"
Returns the current item, or 0 if there is no current item.
.SH "void TQLayoutIterator::deleteCurrent ()"
Removes and deletes the current child item from the layout and moves the iterator to the next item. This iterator will still be valid, but any other iterator over the same layout may become invalid.
.SH "TQLayoutItem * TQLayoutIterator::operator++ ()"
Moves the iterator to the next child item and returns that item, or 0 if there is no such item.
.SH "TQLayoutIterator & TQLayoutIterator::operator= ( const TQLayoutIterator & i )"
Assigns \fIi\fR to this iterator and returns a reference to this iterator.
.SH "TQLayoutItem * TQLayoutIterator::takeCurrent ()"
Removes the current child item from the layout without deleting
it, and moves the iterator to the next item. Returns the removed
item, or 0 if there was no item to be removed. This iterator will
still be valid, but any other iterator over the same layout may
become invalid.

.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqlayoutiterator.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR [email protected] .
Please include the name of the manual page (tqlayoutiterator.3qt) and the Qt
version (3.3.8).