From 9ba04742771370f59740e32e11c5f3a1e6a1b70a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 5 Dec 2011 15:55:57 -0600 Subject: Initial TQt conversion --- qtjava/javalib/examples/listbox/ListBoxDemo.java | 62 ++++++++++++------------ qtjava/javalib/examples/listbox/Main.java | 2 +- 2 files changed, 32 insertions(+), 32 deletions(-) (limited to 'qtjava/javalib/examples/listbox') diff --git a/qtjava/javalib/examples/listbox/ListBoxDemo.java b/qtjava/javalib/examples/listbox/ListBoxDemo.java index 60eecffc..77ef7635 100644 --- a/qtjava/javalib/examples/listbox/ListBoxDemo.java +++ b/qtjava/javalib/examples/listbox/ListBoxDemo.java @@ -12,51 +12,51 @@ import org.kde.qt.*; -class ListBoxDemo extends QWidget +class ListBoxDemo extends TQWidget { -private QListBox l; -private QSpinBox columns; -private QSpinBox rows; -private QButtonGroup bg; +private TQListBox l; +private TQSpinBox columns; +private TQSpinBox rows; +private TQButtonGroup bg; ListBoxDemo() { super( null, null ); - QGridLayout g = new QGridLayout( this, 2, 2, 6 ); + TQGridLayout g = new TQGridLayout( this, 2, 2, 6 ); - g.addWidget( new QLabel( "Configuration:", this ), 0, 0 ); - g.addWidget( new QLabel( "Result:", this ), 0, 1 ); + g.addWidget( new TQLabel( "Configuration:", this ), 0, 0 ); + g.addWidget( new TQLabel( "Result:", this ), 0, 1 ); - l = new QListBox( this ); + l = new TQListBox( this ); g.addWidget( l, 1, 1 ); - l.setFocusPolicy( QWidget.StrongFocus ); + l.setFocusPolicy( TQWidget.StrongFocus ); - QVBoxLayout v = new QVBoxLayout(); + TQVBoxLayout v = new TQVBoxLayout(); g.addLayout( v, 1, 0 ); - QRadioButton b = null; - bg = new QButtonGroup( (QWidget) null ); + TQRadioButton b = null; + bg = new TQButtonGroup( (TQWidget) null ); - b = new QRadioButton( "Fixed number of columns,\n" + b = new TQRadioButton( "Fixed number of columns,\n" + "as many rows as needed.", this ); bg.insert( b ); v.addWidget( b ); b.setChecked( true ); connect( b, SIGNAL("clicked()"), this, SLOT("setNumCols()") ); - QHBoxLayout h = new QHBoxLayout(); + TQHBoxLayout h = new TQHBoxLayout(); v.addLayout( h ); h.addSpacing( 30 ); h.addSpacing( 100 ); - h.addWidget( new QLabel( "Columns:", this ) ); - columns = new QSpinBox( this ); + h.addWidget( new TQLabel( "Columns:", this ) ); + columns = new TQSpinBox( this ); h.addWidget( columns ); v.addSpacing( 12 ); - b = new QRadioButton( "As many columns as fit on-screen,\n" + b = new TQRadioButton( "As many columns as fit on-screen,\n" + "as many rows as needed.", this ); bg.insert( b ); @@ -65,24 +65,24 @@ ListBoxDemo() v.addSpacing( 12 ); - b = new QRadioButton( "Fixed number of rows,\n" + b = new TQRadioButton( "Fixed number of rows,\n" + "as many columns as needed.", this ); bg.insert( b ); v.addWidget( b ); connect( b, SIGNAL("clicked()"), this, SLOT("setNumRows()") ); - h = new QHBoxLayout(); + h = new TQHBoxLayout(); v.addLayout( h ); h.addSpacing( 30 ); h.addSpacing( 100 ); - h.addWidget( new QLabel( "Rows:", this ) ); - rows = new QSpinBox( this ); + h.addWidget( new TQLabel( "Rows:", this ) ); + rows = new TQSpinBox( this ); rows.setEnabled( false ); h.addWidget( rows ); v.addSpacing( 12 ); - b = new QRadioButton( "As many rows as fit on-screen,\n" + b = new TQRadioButton( "As many rows as fit on-screen,\n" + "as many columns as needed.", this ); bg.insert( b ); @@ -91,25 +91,25 @@ ListBoxDemo() v.addSpacing( 12 ); - QCheckBox cb = new QCheckBox( "Variable-height rows", this ); + TQCheckBox cb = new TQCheckBox( "Variable-height rows", this ); cb.setChecked( true ); connect( cb, SIGNAL("toggled(boolean)"), this, SLOT("setVariableHeight(boolean)") ); v.addWidget( cb ); v.addSpacing( 6 ); - cb = new QCheckBox( "Variable-width columns", this ); + cb = new TQCheckBox( "Variable-width columns", this ); connect( cb, SIGNAL("toggled(boolean)"), this, SLOT("setVariableWidth(boolean)") ); v.addWidget( cb ); - cb = new QCheckBox( "Extended-Selection", this ); + cb = new TQCheckBox( "Extended-Selection", this ); connect( cb, SIGNAL("toggled(boolean)"), this, SLOT("setMultiSelection(boolean)") ); v.addWidget( cb ); - QPushButton pb = new QPushButton( "Sort ascending", this ); + TQPushButton pb = new TQPushButton( "Sort ascending", this ); connect( pb, SIGNAL(" clicked()"), this, SLOT(" sortAscending()") ); v.addWidget( pb ); - pb = new QPushButton( "Sort descending", this ); + pb = new TQPushButton( "Sort descending", this ); connect( pb, SIGNAL(" clicked()"), this, SLOT(" sortDescending()") ); v.addWidget( pb ); @@ -149,7 +149,7 @@ void setRowsByHeight() { columns.setEnabled( false ); rows.setEnabled( false ); - l.setRowMode( QListBox.FitToHeight ); + l.setRowMode( TQListBox.FitToHeight ); } @@ -157,7 +157,7 @@ void setColsByWidth() { columns.setEnabled( false ); rows.setEnabled( false ); - l.setColumnMode( QListBox.FitToWidth ); + l.setColumnMode( TQListBox.FitToWidth ); } @@ -175,7 +175,7 @@ void setVariableHeight( boolean b ) void setMultiSelection( boolean b ) { l.clearSelection(); - l.setSelectionMode( b ? QListBox.Extended : QListBox.Single ); + l.setSelectionMode( b ? TQListBox.Extended : TQListBox.Single ); } void sortAscending() diff --git a/qtjava/javalib/examples/listbox/Main.java b/qtjava/javalib/examples/listbox/Main.java index ff21a95f..4b836bb1 100644 --- a/qtjava/javalib/examples/listbox/Main.java +++ b/qtjava/javalib/examples/listbox/Main.java @@ -13,7 +13,7 @@ public class Main { public static void main(String[] args) { - QApplication a = new QApplication( args ); + TQApplication a = new TQApplication( args ); ListBoxDemo t = new ListBoxDemo(); t.setCaption( "Qt Example - Listbox" ); -- cgit v1.2.1