summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/qcombotableitem.3qt
blob: 60c7b828c533ccc5d312b57481c15e7153cf038b (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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
'\" t
.TH QComboTableItem 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
QComboTableItem \- Means of using comboboxes in QTables
.SH SYNOPSIS
\fC#include <qtable.h>\fR
.PP
Inherits QTableItem.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQComboTableItem\fR ( QTable * table, const QStringList & list, bool editable = FALSE )"
.br
.ti -1c
.BI "\fB~QComboTableItem\fR ()"
.br
.ti -1c
.BI "virtual void \fBsetCurrentItem\fR ( int i )"
.br
.ti -1c
.BI "virtual void \fBsetCurrentItem\fR ( const QString & s )"
.br
.ti -1c
.BI "int \fBcurrentItem\fR () const"
.br
.ti -1c
.BI "QString \fBcurrentText\fR () const"
.br
.ti -1c
.BI "int \fBcount\fR () const"
.br
.ti -1c
.BI "QString \fBtext\fR ( int i ) const"
.br
.ti -1c
.BI "virtual void \fBsetEditable\fR ( bool b )"
.br
.ti -1c
.BI "bool \fBisEditable\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetStringList\fR ( const QStringList & l )"
.br
.ti -1c
.BI "virtual int \fBrtti\fR () const"
.br
.in -1c
.SH DESCRIPTION
The QComboTableItem class provides a means of using comboboxes in QTables.
.PP
A QComboTableItem is a table item which looks and behaves like a combobox. The advantage of using QComboTableItems rather than real comboboxes is that a QComboTableItem uses far less resources than real comboboxes in QTables. When the cell has the focus it displays a real combobox which the user can interact with. When the cell does not have the focus the cell \fIlooks\fR like a combobox. Only text items (i.e. no pixmaps) may be used in QComboTableItems.
.PP
QComboTableItem items have the edit type WhenCurrent (see EditType). The QComboTableItem's list of items is provided by a QStringList passed to the constructor.
.PP
The list of items may be changed using setStringList(). The current item can be set with setCurrentItem() and retrieved with currentItem(). The text of the current item can be obtained with currentText(), and the text of a particular item can be retrieved with text().
.PP
If isEditable() is TRUE the QComboTableItem will permit the user to either choose an existing list item, or create a new list item by entering their own text; otherwise the user may only choose one of the existing list items.
.PP
To populate a table cell with a QComboTableItem use QTable::setItem().
.PP
QComboTableItems may be deleted with QTable::clearCell().
.PP
QComboTableItems can be distinguished from QTableItems and QCheckTableItems using their Run Time Type Identification number (see rtti()).
.PP
<center>
.ce 1
.B "[Image Omitted]"
.PP
</center>
.PP
See also QCheckTableItem, QTableItem, QComboBox, and Advanced Widgets.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QComboTableItem::QComboTableItem ( QTable * table, const QStringList & list, bool editable = FALSE )"
Creates a combo table item for the table \fItable\fR. The combobox's list of items is passed in the \fIlist\fR argument. If \fIeditable\fR is TRUE the user may type in new list items; if \fIeditable\fR is FALSE the user may only select from the list of items provided.
.PP
By default QComboTableItems cannot be replaced by other table items since isReplaceable() returns FALSE by default.
.PP
See also QTable::clearCell() and EditType.
.SH "QComboTableItem::~QComboTableItem ()"
QComboTableItem destructor.
.SH "int QComboTableItem::count () const"
Returns the total number of list items in the combo table item.
.SH "int QComboTableItem::currentItem () const"
Returns the index of the combo table item's current list item.
.PP
See also setCurrentItem().
.SH "QString QComboTableItem::currentText () const"
Returns the text of the combo table item's current list item.
.PP
See also currentItem() and text().
.SH "bool QComboTableItem::isEditable () const"
Returns TRUE if the user can add their own list items to the combobox's list of items; otherwise returns FALSE.
.PP
See also setEditable().
.SH "int QComboTableItem::rtti () const\fC [virtual]\fR"
Returns 1.
.PP
Make your derived classes return their own values for rtti()to distinguish between different table item subclasses. You should use values greater than 1000, preferably a large random number, to allow for extensions to this class.
.PP
See also QTableItem::rtti().
.PP
Reimplemented from QTableItem.
.SH "void QComboTableItem::setCurrentItem ( int i )\fC [virtual]\fR"
Sets the list item \fIi\fR to be the combo table item's current list item.
.PP
See also currentItem().
.PP
Example: table/small-table-demo/main.cpp.
.SH "void QComboTableItem::setCurrentItem ( const QString & s )\fC [virtual]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the list item whose text is \fIs\fR to be the combo table item's current list item. Does nothing if no list item has the text \fIs\fR.
.PP
See also currentItem().
.SH "void QComboTableItem::setEditable ( bool b )\fC [virtual]\fR"
If \fIb\fR is TRUE the combo table item can be edited, i.e. the user may enter a new text item themselves. If \fIb\fR is FALSE the user may may only choose one of the existing items.
.PP
See also isEditable().
.SH "void QComboTableItem::setStringList ( const QStringList & l )\fC [virtual]\fR"
Sets the list items of this QComboTableItem to the strings in the string list \fIl\fR.
.SH "QString QComboTableItem::text ( int i ) const"
Returns the text of the combo's list item at index \fIi\fR.
.PP
See also currentText().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/qcombotableitem.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 Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt 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 qt-bugs@trolltech.com .
Please include the name of the manual page (qcombotableitem.3qt) and the Qt
version (3.3.8).