diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
commit | 9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch) | |
tree | c81c34dae2b3b1ea73801bf18a960265dc4207f7 /qtjava/javalib/examples/lineedits | |
parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip |
Initial TQt conversion
Diffstat (limited to 'qtjava/javalib/examples/lineedits')
-rw-r--r-- | qtjava/javalib/examples/lineedits/LineEdits.java | 58 | ||||
-rw-r--r-- | qtjava/javalib/examples/lineedits/Main.java | 2 |
2 files changed, 30 insertions, 30 deletions
diff --git a/qtjava/javalib/examples/lineedits/LineEdits.java b/qtjava/javalib/examples/lineedits/LineEdits.java index ce79891f..4586dbf6 100644 --- a/qtjava/javalib/examples/lineedits/LineEdits.java +++ b/qtjava/javalib/examples/lineedits/LineEdits.java @@ -9,10 +9,10 @@ ****************************************************************************/ import org.kde.qt.*; -class LineEdits extends QGroupBox +class LineEdits extends TQGroupBox { -protected QLineEdit lined1, lined2, lined3, lined4; -protected QComboBox combo1, combo2, combo3, combo4; +protected TQLineEdit lined1, lined2, lined3, lined4; +protected TQComboBox combo1, combo2, combo3, combo4; @@ -28,22 +28,22 @@ LineEdits( ) this(null, null); } -LineEdits( QWidget parent, String name ) +LineEdits( TQWidget parent, String name ) { super( 0, Horizontal, "Line edits", parent, name ); setMargin( 10 ); - QVBoxLayout box = new QVBoxLayout( layout() ); + TQVBoxLayout box = new TQVBoxLayout( layout() ); - QHBoxLayout row1 = new QHBoxLayout( box ); + TQHBoxLayout row1 = new TQHBoxLayout( box ); row1.setMargin( 5 ); // Create a Label - QLabel label = new QLabel( "Echo Mode: ", this); + TQLabel label = new TQLabel( "Echo Mode: ", this); row1.addWidget( label ); // Create a Combobox with three items... - combo1 = new QComboBox( false, this ); + combo1 = new TQComboBox( false, this ); row1.addWidget( combo1 ); combo1.insertItem( "Normal", -1 ); combo1.insertItem( "Password", -1 ); @@ -53,19 +53,19 @@ LineEdits( QWidget parent, String name ) connect( combo1, SIGNAL(" activated( int )"), this, SLOT(" slotEchoChanged( int )") ); // insert the first LineEdit - lined1 = new QLineEdit( this ); + lined1 = new TQLineEdit( this ); box.addWidget( lined1 ); // another widget which is used for layouting - QHBoxLayout row2 = new QHBoxLayout( box ); + TQHBoxLayout row2 = new TQHBoxLayout( box ); row2.setMargin( 5 ); // and the second label - label = new QLabel( "Validator: ", this ); + label = new TQLabel( "Validator: ", this ); row2.addWidget( label ); // A second Combobox with again three items... - combo2 = new QComboBox( false, this ); + combo2 = new TQComboBox( false, this ); row2.addWidget( combo2 ); combo2.insertItem( "No Validator", -1 ); combo2.insertItem( "Integer Validator", -1 ); @@ -74,19 +74,19 @@ LineEdits( QWidget parent, String name ) connect( combo2, SIGNAL(" activated( int )"), this, SLOT(" slotValidatorChanged( int )") ); // and the second LineEdit - lined2 = new QLineEdit( this ); + lined2 = new TQLineEdit( this ); box.addWidget( lined2 ); // yet another widget which is used for layouting - QHBoxLayout row3 = new QHBoxLayout( box ); + TQHBoxLayout row3 = new TQHBoxLayout( box ); row3.setMargin( 5 ); // we need a label for this too - label = new QLabel( "Alignment: ", this ); + label = new TQLabel( "Alignment: ", this ); row3.addWidget( label ); // A combo box for setting alignment - combo3 = new QComboBox( false, this ); + combo3 = new TQComboBox( false, this ); row3.addWidget( combo3 ); combo3.insertItem( "Left", -1 ); combo3.insertItem( "Centered", -1 ); @@ -95,26 +95,26 @@ LineEdits( QWidget parent, String name ) connect( combo3, SIGNAL(" activated( int )"), this, SLOT(" slotAlignmentChanged( int )") ); // and the third lineedit - lined3 = new QLineEdit( this ); + lined3 = new TQLineEdit( this ); box.addWidget( lined3 ); // last widget used for layouting - QHBox row4 = new QHBox( this ); + TQHBox row4 = new TQHBox( this ); box.addWidget( row4 ); row4.setMargin( 5 ); // last label - new QLabel( "Read-Only: ", row4 ); + new TQLabel( "Read-Only: ", row4 ); // A combo box for setting alignment - combo4 = new QComboBox( false, row4 ); + combo4 = new TQComboBox( false, row4 ); combo4.insertItem( "False", -1 ); combo4.insertItem( "True", -1 ); // ...and again the activated() SIGNAL gets connected with a SLOT connect( combo4, SIGNAL(" activated( int )"), this, SLOT(" slotReadOnlyChanged( int )") ); // and the last lineedit - lined4 = new QLineEdit( this ); + lined4 = new TQLineEdit( this ); box.addWidget( lined4 ); // give the first LineEdit the focus at the beginning @@ -133,13 +133,13 @@ void slotEchoChanged( int i ) { switch ( i ) { case 0: - lined1.setEchoMode( QLineEdit.Normal ); + lined1.setEchoMode( TQLineEdit.Normal ); break; case 1: - lined1.setEchoMode( QLineEdit.Password ); + lined1.setEchoMode( TQLineEdit.Password ); break; case 2: - lined1.setEchoMode( QLineEdit.NoEcho ); + lined1.setEchoMode( TQLineEdit.NoEcho ); break; } @@ -163,10 +163,10 @@ void slotValidatorChanged( int i ) lined2.setValidator( null ); break; case 1: - lined2.setValidator( new QIntValidator( lined2 ) ); + lined2.setValidator( new TQIntValidator( lined2 ) ); break; case 2: - lined2.setValidator( new QDoubleValidator( -999.0, 999.0, 2, + lined2.setValidator( new TQDoubleValidator( -999.0, 999.0, 2, lined2 ) ); break; } @@ -188,13 +188,13 @@ void slotAlignmentChanged( int i ) { switch ( i ) { case 0: - lined3.setAlignment( QLineEdit.AlignLeft ); + lined3.setAlignment( TQLineEdit.AlignLeft ); break; case 1: - lined3.setAlignment( QLineEdit.AlignCenter ); + lined3.setAlignment( TQLineEdit.AlignCenter ); break; case 2: - lined3.setAlignment( QLineEdit.AlignRight ); + lined3.setAlignment( TQLineEdit.AlignRight ); break; } diff --git a/qtjava/javalib/examples/lineedits/Main.java b/qtjava/javalib/examples/lineedits/Main.java index 19424534..7ac06fea 100644 --- a/qtjava/javalib/examples/lineedits/Main.java +++ b/qtjava/javalib/examples/lineedits/Main.java @@ -14,7 +14,7 @@ public class Main { public static void main(String[] args) { - QApplication a = new QApplication( args ); + TQApplication a = new TQApplication( args ); LineEdits lineedits = new LineEdits(); lineedits.setCaption( "Qt Example - Lineedits" ); |