summaryrefslogtreecommitdiffstats
path: root/examples3/listbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples3/listbox.py')
-rwxr-xr-xexamples3/listbox.py64
1 files changed, 32 insertions, 32 deletions
diff --git a/examples3/listbox.py b/examples3/listbox.py
index 624935d..c83add0 100755
--- a/examples3/listbox.py
+++ b/examples3/listbox.py
@@ -5,7 +5,7 @@
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
-** This file is part of an example program for Qt. This example
+** This file is part of an example program for TQt. This example
** program may be used, distributed and modified without limitation.
**
***************************************************************************"""
@@ -16,42 +16,42 @@ from qt import *
FALSE = 0
TRUE = 1
-class ListBoxDemo( QWidget ):
+class ListBoxDemo( TQWidget ):
def __init__( self, parent=None, name=None ):
- QWidget.__init__( self, parent, name )
+ TQWidget.__init__( self, parent, name )
b = FALSE
- g = QGridLayout( self, 2, 2, 6 )
+ g = TQGridLayout( self, 2, 2, 6 )
- g.addWidget( QLabel( "<b>Configuration:</b>", self ), 0, 0 )
- g.addWidget( QLabel( "<b>Result:</b>", self ), 0, 1 )
+ g.addWidget( TQLabel( "<b>Configuration:</b>", self ), 0, 0 )
+ g.addWidget( TQLabel( "<b>Result:</b>", self ), 0, 1 )
- self.l = QListBox( self )
+ self.l = TQListBox( self )
g.addWidget( self.l, 1, 1 )
- self.l.setFocusPolicy( QWidget.StrongFocus )
+ self.l.setFocusPolicy( TQWidget.StrongFocus )
- v = QVBoxLayout( )
+ v = TQVBoxLayout( )
g.addLayout( v, 1, 0 )
- bg = QButtonGroup( self, None )
+ bg = TQButtonGroup( self, None )
- b = QRadioButton( "Fixed number of columns,\n"
+ b = TQRadioButton( "Fixed number of columns,\n"
"as many rows as needed.",
self )
bg.insert( b )
v.addWidget( b )
b.setChecked( TRUE )
self.connect( b, SIGNAL("clicked()"), self.setNumCols )
- h = QHBoxLayout()
+ h = TQHBoxLayout()
v.addLayout( h )
h.addSpacing( 30 )
h.addSpacing( 100 )
- h.addWidget( QLabel( "Columns:", self ) )
- self.columns = QSpinBox( self )
+ h.addWidget( TQLabel( "Columns:", self ) )
+ self.columns = TQSpinBox( self )
h.addWidget( self.columns )
v.addSpacing( 12 )
- b = QRadioButton( "As many columns as fit on-screen,\n"
+ b = TQRadioButton( "As many columns as fit on-screen,\n"
"as many rows as needed.",
self )
bg.insert( b )
@@ -60,24 +60,24 @@ class ListBoxDemo( QWidget ):
v.addSpacing( 12 )
- b = QRadioButton( "Fixed number of rows,\n"
+ b = TQRadioButton( "Fixed number of rows,\n"
"as many columns as needed.",
self )
bg.insert( b )
v.addWidget( b )
self.connect( b, SIGNAL("clicked()"), self.setNumRows )
- h = QHBoxLayout()
+ h = TQHBoxLayout()
v.addLayout( h )
h.addSpacing( 30 )
h.addSpacing( 100 )
- h.addWidget( QLabel( "Rows:", self ) )
- self.rows = QSpinBox( self )
+ h.addWidget( TQLabel( "Rows:", self ) )
+ self.rows = TQSpinBox( self )
self.rows.setEnabled( FALSE )
h.addWidget( self.rows )
v.addSpacing( 12 )
- b = QRadioButton( "As many rows as fit on-screen,\n"
+ b = TQRadioButton( "As many rows as fit on-screen,\n"
"as many columns as needed.",
self )
bg.insert( b )
@@ -86,25 +86,25 @@ class ListBoxDemo( QWidget ):
v.addSpacing( 12 )
- cb = QCheckBox( "Variable-height rows", self )
+ cb = TQCheckBox( "Variable-height rows", self )
cb.setChecked( TRUE )
self.connect( cb, SIGNAL("toggled(bool)"), self.setVariableHeight )
v.addWidget( cb )
v.addSpacing( 6 )
- cb = QCheckBox( "Variable-width columns", self )
+ cb = TQCheckBox( "Variable-width columns", self )
self.connect( cb, SIGNAL("toggled(bool)"), self.setVariableWidth )
v.addWidget( cb )
- cb = QCheckBox( "Extended-Selection", self )
+ cb = TQCheckBox( "Extended-Selection", self )
self.connect( cb, SIGNAL("toggled(bool)"), self.setMultiSelection )
v.addWidget( cb )
- pb = QPushButton( "Sort ascending", self )
+ pb = TQPushButton( "Sort ascending", self )
self.connect( pb, SIGNAL("clicked()"), self.sortAscending )
v.addWidget( pb )
- pb = QPushButton( "Sort descending", self )
+ pb = TQPushButton( "Sort descending", self )
self.connect( pb, SIGNAL("clicked()"), self.sortDescending )
v.addWidget( pb )
@@ -113,7 +113,7 @@ class ListBoxDemo( QWidget ):
i = 0
while i <= 2560:
i+=1
- self.l.insertItem( str(QString.fromLatin1( "Item " )) + str(QString.number( i )), i )
+ self.l.insertItem( str(TQString.fromLatin1( "Item " )) + str(TQString.number( i )), i )
self.columns.setRange( 1, 256 )
self.columns.setValue( 1 )
self.rows.setRange( 1, 256 )
@@ -136,12 +136,12 @@ class ListBoxDemo( QWidget ):
def setRowsByHeight( self ):
self.columns.setEnabled( FALSE )
self.rows.setEnabled( FALSE )
- self.l.setRowMode( QListBox.FitToHeight )
+ self.l.setRowMode( TQListBox.FitToHeight )
def setColsByWidth( self ):
self.columns.setEnabled( FALSE )
self.rows.setEnabled( FALSE )
- self.l.setColumnMode( QListBox.FitToWidth )
+ self.l.setColumnMode( TQListBox.FitToWidth )
def setVariableWidth( self, b ):
self.l.setVariableWidth( b )
@@ -152,9 +152,9 @@ class ListBoxDemo( QWidget ):
def setMultiSelection( self, b ):
self.l.clearSelection()
if b :
- self.l.setSelectionMode( QListBox.Extended )
+ self.l.setSelectionMode( TQListBox.Extended )
else:
- self.l.setSelectionMode( QListBox.Single )
+ self.l.setSelectionMode( TQListBox.Single )
def sortAscending( self ):
self.l.sort( TRUE )
@@ -164,9 +164,9 @@ class ListBoxDemo( QWidget ):
def main( args ):
- a = QApplication( args )
+ a = TQApplication( args )
t = ListBoxDemo()
- t.setCaption( "Qt Example - Listbox" )
+ t.setCaption( "TQt Example - Listbox" )
a.setMainWidget( t )
t.show()