diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-29 01:11:08 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-29 01:11:08 -0600 |
commit | 8a055d66f43592c257cece2eb8cc021808062917 (patch) | |
tree | d0922f201bd5d24b62a33160d1d9baf9e89f9a70 /examples3/buttongroups.py | |
parent | b388516ca2691303a076a0764fd40bf7116fe43d (diff) | |
download | pytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip |
Initial TQt conversion
Diffstat (limited to 'examples3/buttongroups.py')
-rwxr-xr-x | examples3/buttongroups.py | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/examples3/buttongroups.py b/examples3/buttongroups.py index c998a88..65b8a96 100755 --- a/examples3/buttongroups.py +++ b/examples3/buttongroups.py @@ -4,7 +4,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. #** #*****************************************************************************/ @@ -19,58 +19,58 @@ FALSE = 0 # Creates all child widgets of the ButtonGroups window ## -class ButtonsGroups( QWidget ): +class ButtonsGroups( TQWidget ): def __init__( self, *args ): - apply( QWidget.__init__, (self,) + args ) + apply( TQWidget.__init__, (self,) + args ) # Create Widgets which allow easy layouting - self.vbox = QVBoxLayout( self, 11, 6 ) - self.box1 = QHBoxLayout( self.vbox ) - self.box2 = QHBoxLayout( self.vbox ) + self.vbox = TQVBoxLayout( self, 11, 6 ) + self.box1 = TQHBoxLayout( self.vbox ) + self.box2 = TQHBoxLayout( self.vbox ) # ------- first group # Create an exclusive button group - self.grp1 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 1 (exclusive)", self ) + self.grp1 = TQButtonGroup( 1, TQGroupBox.Horizontal, "Button Group 1 (exclusive)", self ) self.box1.addWidget( self.grp1 ) self.grp1.setExclusive( TRUE ) # insert 3 radiobuttons - self.rb11 = QRadioButton( "&Radiobutton 1", self.grp1 ) + self.rb11 = TQRadioButton( "&Radiobutton 1", self.grp1 ) self.rb11.setChecked( TRUE ) - QRadioButton( "R&adiobutton 2", self.grp1 ) - QRadioButton( "Ra&diobutton 3", self.grp1 ) + TQRadioButton( "R&adiobutton 2", self.grp1 ) + TQRadioButton( "Ra&diobutton 3", self.grp1 ) # ------- second group # Create a non-exclusive buttongroup - self.grp2 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 2 (non-exclusive)", self ) + self.grp2 = TQButtonGroup( 1, TQGroupBox.Horizontal, "Button Group 2 (non-exclusive)", self ) self.box1.addWidget( self.grp2 ) self.grp2.setExclusive( FALSE ) # insert 3 checkboxes - QCheckBox( "&Checkbox 1", self.grp2 ) - self.cb12 = QCheckBox( "C&heckbox 2", self.grp2 ) + TQCheckBox( "&Checkbox 1", self.grp2 ) + self.cb12 = TQCheckBox( "C&heckbox 2", self.grp2 ) self.cb12.setChecked( TRUE ) - self.cb13 = QCheckBox( "Triple &State Button", self.grp2 ) + self.cb13 = TQCheckBox( "Triple &State Button", self.grp2 ) self.cb13.setTristate( TRUE ) self.cb13.setChecked( TRUE ) # ------------ third group # create a buttongroup which is exclusive for radiobuttons and non-exclusive for all other buttons - self.grp3 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 3 (Radiobutton-exclusive)", self ) + self.grp3 = TQButtonGroup( 1, TQGroupBox.Horizontal, "Button Group 3 (Radiobutton-exclusive)", self ) self.box2.addWidget( self.grp3 ) self.grp3.setRadioButtonExclusive( TRUE ) # insert three radiobuttons - self.rb21 = QRadioButton( "Rad&iobutton 1", self.grp3 ) - self.rb22 = QRadioButton( "Radi&obutton 2", self.grp3 ) - self.rb23 = QRadioButton( "Radio&button 3", self.grp3 ) + self.rb21 = TQRadioButton( "Rad&iobutton 1", self.grp3 ) + self.rb22 = TQRadioButton( "Radi&obutton 2", self.grp3 ) + self.rb23 = TQRadioButton( "Radio&button 3", self.grp3 ) self.rb23.setChecked( TRUE ) # insert a checkbox... - self.state = QCheckBox( "E&nable Radiobuttons", self.grp3 ) + self.state = TQCheckBox( "E&nable Radiobuttons", self.grp3 ) self.state.setChecked( TRUE ) # ...and connect its SIGNAL clicked() with the SLOT slotChangeGrp3State() self.connect( self.state, SIGNAL( "clicked()" ), self.slotChangeGrp3State ) @@ -78,24 +78,24 @@ class ButtonsGroups( QWidget ): # ------------ fourth group # create a groupbox which layouts its childs in a columns - self.grp4 = QButtonGroup( 1, QGroupBox.Horizontal, "Groupbox with normal buttons", self ) + self.grp4 = TQButtonGroup( 1, TQGroupBox.Horizontal, "Groupbox with normal buttons", self ) self.box2.addWidget( self.grp4 ) # insert two pushbuttons... - QPushButton( "&Push Button", self.grp4 ) - self.tb2 = QPushButton( "&Toggle Button", self.grp4 ) + TQPushButton( "&Push Button", self.grp4 ) + self.tb2 = TQPushButton( "&Toggle Button", self.grp4 ) # ... and make the second one a toggle button self.tb2.setToggleButton( TRUE ) self.tb2.setOn( TRUE ) # ... and make the third one a flat button - self.tb3 = QPushButton( "&Flat Button", self.grp4 ) + self.tb3 = TQPushButton( "&Flat Button", self.grp4 ) self.tb3.setFlat( TRUE ) # .. and the fourth a button with a menu - self.tb4 = QPushButton( "Popup Button", self.grp4 ) - menu = QPopupMenu(self.tb4) + self.tb4 = TQPushButton( "Popup Button", self.grp4 ) + menu = TQPopupMenu(self.tb4) menu.insertItem("Item1", 0) menu.insertItem("Item2", 0) menu.insertItem("Item3", 0) @@ -114,7 +114,7 @@ class ButtonsGroups( QWidget ): ## main program -a = QApplication( sys.argv ) +a = TQApplication( sys.argv ) buttonsgroups = ButtonsGroups() buttonsgroups.resize( 500, 250 ) |