diff options
Diffstat (limited to 'doc/html/listbox-example.html')
-rw-r--r-- | doc/html/listbox-example.html | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/doc/html/listbox-example.html b/doc/html/listbox-example.html index 6a40e3929..c796229e4 100644 --- a/doc/html/listbox-example.html +++ b/doc/html/listbox-example.html @@ -34,7 +34,7 @@ body { background: #ffffff; color: black; } <p> This example shows how to use the different modes (single columns, multiple columns, -fixed number of rows, etc.) of <a href="qlistbox.html">TQListBox</a>. +fixed number of rows, etc.) of <a href="ntqlistbox.html">TQListBox</a>. <p> <hr> <p> Header file: <p> <pre>/**************************************************************************** @@ -55,10 +55,10 @@ class TQSpinBox; class TQListBox; class TQButtonGroup; -#include <<a href="qwidget-h.html">qwidget.h</a>> +#include <<a href="qwidget-h.html">ntqwidget.h</a>> -class ListBoxDemo: public <a href="qwidget.html">TQWidget</a> +class ListBoxDemo: public <a href="ntqwidget.html">TQWidget</a> { <a href="metaobjects.html#Q_OBJECT">Q_OBJECT</a> public: @@ -77,10 +77,10 @@ private slots: void sortDescending(); private: - <a href="qlistbox.html">TQListBox</a> * l; - <a href="qspinbox.html">TQSpinBox</a> * columns; - <a href="qspinbox.html">TQSpinBox</a> * rows; - <a href="qbuttongroup.html">TQButtonGroup</a> * bg; + <a href="ntqlistbox.html">TQListBox</a> * l; + <a href="ntqspinbox.html">TQSpinBox</a> * columns; + <a href="ntqspinbox.html">TQSpinBox</a> * rows; + <a href="ntqbuttongroup.html">TQButtonGroup</a> * bg; }; @@ -101,121 +101,121 @@ private: #include "listbox.h" -#include <<a href="qlabel-h.html">qlabel.h</a>> -#include <<a href="qradiobutton-h.html">qradiobutton.h</a>> -#include <<a href="qcheckbox-h.html">qcheckbox.h</a>> -#include <<a href="qspinbox-h.html">qspinbox.h</a>> -#include <<a href="qlistbox-h.html">qlistbox.h</a>> -#include <<a href="qbuttongroup-h.html">qbuttongroup.h</a>> -#include <<a href="qlayout-h.html">qlayout.h</a>> -#include <<a href="qpushbutton-h.html">qpushbutton.h</a>> +#include <<a href="qlabel-h.html">ntqlabel.h</a>> +#include <<a href="qradiobutton-h.html">ntqradiobutton.h</a>> +#include <<a href="qcheckbox-h.html">ntqcheckbox.h</a>> +#include <<a href="qspinbox-h.html">ntqspinbox.h</a>> +#include <<a href="qlistbox-h.html">ntqlistbox.h</a>> +#include <<a href="qbuttongroup-h.html">ntqbuttongroup.h</a>> +#include <<a href="qlayout-h.html">ntqlayout.h</a>> +#include <<a href="qpushbutton-h.html">ntqpushbutton.h</a>> <a name="f441"></a>ListBoxDemo::ListBoxDemo() - : <a href="qwidget.html">TQWidget</a>( 0, 0 ) + : <a href="ntqwidget.html">TQWidget</a>( 0, 0 ) { <a href="qgridlayout.html">TQGridLayout</a> * g = new <a href="qgridlayout.html">TQGridLayout</a>( this, 2, 2, 6 ); - g-><a href="qgridlayout.html#addWidget">addWidget</a>( new <a href="qlabel.html">TQLabel</a>( "<b>Configuration:</b>", this ), 0, 0 ); - g-><a href="qgridlayout.html#addWidget">addWidget</a>( new <a href="qlabel.html">TQLabel</a>( "<b>Result:</b>", this ), 0, 1 ); + g-><a href="qgridlayout.html#addWidget">addWidget</a>( new <a href="ntqlabel.html">TQLabel</a>( "<b>Configuration:</b>", this ), 0, 0 ); + g-><a href="qgridlayout.html#addWidget">addWidget</a>( new <a href="ntqlabel.html">TQLabel</a>( "<b>Result:</b>", this ), 0, 1 ); - l = new <a href="qlistbox.html">TQListBox</a>( this ); + l = new <a href="ntqlistbox.html">TQListBox</a>( this ); g-><a href="qgridlayout.html#addWidget">addWidget</a>( l, 1, 1 ); -<a name="x1447"></a> l-><a href="qwidget.html#setFocusPolicy">setFocusPolicy</a>( TQWidget::StrongFocus ); +<a name="x1447"></a> l-><a href="ntqwidget.html#setFocusPolicy">setFocusPolicy</a>( TQWidget::StrongFocus ); <a href="qvboxlayout.html">TQVBoxLayout</a> * v = new <a href="qvboxlayout.html">TQVBoxLayout</a>; <a name="x1430"></a> g-><a href="qgridlayout.html#addLayout">addLayout</a>( v, 1, 0 ); - <a href="qradiobutton.html">TQRadioButton</a> * b; - bg = new <a href="qbuttongroup.html">TQButtonGroup</a>( 0 ); + <a href="ntqradiobutton.html">TQRadioButton</a> * b; + bg = new <a href="ntqbuttongroup.html">TQButtonGroup</a>( 0 ); - b = new <a href="qradiobutton.html">TQRadioButton</a>( "Fixed number of columns,\n" + b = new <a href="ntqradiobutton.html">TQRadioButton</a>( "Fixed number of columns,\n" "as many rows as needed.", this ); -<a name="x1428"></a> bg-><a href="qbuttongroup.html#insert">insert</a>( b ); +<a name="x1428"></a> bg-><a href="ntqbuttongroup.html#insert">insert</a>( b ); <a name="x1425"></a> v-><a href="qboxlayout.html#addWidget">addWidget</a>( b ); -<a name="x1440"></a> b-><a href="qradiobutton.html#setChecked">setChecked</a>( TRUE ); -<a name="x1426"></a> <a href="qobject.html#connect">connect</a>( b, SIGNAL(<a href="qbutton.html#clicked">clicked</a>()), this, SLOT(setNumCols()) ); +<a name="x1440"></a> b-><a href="ntqradiobutton.html#setChecked">setChecked</a>( TRUE ); +<a name="x1426"></a> <a href="ntqobject.html#connect">connect</a>( b, SIGNAL(<a href="ntqbutton.html#clicked">clicked</a>()), this, SLOT(setNumCols()) ); <a href="qhboxlayout.html">TQHBoxLayout</a> * h = new <a href="qhboxlayout.html">TQHBoxLayout</a>; <a name="x1422"></a> v-><a href="qboxlayout.html#addLayout">addLayout</a>( h ); <a name="x1423"></a> h-><a href="qboxlayout.html#addSpacing">addSpacing</a>( 30 ); h-><a href="qboxlayout.html#addSpacing">addSpacing</a>( 100 ); - h-><a href="qboxlayout.html#addWidget">addWidget</a>( new <a href="qlabel.html">TQLabel</a>( "Columns:", this ) ); - columns = new <a href="qspinbox.html">TQSpinBox</a>( this ); + h-><a href="qboxlayout.html#addWidget">addWidget</a>( new <a href="ntqlabel.html">TQLabel</a>( "Columns:", this ) ); + columns = new <a href="ntqspinbox.html">TQSpinBox</a>( this ); h-><a href="qboxlayout.html#addWidget">addWidget</a>( columns ); v-><a href="qboxlayout.html#addSpacing">addSpacing</a>( 12 ); - b = new <a href="qradiobutton.html">TQRadioButton</a>( "As many columns as fit on-screen,\n" + b = new <a href="ntqradiobutton.html">TQRadioButton</a>( "As many columns as fit on-screen,\n" "as many rows as needed.", this ); - bg-><a href="qbuttongroup.html#insert">insert</a>( b ); + bg-><a href="ntqbuttongroup.html#insert">insert</a>( b ); v-><a href="qboxlayout.html#addWidget">addWidget</a>( b ); - <a href="qobject.html#connect">connect</a>( b, SIGNAL(<a href="qbutton.html#clicked">clicked</a>()), this, SLOT(setColsByWidth()) ); + <a href="ntqobject.html#connect">connect</a>( b, SIGNAL(<a href="ntqbutton.html#clicked">clicked</a>()), this, SLOT(setColsByWidth()) ); v-><a href="qboxlayout.html#addSpacing">addSpacing</a>( 12 ); - b = new <a href="qradiobutton.html">TQRadioButton</a>( "Fixed number of rows,\n" + b = new <a href="ntqradiobutton.html">TQRadioButton</a>( "Fixed number of rows,\n" "as many columns as needed.", this ); - bg-><a href="qbuttongroup.html#insert">insert</a>( b ); + bg-><a href="ntqbuttongroup.html#insert">insert</a>( b ); v-><a href="qboxlayout.html#addWidget">addWidget</a>( b ); - <a href="qobject.html#connect">connect</a>( b, SIGNAL(<a href="qbutton.html#clicked">clicked</a>()), this, SLOT(setNumRows()) ); + <a href="ntqobject.html#connect">connect</a>( b, SIGNAL(<a href="ntqbutton.html#clicked">clicked</a>()), this, SLOT(setNumRows()) ); h = new <a href="qhboxlayout.html">TQHBoxLayout</a>; v-><a href="qboxlayout.html#addLayout">addLayout</a>( h ); h-><a href="qboxlayout.html#addSpacing">addSpacing</a>( 30 ); h-><a href="qboxlayout.html#addSpacing">addSpacing</a>( 100 ); - h-><a href="qboxlayout.html#addWidget">addWidget</a>( new <a href="qlabel.html">TQLabel</a>( "Rows:", this ) ); - rows = new <a href="qspinbox.html">TQSpinBox</a>( this ); -<a name="x1442"></a> rows-><a href="qwidget.html#setEnabled">setEnabled</a>( FALSE ); + h-><a href="qboxlayout.html#addWidget">addWidget</a>( new <a href="ntqlabel.html">TQLabel</a>( "Rows:", this ) ); + rows = new <a href="ntqspinbox.html">TQSpinBox</a>( this ); +<a name="x1442"></a> rows-><a href="ntqwidget.html#setEnabled">setEnabled</a>( FALSE ); h-><a href="qboxlayout.html#addWidget">addWidget</a>( rows ); v-><a href="qboxlayout.html#addSpacing">addSpacing</a>( 12 ); - b = new <a href="qradiobutton.html">TQRadioButton</a>( "As many rows as fit on-screen,\n" + b = new <a href="ntqradiobutton.html">TQRadioButton</a>( "As many rows as fit on-screen,\n" "as many columns as needed.", this ); - bg-><a href="qbuttongroup.html#insert">insert</a>( b ); + bg-><a href="ntqbuttongroup.html#insert">insert</a>( b ); v-><a href="qboxlayout.html#addWidget">addWidget</a>( b ); - <a href="qobject.html#connect">connect</a>( b, SIGNAL(<a href="qbutton.html#clicked">clicked</a>()), this, SLOT(setRowsByHeight()) ); + <a href="ntqobject.html#connect">connect</a>( b, SIGNAL(<a href="ntqbutton.html#clicked">clicked</a>()), this, SLOT(setRowsByHeight()) ); v-><a href="qboxlayout.html#addSpacing">addSpacing</a>( 12 ); - <a href="qcheckbox.html">TQCheckBox</a> * cb = new <a href="qcheckbox.html">TQCheckBox</a>( "Variable-height rows", this ); -<a name="x1429"></a> cb-><a href="qcheckbox.html#setChecked">setChecked</a>( TRUE ); -<a name="x1427"></a> <a href="qobject.html#connect">connect</a>( cb, SIGNAL(<a href="qbutton.html#toggled">toggled</a>(bool)), this, SLOT(setVariableHeight(bool)) ); + <a href="ntqcheckbox.html">TQCheckBox</a> * cb = new <a href="ntqcheckbox.html">TQCheckBox</a>( "Variable-height rows", this ); +<a name="x1429"></a> cb-><a href="ntqcheckbox.html#setChecked">setChecked</a>( TRUE ); +<a name="x1427"></a> <a href="ntqobject.html#connect">connect</a>( cb, SIGNAL(<a href="ntqbutton.html#toggled">toggled</a>(bool)), this, SLOT(setVariableHeight(bool)) ); v-><a href="qboxlayout.html#addWidget">addWidget</a>( cb ); v-><a href="qboxlayout.html#addSpacing">addSpacing</a>( 6 ); - cb = new <a href="qcheckbox.html">TQCheckBox</a>( "Variable-width columns", this ); - <a href="qobject.html#connect">connect</a>( cb, SIGNAL(<a href="qbutton.html#toggled">toggled</a>(bool)), this, SLOT(setVariableWidth(bool)) ); + cb = new <a href="ntqcheckbox.html">TQCheckBox</a>( "Variable-width columns", this ); + <a href="ntqobject.html#connect">connect</a>( cb, SIGNAL(<a href="ntqbutton.html#toggled">toggled</a>(bool)), this, SLOT(setVariableWidth(bool)) ); v-><a href="qboxlayout.html#addWidget">addWidget</a>( cb ); - cb = new <a href="qcheckbox.html">TQCheckBox</a>( "Extended-Selection", this ); - <a href="qobject.html#connect">connect</a>( cb, SIGNAL(<a href="qbutton.html#toggled">toggled</a>(bool)), this, SLOT(setMultiSelection(bool)) ); + cb = new <a href="ntqcheckbox.html">TQCheckBox</a>( "Extended-Selection", this ); + <a href="ntqobject.html#connect">connect</a>( cb, SIGNAL(<a href="ntqbutton.html#toggled">toggled</a>(bool)), this, SLOT(setMultiSelection(bool)) ); v-><a href="qboxlayout.html#addWidget">addWidget</a>( cb ); - <a href="qpushbutton.html">TQPushButton</a> *pb = new <a href="qpushbutton.html">TQPushButton</a>( "Sort ascending", this ); - <a href="qobject.html#connect">connect</a>( pb, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ), this, SLOT( sortAscending() ) ); + <a href="ntqpushbutton.html">TQPushButton</a> *pb = new <a href="ntqpushbutton.html">TQPushButton</a>( "Sort ascending", this ); + <a href="ntqobject.html#connect">connect</a>( pb, SIGNAL( <a href="ntqbutton.html#clicked">clicked</a>() ), this, SLOT( sortAscending() ) ); v-><a href="qboxlayout.html#addWidget">addWidget</a>( pb ); - pb = new <a href="qpushbutton.html">TQPushButton</a>( "Sort descending", this ); - <a href="qobject.html#connect">connect</a>( pb, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ), this, SLOT( sortDescending() ) ); + pb = new <a href="ntqpushbutton.html">TQPushButton</a>( "Sort descending", this ); + <a href="ntqobject.html#connect">connect</a>( pb, SIGNAL( <a href="ntqbutton.html#clicked">clicked</a>() ), this, SLOT( sortDescending() ) ); v-><a href="qboxlayout.html#addWidget">addWidget</a>( pb ); <a name="x1424"></a> v-><a href="qboxlayout.html#addStretch">addStretch</a>( 100 ); int i = 0; while( ++i <= 2560 ) -<a name="x1446"></a><a name="x1433"></a> l-><a href="qlistbox.html#insertItem">insertItem</a>( TQString::<a href="qstring.html#fromLatin1">fromLatin1</a>( "Item " ) + TQString::number( i ), +<a name="x1446"></a><a name="x1433"></a> l-><a href="ntqlistbox.html#insertItem">insertItem</a>( TQString::<a href="ntqstring.html#fromLatin1">fromLatin1</a>( "Item " ) + TQString::number( i ), i ); -<a name="x1441"></a> columns-><a href="qrangecontrol.html#setRange">setRange</a>( 1, 256 ); -<a name="x1443"></a> columns-><a href="qspinbox.html#setValue">setValue</a>( 1 ); - rows-><a href="qrangecontrol.html#setRange">setRange</a>( 1, 256 ); - rows-><a href="qspinbox.html#setValue">setValue</a>( 256 ); +<a name="x1441"></a> columns-><a href="ntqrangecontrol.html#setRange">setRange</a>( 1, 256 ); +<a name="x1443"></a> columns-><a href="ntqspinbox.html#setValue">setValue</a>( 1 ); + rows-><a href="ntqrangecontrol.html#setRange">setRange</a>( 1, 256 ); + rows-><a href="ntqspinbox.html#setValue">setValue</a>( 256 ); -<a name="x1445"></a> <a href="qobject.html#connect">connect</a>( columns, SIGNAL(<a href="qspinbox.html#valueChanged">valueChanged</a>(int)), this, SLOT(setNumCols()) ); - <a href="qobject.html#connect">connect</a>( rows, SIGNAL(<a href="qspinbox.html#valueChanged">valueChanged</a>(int)), this, SLOT(setNumRows()) ); +<a name="x1445"></a> <a href="ntqobject.html#connect">connect</a>( columns, SIGNAL(<a href="ntqspinbox.html#valueChanged">valueChanged</a>(int)), this, SLOT(setNumCols()) ); + <a href="ntqobject.html#connect">connect</a>( rows, SIGNAL(<a href="ntqspinbox.html#valueChanged">valueChanged</a>(int)), this, SLOT(setNumRows()) ); } @@ -227,61 +227,61 @@ ListBoxDemo::~ListBoxDemo() void <a name="f442"></a>ListBoxDemo::setNumRows() { - columns-><a href="qwidget.html#setEnabled">setEnabled</a>( FALSE ); - rows-><a href="qwidget.html#setEnabled">setEnabled</a>( TRUE ); -<a name="x1444"></a><a name="x1435"></a> l-><a href="qlistbox.html#setRowMode">setRowMode</a>( rows-><a href="qspinbox.html#value">value</a>() ); + columns-><a href="ntqwidget.html#setEnabled">setEnabled</a>( FALSE ); + rows-><a href="ntqwidget.html#setEnabled">setEnabled</a>( TRUE ); +<a name="x1444"></a><a name="x1435"></a> l-><a href="ntqlistbox.html#setRowMode">setRowMode</a>( rows-><a href="ntqspinbox.html#value">value</a>() ); } void <a name="f443"></a>ListBoxDemo::setNumCols() { - columns-><a href="qwidget.html#setEnabled">setEnabled</a>( TRUE ); - rows-><a href="qwidget.html#setEnabled">setEnabled</a>( FALSE ); -<a name="x1434"></a> l-><a href="qlistbox.html#setColumnMode">setColumnMode</a>( columns-><a href="qspinbox.html#value">value</a>() ); + columns-><a href="ntqwidget.html#setEnabled">setEnabled</a>( TRUE ); + rows-><a href="ntqwidget.html#setEnabled">setEnabled</a>( FALSE ); +<a name="x1434"></a> l-><a href="ntqlistbox.html#setColumnMode">setColumnMode</a>( columns-><a href="ntqspinbox.html#value">value</a>() ); } void <a name="f444"></a>ListBoxDemo::setRowsByHeight() { - columns-><a href="qwidget.html#setEnabled">setEnabled</a>( FALSE ); - rows-><a href="qwidget.html#setEnabled">setEnabled</a>( FALSE ); - l-><a href="qlistbox.html#setRowMode">setRowMode</a>( TQListBox::FitToHeight ); + columns-><a href="ntqwidget.html#setEnabled">setEnabled</a>( FALSE ); + rows-><a href="ntqwidget.html#setEnabled">setEnabled</a>( FALSE ); + l-><a href="ntqlistbox.html#setRowMode">setRowMode</a>( TQListBox::FitToHeight ); } void <a name="f445"></a>ListBoxDemo::setColsByWidth() { - columns-><a href="qwidget.html#setEnabled">setEnabled</a>( FALSE ); - rows-><a href="qwidget.html#setEnabled">setEnabled</a>( FALSE ); - l-><a href="qlistbox.html#setColumnMode">setColumnMode</a>( TQListBox::FitToWidth ); + columns-><a href="ntqwidget.html#setEnabled">setEnabled</a>( FALSE ); + rows-><a href="ntqwidget.html#setEnabled">setEnabled</a>( FALSE ); + l-><a href="ntqlistbox.html#setColumnMode">setColumnMode</a>( TQListBox::FitToWidth ); } void <a name="f446"></a>ListBoxDemo::setVariableWidth( bool b ) { -<a name="x1438"></a> l-><a href="qlistbox.html#setVariableWidth">setVariableWidth</a>( b ); +<a name="x1438"></a> l-><a href="ntqlistbox.html#setVariableWidth">setVariableWidth</a>( b ); } void <a name="f447"></a>ListBoxDemo::setVariableHeight( bool b ) { -<a name="x1437"></a> l-><a href="qlistbox.html#setVariableHeight">setVariableHeight</a>( b ); +<a name="x1437"></a> l-><a href="ntqlistbox.html#setVariableHeight">setVariableHeight</a>( b ); } void <a name="f448"></a>ListBoxDemo::setMultiSelection( bool b ) { -<a name="x1432"></a> l-><a href="qlistbox.html#clearSelection">clearSelection</a>(); -<a name="x1436"></a> l-><a href="qlistbox.html#setSelectionMode">setSelectionMode</a>( b ? TQListBox::Extended : <a href="qlistbox.html">TQListBox</a>::Single ); +<a name="x1432"></a> l-><a href="ntqlistbox.html#clearSelection">clearSelection</a>(); +<a name="x1436"></a> l-><a href="ntqlistbox.html#setSelectionMode">setSelectionMode</a>( b ? TQListBox::Extended : <a href="ntqlistbox.html">TQListBox</a>::Single ); } void <a name="f449"></a>ListBoxDemo::sortAscending() { -<a name="x1439"></a> l-><a href="qlistbox.html#sort">sort</a>( TRUE ); +<a name="x1439"></a> l-><a href="ntqlistbox.html#sort">sort</a>( TRUE ); } void <a name="f450"></a>ListBoxDemo::sortDescending() { - l-><a href="qlistbox.html#sort">sort</a>( FALSE ); + l-><a href="ntqlistbox.html#sort">sort</a>( FALSE ); } </pre> @@ -298,18 +298,18 @@ void <a name="f450"></a>ListBoxDemo::sortDescending() *****************************************************************************/ #include "listbox.h" -#include <<a href="qapplication-h.html">qapplication.h</a>> +#include <<a href="qapplication-h.html">ntqapplication.h</a>> int main( int argc, char **argv ) { - <a href="qapplication.html">TQApplication</a> a( argc, argv ); + <a href="ntqapplication.html">TQApplication</a> a( argc, argv ); ListBoxDemo t; - t.<a href="qwidget.html#setCaption">setCaption</a>( "TQt Example - Listbox" ); - a.<a href="qapplication.html#setMainWidget">setMainWidget</a>( &t ); - t.<a href="qwidget.html#show">show</a>(); + t.<a href="ntqwidget.html#setCaption">setCaption</a>( "TQt Example - Listbox" ); + a.<a href="ntqapplication.html#setMainWidget">setMainWidget</a>( &t ); + t.<a href="ntqwidget.html#show">show</a>(); - return a.<a href="qapplication.html#exec">exec</a>(); + return a.<a href="ntqapplication.html#exec">exec</a>(); } </pre> |