diff options
Diffstat (limited to 'qtjava/javalib/examples/layout/ExampleWidget.java')
-rw-r--r-- | qtjava/javalib/examples/layout/ExampleWidget.java | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/qtjava/javalib/examples/layout/ExampleWidget.java b/qtjava/javalib/examples/layout/ExampleWidget.java index 77d96816..1bdc8e54 100644 --- a/qtjava/javalib/examples/layout/ExampleWidget.java +++ b/qtjava/javalib/examples/layout/ExampleWidget.java @@ -10,7 +10,7 @@ import org.kde.qt.*; -class ExampleWidget extends QWidget +class ExampleWidget extends TQWidget { ExampleWidget( ) @@ -18,18 +18,18 @@ ExampleWidget( ) this(null, null); } -ExampleWidget( QWidget parent, String name ) +ExampleWidget( TQWidget parent, String name ) { super( parent, name ); // Make the top-level layout; a vertical box to contain all widgets // and sub-layouts. - QBoxLayout topLayout = new QVBoxLayout( this, 5 ); + TQBoxLayout topLayout = new TQVBoxLayout( this, 5 ); // Create a menubar... - QMenuBar menubar = new QMenuBar( this ); - menubar.setSeparator( QMenuBar.InWindowsStyle ); - QPopupMenu popup; - popup = new QPopupMenu( this ); + TQMenuBar menubar = new TQMenuBar( this ); + menubar.setSeparator( TQMenuBar.InWindowsStyle ); + TQPopupMenu popup; + popup = new TQPopupMenu( this ); popup.insertItem( "&Quit", qApp(), SLOT("quit()") ); menubar.insertItem( "&File", popup ); @@ -37,10 +37,10 @@ ExampleWidget( QWidget parent, String name ) topLayout.setMenuBar( menubar ); // Make an hbox that will hold a row of buttons. - QBoxLayout buttons = new QHBoxLayout( topLayout ); + TQBoxLayout buttons = new TQHBoxLayout( topLayout ); int i; for ( i = 1; i <= 4; i++ ) { - QPushButton but = new QPushButton( this ); + TQPushButton but = new TQPushButton( this ); String s = "Button " + i; but.setText( s ); @@ -55,12 +55,12 @@ ExampleWidget( QWidget parent, String name ) } // Make another hbox that will hold a left-justified row of buttons. - QBoxLayout buttons2 = new QHBoxLayout( topLayout ); + TQBoxLayout buttons2 = new TQHBoxLayout( topLayout ); - QPushButton but = new QPushButton( "Button five", this ); + TQPushButton but = new TQPushButton( "Button five", this ); buttons2.addWidget( but ); - but = new QPushButton( "Button 6", this ); + but = new TQPushButton( "Button 6", this ); buttons2.addWidget( but ); // Fill up the rest of the hbox with stretchable space, so that @@ -68,9 +68,9 @@ ExampleWidget( QWidget parent, String name ) buttons2.addStretch( 10 ); // Make a big widget that will grab all space in the middle. - QMultiLineEdit bigWidget = new QMultiLineEdit( this ); + TQMultiLineEdit bigWidget = new TQMultiLineEdit( this ); bigWidget.setText( "This widget will get all the remaining space" ); - bigWidget.setFrameStyle( QFrame.Panel | QFrame.Plain ); + bigWidget.setFrameStyle( TQFrame.Panel | TQFrame.Plain ); // Set vertical stretch factor to 10 to let the bigWidget stretch // vertically. It will stretch horizontally because there are no @@ -78,10 +78,10 @@ ExampleWidget( QWidget parent, String name ) // topLayout.addWidget( bigWidget, 10 ); topLayout.addWidget( bigWidget ); - // Make a grid that will hold a vertical table of QLabel/QLineEdit - // pairs next to a large QMultiLineEdit. + // Make a grid that will hold a vertical table of TQLabel/TQLineEdit + // pairs next to a large TQMultiLineEdit. - // Don't use hard-coded row/column numbers in QGridLayout, you'll + // Don't use hard-coded row/column numbers in TQGridLayout, you'll // regret it when you have to change the layout. int numRows = 3; int labelCol = 0; @@ -90,17 +90,17 @@ ExampleWidget( QWidget parent, String name ) // Let the grid-layout have a spacing of 10 pixels between // widgets, overriding the default from topLayout. - QGridLayout grid = new QGridLayout( topLayout, 0, 0, 10 ); + TQGridLayout grid = new TQGridLayout( topLayout, 0, 0, 10 ); int row; for ( row = 0; row < numRows; row++ ) { - QLineEdit ed = new QLineEdit( this ); + TQLineEdit ed = new TQLineEdit( this ); // The line edit goes in the second column grid.addWidget( ed, row, linedCol ); // Make a label that is a buddy of the line edit String s= "Line &" + (row+1); - QLabel label = new QLabel( ed, s, this ); + TQLabel label = new TQLabel( ed, s, this ); // The label goes in the first column. grid.addWidget( label, row, labelCol ); } @@ -108,7 +108,7 @@ ExampleWidget( QWidget parent, String name ) // The multiline edit will cover the entire vertical range of the // grid (rows 0 to numRows) and stay in column 2. - QMultiLineEdit med = new QMultiLineEdit( this ); + TQMultiLineEdit med = new TQMultiLineEdit( this ); grid.addMultiCellWidget( med, 0, -1, multiCol, multiCol ); // The labels will take the space they need. Let the remaining @@ -118,9 +118,9 @@ ExampleWidget( QWidget parent, String name ) grid.setColStretch( multiCol, 20 ); // Add a widget at the bottom. - QLabel sb = new QLabel( this ); + TQLabel sb = new TQLabel( this ); sb.setText( "Let's pretend this is a status bar" ); - sb.setFrameStyle( QFrame.Panel | QFrame.Sunken ); + sb.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ); // This widget will use all horizontal space, and have a fixed height. // we should have made a subclass and implemented sizePolicy there... @@ -135,7 +135,7 @@ ExampleWidget( QWidget parent, String name ) public static void main( String[] args ) { - QApplication a = new QApplication( args ); + TQApplication a = new TQApplication( args ); ExampleWidget f = new ExampleWidget(); a.setMainWidget(f); |