QComboTableItem(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– QComboTableItem β€” from the Qt 3 manual, section 3qt ✨

okay bestie, gather round, because we're about to make a combobox inside a table cell make sense. yes, really. and it's gonna be cute. πŸŽ€


🌸 NAME 🌸

QComboTableItem β€” the whole entire way to use comboboxes inside QTables. that's it. that's the job. πŸ’…


✨ SYNOPSIS ✨

#include <qtable.h>

Inherits QTableItem.

🫢 Public Members 🫢

QComboTableItem ( QTable * table, const QStringList & list, bool
    editable = FALSE )
~QComboTableItem ()
virtual void setCurrentItem ( int i )
virtual void setCurrentItem ( const QString & s )
int currentItem () const
QString currentText () const
int count () const
QString text ( int i ) const
virtual void setEditable ( bool b )
bool isEditable () const
virtual void setStringList ( const QStringList & l )
virtual int rtti () const

πŸ¦‹ DESCRIPTION πŸ¦‹

The QComboTableItem class gives you a means of using comboboxes in QTables. ✨

So here's the tea: a QComboTableItem is a table item that looks and behaves like a combobox. and the reason you'd reach for one of these instead of a real, actual, full-on combobox is genuinely iconic β€” a QComboTableItem uses far less resources than real comboboxes do in QTables. frugal queen behavior. πŸ’… when the cell has the focus, it displays a real combobox that the user can actually interact with. when the cell does not have the focus, the cell just looks like a combobox. lowkey genius, no cap.

🚨 important: only text items (i.e. no pixmaps) may be used in QComboTableItems. so leave your images at home, bestie. 😭

QComboTableItem items have the edit type WhenCurrent (see EditType). the QComboTableItem's list of items is provided by a QStringList that you pass to the constructor. πŸŽ€

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(). see how tidy that is?? obsessed. 🌈

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. choose your fighter. πŸ‘‘

To populate a table cell with a QComboTableItem use QTable::setItem().

QComboTableItems may be deleted with QTable::clearCell().

QComboTableItems can be distinguished from QTableItems and QCheckTableItems using their Run Time Type Identification number (see rtti()). iykyk. πŸ”₯

<center>
                            [Image Omitted]

</center>

See also QCheckTableItem, QTableItem, QComboBox, and Advanced Widgets.


πŸ‘‘ MEMBER FUNCTION DOCUMENTATION πŸ‘‘

QComboTableItem::QComboTableItem ( QTable * table, const QStringList & list, bool editable = FALSE )

Creates a combo table item for the table table. The combobox's list of items is passed in the list argument. If editable is TRUE the user may type in new list items; if editable is FALSE the user may only select from the list of items provided. πŸ“

By default QComboTableItems cannot be replaced by other table items since isReplaceable() returns FALSE by default.

See also QTable::clearCell() and EditType.


QComboTableItem::~QComboTableItem ()

QComboTableItem destructor. bye bestie, it was real 🫢


int QComboTableItem::count () const

Returns the total number of list items in the combo table item. literally just counting. ✨


int QComboTableItem::currentItem () const

Returns the index of the combo table item's current list item.

See also setCurrentItem().


QString QComboTableItem::currentText () const

Returns the text of the combo table item's current list item. πŸ’–

See also currentItem() and text().


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.

See also setEditable().


int QComboTableItem::rtti () const [virtual]

Returns 1.

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. like, go big or go home. 🎲

See also QTableItem::rtti().

Reimplemented from QTableItem.


void QComboTableItem::setCurrentItem ( int i ) [virtual]

Sets the list item i to be the combo table item's current list item.

See also currentItem().

Example: table/small-table-demo/main.cpp. πŸ”₯


void QComboTableItem::setCurrentItem ( const QString & s ) [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Sets the list item whose text is s to be the combo table item's current list item. Does nothing if no list item has the text s. (so no dramatic failing, it just… doesn't. πŸ’€)

See also currentItem().


void QComboTableItem::setEditable ( bool b ) [virtual]

If b is TRUE the combo table item can be edited, i.e. the user may enter a new text item themselves. If b is FALSE the user may may only choose one of the existing items.

See also isEditable().


void QComboTableItem::setStringList ( const QStringList & l ) [virtual]

Sets the list items of this QComboTableItem to the strings in the string list l. 🌸


QString QComboTableItem::text ( int i ) const

Returns the text of the combo's list item at index i.

See also currentText().


🌈 SEE ALSO 🌈


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.


🧚 AUTHOR 🧚

Generated automatically from the source code. (yes, the author is The Machine. slay, i guess. πŸ€–βœ¨)


πŸ™ˆ BUGS πŸ™ˆ

If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. 🫢

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.

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qcombotableitem.3qt) and the Qt version (3.3.8). bestie, they need the deets to fix it, don't gatekeep. πŸ’Œ


and that's the whole page!! πŸ’– this one came from Trolltech AS, dated 2 February 2007, and the Qt version floating around in there is 3.3.8 β€” go forth and put tiny comboboxes in tables, you absolute icon. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from