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/tabdialog.py | |
parent | b388516ca2691303a076a0764fd40bf7116fe43d (diff) | |
download | pytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip |
Initial TQt conversion
Diffstat (limited to 'examples3/tabdialog.py')
-rwxr-xr-x | examples3/tabdialog.py | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/examples3/tabdialog.py b/examples3/tabdialog.py index 0d37cc5..fe1ecd7 100755 --- a/examples3/tabdialog.py +++ b/examples3/tabdialog.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. ** ***************************************************************************""" @@ -13,100 +13,100 @@ import sys from qt import * -class TabDialog( QTabDialog ): +class TabDialog( TQTabDialog ): def __init__( self, parent=None, name=None, filename=None ): - QTabDialog.__init__( self, parent, name ) - self.filename = QString( filename ) - self.fileinfo = QFileInfo( filename ) + TQTabDialog.__init__( self, parent, name ) + self.filename = TQString( filename ) + self.fileinfo = TQFileInfo( filename ) self.setupTab1() self.setupTab2() self.setupTab3() self.connect( self, SIGNAL("applyButtonPressed()"), qApp, SLOT("quit()" ) ) def setupTab1( self ): - tab1 = QVBox( self ) + tab1 = TQVBox( self ) tab1.setMargin( 5 ) - QLabel( "Filename:", tab1 ) - fname = QLineEdit( self.filename, tab1 ) + TQLabel( "Filename:", tab1 ) + fname = TQLineEdit( self.filename, tab1 ) fname.setFocus() - QLabel( "Path:", tab1 ) - path = QLabel( self.fileinfo.dirPath( True ), tab1 ) - path.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Path:", tab1 ) + path = TQLabel( self.fileinfo.dirPath( True ), tab1 ) + path.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) - QLabel( "Size:", tab1 ) - size = QLabel( QString( "%1 KB" ).arg( self.fileinfo.size() ), tab1 ) - size.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Size:", tab1 ) + size = TQLabel( TQString( "%1 KB" ).arg( self.fileinfo.size() ), tab1 ) + size.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) - QLabel( "Last Read:", tab1 ) - lread = QLabel( self.fileinfo.lastRead().toString(), tab1 ) - lread.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Last Read:", tab1 ) + lread = TQLabel( self.fileinfo.lastRead().toString(), tab1 ) + lread.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) - QLabel( "Last Modified:", tab1 ) - lmodif = QLabel( self.fileinfo.lastModified().toString(), tab1 ) - lmodif.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Last Modified:", tab1 ) + lmodif = TQLabel( self.fileinfo.lastModified().toString(), tab1 ) + lmodif.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) self.addTab( tab1, "General" ) def setupTab2( self ): - tab2 = QVBox( self ) + tab2 = TQVBox( self ) tab2.setMargin( 5 ) - bg = QButtonGroup( 1, QGroupBox.Horizontal, "Permissions", tab2 ) + bg = TQButtonGroup( 1, TQGroupBox.Horizontal, "Permissions", tab2 ) - readable = QCheckBox( "Readable", bg ) + readable = TQCheckBox( "Readable", bg ) if self.fileinfo.isReadable() : readable.setChecked( True ) - writable = QCheckBox( "Writeable", bg ) + writable = TQCheckBox( "Writeable", bg ) if self.fileinfo.isWritable() : writable.setChecked( True ) - executable = QCheckBox( "Executable", bg ) + executable = TQCheckBox( "Executable", bg ) if self.fileinfo.isExecutable() : executable.setChecked( True ) - bg2 = QButtonGroup( 2, QGroupBox.Horizontal, "Owner", tab2 ) + bg2 = TQButtonGroup( 2, TQGroupBox.Horizontal, "Owner", tab2 ) - QLabel( "Owner", bg2 ) - owner = QLabel( self.fileinfo.owner(), bg2 ) - owner.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Owner", bg2 ) + owner = TQLabel( self.fileinfo.owner(), bg2 ) + owner.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) - QLabel( "Group", bg2 ) - group = QLabel( self.fileinfo.group(), bg2 ) - group.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Group", bg2 ) + group = TQLabel( self.fileinfo.group(), bg2 ) + group.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) self.addTab( tab2, "Permissions" ) def setupTab3( self ): - tab3 = QVBox( self ) + tab3 = TQVBox( self ) tab3.setMargin( 5 ) tab3.setSpacing( 5 ) - QLabel( QString( "Open %1 with:" ).arg( self.filename ), tab3 ) + TQLabel( TQString( "Open %1 with:" ).arg( self.filename ), tab3 ) - prgs = QListBox( tab3 ) + prgs = TQListBox( tab3 ) for i in range( 0, 30, 1 ) : - prg = QString( "Application %1" ).arg( i ) + prg = TQString( "Application %1" ).arg( i ) prgs.insertItem( prg ) prgs.setCurrentItem( 3 ) - QCheckBox( QString( "Open files with the extension '%1' always with this application" ).arg( self.fileinfo.extension() ), tab3 ) + TQCheckBox( TQString( "Open files with the extension '%1' always with this application" ).arg( self.fileinfo.extension() ), tab3 ) self.addTab( tab3, "Applications" ) def main( args ): - a = QApplication(sys.argv) + a = TQApplication(sys.argv) #sys.argv.append("tabdialog.py") # to test uncomment this line if len(sys.argv) < 2: - filename = QString(".") + filename = TQString(".") else: - filename = QString(sys.argv[1]) + filename = TQString(sys.argv[1]) tabdialog = TabDialog( None, "tabdialog", filename ) tabdialog.resize( 450, 350 ); - tabdialog.setCaption( "Qt Example - Tabbed Dialog" ) + tabdialog.setCaption( "TQt Example - Tabbed Dialog" ) a.setMainWidget( tabdialog ) tabdialog.show() |