From ea318d1431c89e647598c510c4245c6571aa5f46 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 26 Jan 2012 23:32:43 -0600 Subject: Update to latest tqt3 automated conversion --- doc/html/lineedits-example.html | 178 ++++++++++++++++++++-------------------- 1 file changed, 89 insertions(+), 89 deletions(-) (limited to 'doc/html/lineedits-example.html') diff --git a/doc/html/lineedits-example.html b/doc/html/lineedits-example.html index d467ed793..66611cf23 100644 --- a/doc/html/lineedits-example.html +++ b/doc/html/lineedits-example.html @@ -50,21 +50,21 @@ how to use different echo modes and validators. #ifndef LINEDITS_H #define LINEDITS_H -#include <qgroupbox.h> +#include <ntqgroupbox.h> class TQLineEdit; class TQComboBox; -class LineEdits : public TQGroupBox +class LineEdits : public TQGroupBox { Q_OBJECT public: - LineEdits( TQWidget *parent = 0, const char *name = 0 ); + LineEdits( TQWidget *parent = 0, const char *name = 0 ); protected: - TQLineEdit *lined1, *lined2, *lined3, *lined4, *lined5; - TQComboBox *combo1, *combo2, *combo3, *combo4, *combo5; + TQLineEdit *lined1, *lined2, *lined3, *lined4, *lined5; + TQComboBox *combo1, *combo2, *combo3, *combo4, *combo5; protected slots: void slotEchoChanged( int ); @@ -91,13 +91,13 @@ protected slots: #include "lineedits.h" -#include <qlineedit.h> -#include <qcombobox.h> -#include <qframe.h> -#include <qvalidator.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qhbox.h> +#include <ntqlineedit.h> +#include <ntqcombobox.h> +#include <ntqframe.h> +#include <ntqvalidator.h> +#include <ntqlabel.h> +#include <ntqlayout.h> +#include <ntqhbox.h> /* * Constructor @@ -105,121 +105,121 @@ protected slots: * Creates child widgets of the LineEdits widget */ -LineEdits::LineEdits( TQWidget *parent, const char *name ) - : TQGroupBox( 0, Horizontal, "Line edits", parent, name ) +LineEdits::LineEdits( TQWidget *parent, const char *name ) + : TQGroupBox( 0, Horizontal, "Line edits", parent, name ) { - setMargin( 10 ); + setMargin( 10 ); - TQVBoxLayout* box = new TQVBoxLayout( layout() ); + TQVBoxLayout* box = new TQVBoxLayout( layout() ); TQHBoxLayout *row1 = new TQHBoxLayout( box ); - row1->setMargin( 5 ); + row1->setMargin( 5 ); // Create a Label - TQLabel* label = new TQLabel( "Echo Mode: ", this); + TQLabel* label = new TQLabel( "Echo Mode: ", this); row1->addWidget( label ); // Create a Combobox with three items... - combo1 = new TQComboBox( FALSE, this ); + combo1 = new TQComboBox( FALSE, this ); row1->addWidget( combo1 ); - combo1->insertItem( "Normal" ); - combo1->insertItem( "Password" ); - combo1->insertItem( "No Echo" ); + combo1->insertItem( "Normal" ); + combo1->insertItem( "Password" ); + combo1->insertItem( "No Echo" ); // ...and connect the activated() SIGNAL with the slotEchoChanged() SLOT to be able // to react when an item is selected - connect( combo1, SIGNAL( activated( int ) ), this, SLOT( slotEchoChanged( int ) ) ); + connect( combo1, SIGNAL( activated( int ) ), this, SLOT( slotEchoChanged( int ) ) ); // insert the first LineEdit - lined1 = new TQLineEdit( this ); + lined1 = new TQLineEdit( this ); box->addWidget( lined1 ); // another widget which is used for layouting TQHBoxLayout *row2 = new TQHBoxLayout( box ); - row2->setMargin( 5 ); + row2->setMargin( 5 ); // and the second label - label = new TQLabel( "Validator: ", this ); + label = new TQLabel( "Validator: ", this ); row2->addWidget( label ); // A second Combobox with again three items... - combo2 = new TQComboBox( FALSE, this ); + combo2 = new TQComboBox( FALSE, this ); row2->addWidget( combo2 ); - combo2->insertItem( "No Validator" ); - combo2->insertItem( "Integer Validator" ); - combo2->insertItem( "Double Validator" ); + combo2->insertItem( "No Validator" ); + combo2->insertItem( "Integer Validator" ); + combo2->insertItem( "Double Validator" ); // ...and again the activated() SIGNAL gets connected with a SLOT - connect( combo2, SIGNAL( activated( int ) ), this, SLOT( slotValidatorChanged( int ) ) ); + connect( combo2, SIGNAL( activated( int ) ), this, SLOT( slotValidatorChanged( int ) ) ); // and the second LineEdit - lined2 = new TQLineEdit( this ); + lined2 = new TQLineEdit( this ); box->addWidget( lined2 ); // yet another widget which is used for layouting TQHBoxLayout *row3 = new TQHBoxLayout( box ); - row3->setMargin( 5 ); + row3->setMargin( 5 ); // we need a label for this too - label = new TQLabel( "Alignment: ", this ); + label = new TQLabel( "Alignment: ", this ); row3->addWidget( label ); // A combo box for setting alignment - combo3 = new TQComboBox( FALSE, this ); + combo3 = new TQComboBox( FALSE, this ); row3->addWidget( combo3 ); - combo3->insertItem( "Left" ); - combo3->insertItem( "Centered" ); - combo3->insertItem( "Right" ); + combo3->insertItem( "Left" ); + combo3->insertItem( "Centered" ); + combo3->insertItem( "Right" ); // ...and again the activated() SIGNAL gets connected with a SLOT - connect( combo3, SIGNAL( activated( int ) ), this, SLOT( slotAlignmentChanged( int ) ) ); + connect( combo3, SIGNAL( activated( int ) ), this, SLOT( slotAlignmentChanged( int ) ) ); // and the third lineedit - lined3 = new TQLineEdit( this ); + lined3 = new TQLineEdit( this ); box->addWidget( lined3 ); // exactly the same for the fourth TQHBoxLayout *row4 = new TQHBoxLayout( box ); - row4->setMargin( 5 ); + row4->setMargin( 5 ); // we need a label for this too - label = new TQLabel( "Input mask: ", this ); + label = new TQLabel( "Input mask: ", this ); row4->addWidget( label ); // A combo box for choosing an input mask - combo4 = new TQComboBox( FALSE, this ); + combo4 = new TQComboBox( FALSE, this ); row4->addWidget( combo4 ); - combo4->insertItem( "No mask" ); - combo4->insertItem( "Phone number" ); - combo4->insertItem( "ISO date" ); - combo4->insertItem( "License key" ); + combo4->insertItem( "No mask" ); + combo4->insertItem( "Phone number" ); + combo4->insertItem( "ISO date" ); + combo4->insertItem( "License key" ); - // ...this time we use the activated( const TQString & ) signal - connect( combo4, SIGNAL( activated( int ) ), + // ...this time we use the activated( const TQString & ) signal + connect( combo4, SIGNAL( activated( int ) ), this, SLOT( slotInputMaskChanged( int ) ) ); // and the fourth lineedit - lined4 = new TQLineEdit( this ); + lined4 = new TQLineEdit( this ); box->addWidget( lined4 ); // last widget used for layouting - TQHBox *row5 = new TQHBox( this ); + TQHBox *row5 = new TQHBox( this ); box->addWidget( row5 ); - row5->setMargin( 5 ); + row5->setMargin( 5 ); // last label - (void)new TQLabel( "Read-Only: ", row5 ); + (void)new TQLabel( "Read-Only: ", row5 ); // A combo box for setting alignment - combo5 = new TQComboBox( FALSE, row5 ); - combo5->insertItem( "False" ); - combo5->insertItem( "True" ); + combo5 = new TQComboBox( FALSE, row5 ); + combo5->insertItem( "False" ); + combo5->insertItem( "True" ); // ...and again the activated() SIGNAL gets connected with a SLOT - connect( combo5, SIGNAL( activated( int ) ), this, SLOT( slotReadOnlyChanged( int ) ) ); + connect( combo5, SIGNAL( activated( int ) ), this, SLOT( slotReadOnlyChanged( int ) ) ); // and the last lineedit - lined5 = new TQLineEdit( this ); + lined5 = new TQLineEdit( this ); box->addWidget( lined5 ); // give the first LineEdit the focus at the beginning - lined1->setFocus(); + lined1->setFocus(); } /* @@ -234,17 +234,17 @@ void LineEdits::slotEchoChanged( int i ) { switch ( i ) { case 0: - lined1->setEchoMode( TQLineEdit::Normal ); + lined1->setEchoMode( TQLineEdit::Normal ); break; case 1: - lined1->setEchoMode( TQLineEdit::Password ); + lined1->setEchoMode( TQLineEdit::Password ); break; case 2: - lined1->setEchoMode( TQLineEdit::NoEcho ); + lined1->setEchoMode( TQLineEdit::NoEcho ); break; } - lined1->setFocus(); + lined1->setFocus(); } /* @@ -261,19 +261,19 @@ void LineEdits::slotValidatorChanged( int i ) { switch ( i ) { case 0: - lined2->setValidator( 0 ); + lined2->setValidator( 0 ); break; case 1: - lined2->setValidator( new TQIntValidator( lined2 ) ); + lined2->setValidator( new TQIntValidator( lined2 ) ); break; case 2: - lined2->setValidator( new TQDoubleValidator( -999.0, 999.0, 2, + lined2->setValidator( new TQDoubleValidator( -999.0, 999.0, 2, lined2 ) ); break; } - lined2->setText( "" ); - lined2->setFocus(); + lined2->setText( "" ); + lined2->setFocus(); } @@ -289,21 +289,21 @@ void LineEdits::slotAlignmentChanged( int i ) { switch ( i ) { case 0: - lined3->setAlignment( TQLineEdit::AlignLeft ); + lined3->setAlignment( TQLineEdit::AlignLeft ); break; case 1: - lined3->setAlignment( TQLineEdit::AlignCenter ); + lined3->setAlignment( TQLineEdit::AlignCenter ); break; case 2: - lined3->setAlignment( TQLineEdit::AlignRight ); + lined3->setAlignment( TQLineEdit::AlignRight ); break; } - lined3->setFocus(); + lined3->setFocus(); } /* - * SLOT slotInputMaskChanged( const TQString &mask ) + * SLOT slotInputMaskChanged( const TQString &mask ) * * i contains the number of the item which the user has been chosen in * the third Combobox. According to this value, we set an input mask on @@ -314,21 +314,21 @@ void LineEdits::slotInputMaskChanged( int i ) { switch( i ) { case 0: - lined4->setInputMask( TQString::null ); + lined4->setInputMask( TQString::null ); break; case 1: - lined4->setInputMask( "+99 99 99 99 99;_" ); + lined4->setInputMask( "+99 99 99 99 99;_" ); break; case 2: - lined4->setInputMask( "0000-00-00" ); - lined4->setText( "00000000" ); - lined4->setCursorPosition( 0 ); + lined4->setInputMask( "0000-00-00" ); + lined4->setText( "00000000" ); + lined4->setCursorPosition( 0 ); break; case 3: - lined4->setInputMask( ">AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#" ); + lined4->setInputMask( ">AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#" ); break; } - lined4->setFocus(); + lined4->setFocus(); } /* @@ -342,14 +342,14 @@ void LineEdits::slotReadOnlyChanged( int i ) { switch ( i ) { case 0: - lined5->setReadOnly( FALSE ); + lined5->setReadOnly( FALSE ); break; case 1: - lined5->setReadOnly( TRUE ); + lined5->setReadOnly( TRUE ); break; } - lined5->setFocus(); + lined5->setFocus(); } @@ -367,18 +367,18 @@ void LineEdits::slotReadOnlyChanged( int i ) *****************************************************************************/ #include "lineedits.h" -#include <qapplication.h> +#include <ntqapplication.h> int main( int argc, char **argv ) { - TQApplication a( argc, argv ); + TQApplication a( argc, argv ); LineEdits lineedits; - lineedits.setCaption( "TQt Example - Lineedits" ); - a.setMainWidget( &lineedits ); - lineedits.show(); + lineedits.setCaption( "TQt Example - Lineedits" ); + a.setMainWidget( &lineedits ); + lineedits.show(); - return a.exec(); + return a.exec(); } -- cgit v1.2.1