summaryrefslogtreecommitdiffstats
path: root/examples2
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-29 01:11:08 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-29 01:11:08 -0600
commit8a055d66f43592c257cece2eb8cc021808062917 (patch)
treed0922f201bd5d24b62a33160d1d9baf9e89f9a70 /examples2
parentb388516ca2691303a076a0764fd40bf7116fe43d (diff)
downloadpytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz
pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip
Initial TQt conversion
Diffstat (limited to 'examples2')
-rw-r--r--examples2/README4
-rwxr-xr-xexamples2/aclock.py26
-rwxr-xr-xexamples2/addressbook.py116
-rwxr-xr-xexamples2/application.py76
-rwxr-xr-xexamples2/buttongroups.py46
-rwxr-xr-xexamples2/dclock.py16
-rwxr-xr-xexamples2/desktop.py44
-rwxr-xr-xexamples2/dirview.py20
-rwxr-xr-xexamples2/dragdrop.py36
-rw-r--r--examples2/dropsite.py52
-rwxr-xr-xexamples2/gears.py12
-rwxr-xr-xexamples2/menu.py92
-rw-r--r--examples2/secret.py20
-rwxr-xr-xexamples2/semaphore.py66
-rwxr-xr-xexamples2/splitter.py26
-rwxr-xr-xexamples2/table.py16
-rwxr-xr-xexamples2/themes.py618
-rw-r--r--examples2/trolltech.bmpbin30054 -> 30055 bytes
-rw-r--r--examples2/trolltech.gifbin42629 -> 42634 bytes
-rw-r--r--examples2/tt-logo.pngbin4547 -> 4548 bytes
-rwxr-xr-xexamples2/tut1.py6
-rwxr-xr-xexamples2/tut10.py48
-rwxr-xr-xexamples2/tut11.py70
-rwxr-xr-xexamples2/tut12.py90
-rwxr-xr-xexamples2/tut13.py110
-rwxr-xr-xexamples2/tut14.py134
-rwxr-xr-xexamples2/tut2.py10
-rwxr-xr-xexamples2/tut3.py12
-rwxr-xr-xexamples2/tut4.py12
-rwxr-xr-xexamples2/tut5.py16
-rwxr-xr-xexamples2/tut6.py22
-rwxr-xr-xexamples2/tut7.py22
-rwxr-xr-xexamples2/tut8.py34
-rwxr-xr-xexamples2/tut9.py44
-rwxr-xr-xexamples2/widgets.py248
35 files changed, 1082 insertions, 1082 deletions
diff --git a/examples2/README b/examples2/README
index 1c1938f..a337e9b 100644
--- a/examples2/README
+++ b/examples2/README
@@ -2,9 +2,9 @@ To run these examples, make sure you have your PYTHONPATH environment variable
set if needed and explicitly set the path to python at the top of each script
if you don't have /usr/bin/env.
-The examples are written for Qt v2.x.
+The examples are written for TQt v2.x.
-A much better source of information about using PyQt is Boudewijn Rempt's
+A much better source of information about using PyTQt is Boudewijn Rempt's
book at http://stage.linuxports.com/projects/pyqt/.
Phil Thompson
diff --git a/examples2/aclock.py b/examples2/aclock.py
index 38ed36c..9fc773b 100755
--- a/examples2/aclock.py
+++ b/examples2/aclock.py
@@ -3,34 +3,34 @@
import sys
from qt import *
-def QMIN(x, y):
+def TQMIN(x, y):
if y > x: return y
return x
-class AnalogClock(QWidget):
+class AnalogClock(TQWidget):
def __init__(self, *args):
- apply(QWidget.__init__,(self,) + args)
- self.time = QTime.currentTime()
- internalTimer = QTimer(self)
+ apply(TQWidget.__init__,(self,) + args)
+ self.time = TQTime.currentTime()
+ internalTimer = TQTimer(self)
self.connect(internalTimer, SIGNAL("timeout()"), self.timeout)
internalTimer.start(5000)
def timeout(self):
- new_time = QTime.currentTime()
+ new_time = TQTime.currentTime()
if new_time.minute() != self.time.minute():
self.update()
def paintEvent(self, qe):
if not self.isVisible():
return
- self.time = QTime.currentTime()
+ self.time = TQTime.currentTime()
- pts = QPointArray()
- paint = QPainter(self)
+ pts = TQPointArray()
+ paint = TQPainter(self)
paint.setBrush(self.foregroundColor())
- cp = QPoint(self.rect().center())
- d = QMIN(self.width(), self.height())
- matrix = QWMatrix()
+ cp = TQPoint(self.rect().center())
+ d = TQMIN(self.width(), self.height())
+ matrix = TQWMatrix()
matrix.translate(cp.x(), cp.y())
matrix.scale(d/1000.0, d/1000.0)
@@ -53,7 +53,7 @@ class AnalogClock(QWidget):
paint.drawLine(450,0, 500,0)
matrix.rotate(30)
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
clock = AnalogClock()
clock.resize(100,100)
a.setMainWidget(clock)
diff --git a/examples2/addressbook.py b/examples2/addressbook.py
index d7316e3..e151996 100755
--- a/examples2/addressbook.py
+++ b/examples2/addressbook.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# A port to PyQt of the application example from Qt v2.x.
+# A port to PyTQt of the application example from TQt v2.x.
import sys, string
@@ -76,10 +76,10 @@ fileprint = [
'dd...........ddd'
]
-class ABCentralWidget( QWidget ):
+class ABCentralWidget( TQWidget ):
def __init__( self, *args ):
- apply( QWidget.__init__, (self, ) + args )
- self.mainGrid = QGridLayout( self, 2, 1, 5, 5 )
+ apply( TQWidget.__init__, (self, ) + args )
+ self.mainGrid = TQGridLayout( self, 2, 1, 5, 5 )
self.setupTabWidget()
self.setupListView()
@@ -91,16 +91,16 @@ class ABCentralWidget( QWidget ):
if not self.listView.firstChild():
return
- f = QFile( filename )
+ f = TQFile( filename )
if not f.open( IO_WriteOnly ):
return
- t = QTextStream( f )
+ t = TQTextStream( f )
- #it = QListViewItemIterator( self.listView )
+ #it = TQListViewItemIterator( self.listView )
while not t.eof():
- item = QListViewItem( self.listView )
+ item = TQListViewItem( self.listView )
for i in range (0, 4):
t << item.text( i ) << '\n'
#for it in it.current():
@@ -113,14 +113,14 @@ class ABCentralWidget( QWidget ):
def load( self, filename ):
self.listView.clear()
- f = QFile( filename )
+ f = TQFile( filename )
if not f.open( IO_ReadOnly ):
return
- t = QTextStream( f )
+ t = TQTextStream( f )
while not t.eof():
- item = QListViewItem( self.listView )
+ item = TQListViewItem( self.listView )
for i in range (0, 4):
item.setText( i, t.readLine() )
@@ -128,53 +128,53 @@ class ABCentralWidget( QWidget ):
def setupTabWidget( self ):
- self.tabWidget = QTabWidget( self )
+ self.tabWidget = TQTabWidget( self )
- self.input = QWidget( self.tabWidget )
- self.grid1 = QGridLayout( self.input, 2, 5, 5, 5 )
+ self.input = TQWidget( self.tabWidget )
+ self.grid1 = TQGridLayout( self.input, 2, 5, 5, 5 )
- self.liFirstName = QLabel( 'First &Name', self.input )
+ self.liFirstName = TQLabel( 'First &Name', self.input )
self.liFirstName.resize( self.liFirstName.sizeHint() )
self.grid1.addWidget( self.liFirstName, 0, 0 )
- self.liLastName = QLabel( '&Last Name', self.input )
+ self.liLastName = TQLabel( '&Last Name', self.input )
self.liLastName.resize( self.liLastName.sizeHint() )
self.grid1.addWidget( self.liLastName, 0, 1 )
- self.liAddress = QLabel( '&Address', self.input )
+ self.liAddress = TQLabel( '&Address', self.input )
self.liAddress.resize( self.liAddress.sizeHint() )
self.grid1.addWidget( self.liAddress, 0, 2 )
- self.liEMail = QLabel( '&E-Mail', self.input )
+ self.liEMail = TQLabel( '&E-Mail', self.input )
self.liEMail.resize( self.liEMail.sizeHint() )
self.grid1.addWidget( self.liEMail, 0, 3 )
- self.add = QPushButton( '&Add', self.input )
+ self.add = TQPushButton( '&Add', self.input )
self.add.resize( self.add.sizeHint() )
self.grid1.addWidget( self.add, 0, 4 )
self.connect( self.add, SIGNAL( 'clicked()' ), self.addEntry )
- self.iFirstName = QLineEdit( self.input )
+ self.iFirstName = TQLineEdit( self.input )
self.iFirstName.resize( self.iFirstName.sizeHint() )
self.grid1.addWidget( self.iFirstName, 1, 0 )
self.liFirstName.setBuddy( self.iFirstName )
- self.iLastName = QLineEdit( self.input )
+ self.iLastName = TQLineEdit( self.input )
self.iLastName.resize( self.iLastName.sizeHint() )
self.grid1.addWidget( self.iLastName, 1, 1 )
self.liLastName.setBuddy( self.iLastName )
- self.iAddress = QLineEdit( self.input )
+ self.iAddress = TQLineEdit( self.input )
self.iAddress.resize( self.iAddress.sizeHint() )
self.grid1.addWidget( self.iAddress, 1, 2 )
self.liAddress.setBuddy( self.iAddress )
- self.iEMail = QLineEdit( self.input )
+ self.iEMail = TQLineEdit( self.input )
self.iEMail.resize( self.iEMail.sizeHint() )
self.grid1.addWidget( self.iEMail, 1, 3 )
self.liEMail.setBuddy( self.iEMail )
- self.change = QPushButton( '&Change', self.input )
+ self.change = TQPushButton( '&Change', self.input )
self.change.resize( self.change.sizeHint() )
self.grid1.addWidget( self.change, 1, 4 )
self.connect( self.change, SIGNAL( 'clicked()' ), self.changeEntry )
@@ -183,46 +183,46 @@ class ABCentralWidget( QWidget ):
# --------------------------------------
- self.search = QWidget( self )
- self.grid2 = QGridLayout( self.search, 2, 5, 5, 5 )
+ self.search = TQWidget( self )
+ self.grid2 = TQGridLayout( self.search, 2, 5, 5, 5 )
- self.cFirstName = QCheckBox( 'First &Name', self.search )
+ self.cFirstName = TQCheckBox( 'First &Name', self.search )
self.cFirstName.resize( self.cFirstName.sizeHint() )
self.grid2.addWidget( self.cFirstName, 0, 0 )
self.connect( self.cFirstName, SIGNAL( 'clicked()' ), self.toggleFirstName )
- self.cLastName = QCheckBox( '&Last Name', self.search )
+ self.cLastName = TQCheckBox( '&Last Name', self.search )
self.cLastName.resize( self.cLastName.sizeHint() )
self.grid2.addWidget( self.cLastName, 0, 1 )
self.connect( self.cLastName, SIGNAL( 'clicked()' ), self.toggleLastName )
- self.cAddress = QCheckBox( '&Address', self.search )
+ self.cAddress = TQCheckBox( '&Address', self.search )
self.cAddress.resize( self.cAddress.sizeHint() )
self.grid2.addWidget( self.cAddress, 0, 2 )
self.connect( self.cAddress, SIGNAL( 'clicked()' ), self.toggleAddress )
- self.cEMail = QCheckBox( '&E-Mail', self.search )
+ self.cEMail = TQCheckBox( '&E-Mail', self.search )
self.cEMail.resize( self.cEMail.sizeHint() )
self.grid2.addWidget( self.cEMail, 0, 3 )
self.connect( self.cEMail, SIGNAL( 'clicked()' ), self.toggleEMail )
- self.sFirstName = QLineEdit( self.search )
+ self.sFirstName = TQLineEdit( self.search )
self.sFirstName.resize( self.sFirstName.sizeHint() )
self.grid2.addWidget( self.sFirstName, 1, 0 )
- self.sLastName = QLineEdit( self.search )
+ self.sLastName = TQLineEdit( self.search )
self.sLastName.resize( self.sLastName.sizeHint() )
self.grid2.addWidget( self.sLastName, 1, 1 )
- self.sAddress = QLineEdit( self.search )
+ self.sAddress = TQLineEdit( self.search )
self.sAddress.resize( self.sAddress.sizeHint() )
self.grid2.addWidget( self.sAddress, 1, 2 )
- self.sEMail = QLineEdit( self.search )
+ self.sEMail = TQLineEdit( self.search )
self.sEMail.resize( self.sEMail.sizeHint() )
self.grid2.addWidget( self.sEMail, 1, 3 )
- self.find = QPushButton( '&Find', self.search )
+ self.find = TQPushButton( '&Find', self.search )
self.find.resize( self.find.sizeHint() )
self.grid2.addWidget( self.find, 1, 4 )
self.connect( self.find, SIGNAL( 'clicked()' ), self.findEntries )
@@ -238,15 +238,15 @@ class ABCentralWidget( QWidget ):
self.mainGrid.addWidget( self.tabWidget, 0, 0 )
def setupListView( self ):
- self.listView = QListView( self )
+ self.listView = TQListView( self )
self.listView.addColumn( 'First Name' )
self.listView.addColumn( 'Last Name' )
self.listView.addColumn( 'Address' )
self.listView.addColumn( 'E-Mail' )
- self.listView.setSelectionMode( QListView.Extended )
+ self.listView.setSelectionMode( TQListView.Extended )
- self.connect( self.listView, SIGNAL( 'clicked( QListViewItem* )' ), self.itemSelected )
+ self.connect( self.listView, SIGNAL( 'clicked( TQListViewItem* )' ), self.itemSelected )
self.mainGrid.addWidget( self.listView, 1, 0 )
self.listView.setAllColumnsShowFocus( TRUE )
@@ -255,7 +255,7 @@ class ABCentralWidget( QWidget ):
def addEntry( self ):
if not self.iFirstName.text().isEmpty() or not self.iLastName.text().isEmpty() or \
not self.iAddress.text().isEmpty() or not self.iEMail.text().isEmpty() :
- self.item = QListViewItem( self.listView )
+ self.item = TQListViewItem( self.listView )
self.item.setText( 0, self.iFirstName.text() )
self.item.setText( 1, self.iLastName.text() )
self.item.setText( 2, self.iAddress.text() )
@@ -332,7 +332,7 @@ class ABCentralWidget( QWidget ):
self.listView.clearSelection()
return
- it = QListViewItemIterator( self.listView )
+ it = TQListViewItemIterator( self.listView )
for it in it.current() :
select = TRUE
@@ -369,38 +369,38 @@ class ABCentralWidget( QWidget ):
it.current().repaint()
-class ABMainWindow(QMainWindow):
+class ABMainWindow(TQMainWindow):
def __init__( self ):
- QMainWindow.__init__( self, None, 'example addressbook application' )
+ TQMainWindow.__init__( self, None, 'example addressbook application' )
- self.filename = QString.null
+ self.filename = TQString.null
self.setupMenuBar()
self.setupFileTools()
self.setupStatusBar()
self.setupCentralWidget()
def setupMenuBar( self ):
- self.file = QPopupMenu( self )
+ self.file = TQPopupMenu( self )
self.menuBar().insertItem( '&File', self.file )
- openIcon = QIconSet( QPixmap( fileopen ) )
- self.file.insertItem( 'New', self.fileNew, Qt.CTRL + Qt.Key_N )
- self.file.insertItem( openIcon, 'Open', self.fileOpen, Qt.CTRL + Qt.Key_O )
+ openIcon = TQIconSet( TQPixmap( fileopen ) )
+ self.file.insertItem( 'New', self.fileNew, TQt.CTRL + TQt.Key_N )
+ self.file.insertItem( openIcon, 'Open', self.fileOpen, TQt.CTRL + TQt.Key_O )
self.file.insertSeparator()
- saveIcon = QIconSet( QPixmap( filesave ) )
- self.file.insertItem( saveIcon, 'Save', self.fileSave, Qt.CTRL + Qt.Key_S )
+ saveIcon = TQIconSet( TQPixmap( filesave ) )
+ self.file.insertItem( saveIcon, 'Save', self.fileSave, TQt.CTRL + TQt.Key_S )
self.file.insertItem( 'Save As...', self.fileSaveAs )
self.file.insertSeparator()
- printIcon = QIconSet( QPixmap( fileprint ) )
- self.file.insertItem( printIcon, 'Print...', self.filePrint, Qt.CTRL + Qt.Key_P )
+ printIcon = TQIconSet( TQPixmap( fileprint ) )
+ self.file.insertItem( printIcon, 'Print...', self.filePrint, TQt.CTRL + TQt.Key_P )
self.file.insertSeparator()
- #self.file.insertItem( 'Close', self.closeWindow, Qt.CTRL + Qt.Key_W )
- self.file.insertItem('Close', self, SLOT('close()'), Qt.CTRL+Qt.Key_W)
- self.file.insertItem( 'Quit', qApp, SLOT( 'quit()' ), Qt.CTRL + Qt.Key_Q )
+ #self.file.insertItem( 'Close', self.closeWindow, TQt.CTRL + TQt.Key_W )
+ self.file.insertItem('Close', self, SLOT('close()'), TQt.CTRL+TQt.Key_W)
+ self.file.insertItem( 'Quit', qApp, SLOT( 'quit()' ), TQt.CTRL + TQt.Key_Q )
def setupFileTools( self ):
pass
- #self.fileTools = QToolBar( self, 'file operations' )
+ #self.fileTools = TQToolBar( self, 'file operations' )
def setupStatusBar( self ):
self.statusBar().message( "Ready", 2000 )
@@ -418,7 +418,7 @@ class ABMainWindow(QMainWindow):
pass
def fileOpen( self ):
- fn = QFileDialog.getOpenFileName( QString.null, QString.null, self )
+ fn = TQFileDialog.getOpenFileName( TQString.null, TQString.null, self )
if not fn.isEmpty():
self.filename = fn
self.view.load( self.filename )
@@ -431,7 +431,7 @@ class ABMainWindow(QMainWindow):
self.view.save( self.filename )
def fileSaveAs( self ):
- fn = QFileDialog.getSaveFileName( QString.null, QString.null, self )
+ fn = TQFileDialog.getSaveFileName( TQString.null, TQString.null, self )
if not fn.isEmpty():
self.filename = fn
self.fileSave
@@ -440,7 +440,7 @@ class ABMainWindow(QMainWindow):
pass
-a = QApplication( sys.argv )
+a = TQApplication( sys.argv )
mw = ABMainWindow()
#mw.setupMenuBar()
diff --git a/examples2/application.py b/examples2/application.py
index 294c6cb..8b8f43b 100755
--- a/examples2/application.py
+++ b/examples2/application.py
@@ -94,40 +94,40 @@ You can also select the <b>Print</b> command from the <b>File</b> menu.'''
editorList = []
-class ApplicationWindow(QMainWindow):
+class ApplicationWindow(TQMainWindow):
def __init__(self):
- QMainWindow.__init__(self,None,'example application main window',Qt.WDestructiveClose)
+ TQMainWindow.__init__(self,None,'example application main window',TQt.WDestructiveClose)
- self.filename = QString.null
- self.printer = QPrinter()
+ self.filename = TQString.null
+ self.printer = TQPrinter()
- self.fileTools = QToolBar(self,'file operations')
+ self.fileTools = TQToolBar(self,'file operations')
- openIcon = QPixmap(fileopen)
- self.fileOpen = QToolButton(openIcon,'Open File',QString.null,self.load,self.fileTools,'open file')
+ openIcon = TQPixmap(fileopen)
+ self.fileOpen = TQToolButton(openIcon,'Open File',TQString.null,self.load,self.fileTools,'open file')
- saveIcon = QPixmap(filesave)
- self.fileSave = QToolButton(saveIcon,'Save File',QString.null,self.save,self.fileTools,'save file')
+ saveIcon = TQPixmap(filesave)
+ self.fileSave = TQToolButton(saveIcon,'Save File',TQString.null,self.save,self.fileTools,'save file')
- printIcon = QPixmap(fileprint)
- self.filePrint = QToolButton(printIcon,'Print File',QString.null,self.printDoc,self.fileTools,'print file')
+ printIcon = TQPixmap(fileprint)
+ self.filePrint = TQToolButton(printIcon,'Print File',TQString.null,self.printDoc,self.fileTools,'print file')
- QWhatsThis.whatsThisButton(self.fileTools)
+ TQWhatsThis.whatsThisButton(self.fileTools)
- QWhatsThis.add(self.fileOpen,fileOpenText)
- QMimeSourceFactory.defaultFactory().setPixmap('fileopen',openIcon)
- QWhatsThis.add(self.fileSave,fileSaveText)
- QWhatsThis.add(self.filePrint,filePrintText)
+ TQWhatsThis.add(self.fileOpen,fileOpenText)
+ TQMimeSourceFactory.defaultFactory().setPixmap('fileopen',openIcon)
+ TQWhatsThis.add(self.fileSave,fileSaveText)
+ TQWhatsThis.add(self.filePrint,filePrintText)
- self.file = QPopupMenu(self)
+ self.file = TQPopupMenu(self)
self.menuBar().insertItem('&File',self.file)
- self.file.insertItem('&New',self.newDoc,Qt.CTRL + Qt.Key_N)
+ self.file.insertItem('&New',self.newDoc,TQt.CTRL + TQt.Key_N)
- id = self.file.insertItem(QIconSet(openIcon),'&Open',self.load,Qt.CTRL + Qt.Key_O)
+ id = self.file.insertItem(TQIconSet(openIcon),'&Open',self.load,TQt.CTRL + TQt.Key_O)
self.file.setWhatsThis(id,fileOpenText)
- id = self.file.insertItem(QIconSet(saveIcon),'&Save',self.save,Qt.CTRL + Qt.Key_S)
+ id = self.file.insertItem(TQIconSet(saveIcon),'&Save',self.save,TQt.CTRL + TQt.Key_S)
self.file.setWhatsThis(id,fileSaveText)
id = self.file.insertItem('Save &as',self.saveAs)
@@ -135,22 +135,22 @@ class ApplicationWindow(QMainWindow):
self.file.insertSeparator()
- id = self.file.insertItem(QIconSet(printIcon),'&Print',self.printDoc,Qt.CTRL + Qt.Key_P)
+ id = self.file.insertItem(TQIconSet(printIcon),'&Print',self.printDoc,TQt.CTRL + TQt.Key_P)
self.file.setWhatsThis(id,filePrintText)
self.file.insertSeparator()
- self.file.insertItem('&Close',self,SLOT('close()'),Qt.CTRL + Qt.Key_W)
- self.file.insertItem('&Quit',qApp,SLOT('closeAllWindows()'),Qt.CTRL + Qt.Key_Q)
+ self.file.insertItem('&Close',self,SLOT('close()'),TQt.CTRL + TQt.Key_W)
+ self.file.insertItem('&Quit',qApp,SLOT('closeAllWindows()'),TQt.CTRL + TQt.Key_Q)
- self.help = QPopupMenu(self)
+ self.help = TQPopupMenu(self)
self.menuBar().insertSeparator()
self.menuBar().insertItem('&Help',self.help)
- self.help.insertItem('&About',self.about,Qt.Key_F1)
- self.help.insertItem('About &Qt',self.aboutQt)
+ self.help.insertItem('&About',self.about,TQt.Key_F1)
+ self.help.insertItem('About &TQt',self.aboutTQt)
- self.e = QMultiLineEdit(self,'editor')
+ self.e = TQMultiLineEdit(self,'editor')
self.e.setFocus()
self.setCentralWidget(self.e)
@@ -163,7 +163,7 @@ class ApplicationWindow(QMainWindow):
editorList.append(ed)
def load(self):
- fn = QFileDialog.getOpenFileName(QString.null,QString.null,self)
+ fn = TQFileDialog.getOpenFileName(TQString.null,TQString.null,self)
if fn.isEmpty():
self.statusBar().message('Loading aborted',2000)
return
@@ -208,7 +208,7 @@ class ApplicationWindow(QMainWindow):
self.statusBar().message('File %s saved' % (self.filename),2000)
def saveAs(self):
- fn = QFileDialog.getSaveFileName(QString.null,QString.null,self)
+ fn = TQFileDialog.getSaveFileName(TQString.null,TQString.null,self)
if not fn.isEmpty():
self.filename = fn
self.save()
@@ -222,12 +222,12 @@ class ApplicationWindow(QMainWindow):
if self.printer.setup(self):
self.statusBar().message('Printing...')
- p = QPainter()
+ p = TQPainter()
p.begin(self.printer)
p.setFont(self.e.font())
yPos = 0
fm = p.fontMetrics()
- metrics = QPaintDeviceMetrics(self.printer)
+ metrics = TQPaintDeviceMetrics(self.printer)
for i in range(self.e.numLines):
if Margin + yPos > metrics.height() - Margin:
@@ -236,7 +236,7 @@ class ApplicationWindow(QMainWindow):
self.printer.newPage()
yPos = 0
- p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip,self.e.textLine(i))
+ p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),TQt.ExpandTabs | TQt.DontClip,self.e.textLine(i))
yPos = yPos + fm.lineSpacing()
p.end()
@@ -249,7 +249,7 @@ class ApplicationWindow(QMainWindow):
ce.accept()
return
- rc = QMessageBox.information(self,'Qt Application Example',
+ rc = TQMessageBox.information(self,'TQt Application Example',
'The document has been changed since the last save.',
'Save Now','Cancel','Leave Anyway',0,1)
@@ -262,14 +262,14 @@ class ApplicationWindow(QMainWindow):
ce.ignore()
def about(self):
- QMessageBox.about(self,'Qt Application Example',
- 'This example demonstrates simple use of QMainWindow,\nQMenuBar and QToolBar.')
+ TQMessageBox.about(self,'TQt Application Example',
+ 'This example demonstrates simple use of TQMainWindow,\nTQMenuBar and TQToolBar.')
- def aboutQt(self):
- QMessageBox.aboutQt(self,'Qt Application Example')
+ def aboutTQt(self):
+ TQMessageBox.aboutTQt(self,'TQt Application Example')
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
mw = ApplicationWindow()
mw.setCaption('Document 1')
mw.show()
diff --git a/examples2/buttongroups.py b/examples2/buttongroups.py
index 47256ab..147952a 100755
--- a/examples2/buttongroups.py
+++ b/examples2/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 )
- self.box1 = QHBoxLayout( self.vbox )
- self.box2 = QHBoxLayout( self.vbox )
+ self.vbox = TQVBoxLayout( self )
+ 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,12 +78,12 @@ 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.tb = QPushButton( "&Toggle Button", self.grp4 )
+ TQPushButton( "&Push Button", self.grp4 )
+ self.tb = TQPushButton( "&Toggle Button", self.grp4 )
# ... and make the second one a toggle button
self.tb.setToggleButton( TRUE )
@@ -102,7 +102,7 @@ class ButtonsGroups( QWidget ):
## main program
-a = QApplication( sys.argv )
+a = TQApplication( sys.argv )
buttonsgroups = ButtonsGroups()
buttonsgroups.resize( 500, 250 )
diff --git a/examples2/dclock.py b/examples2/dclock.py
index 5382d4f..d129681 100755
--- a/examples2/dclock.py
+++ b/examples2/dclock.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
-# A port to PyQt of the dclock example from Qt v2.x.
+# A port to PyTQt of the dclock example from TQt v2.x.
import sys, string
from qt import *
-class DigitalClock(QLCDNumber):
+class DigitalClock(TQLCDNumber):
def __init__(self, parent=None, name=None):
- QLCDNumber.__init__(self, parent, name)
+ TQLCDNumber.__init__(self, parent, name)
self.showingColon = 0
- self.setFrameStyle(QFrame.Panel | QFrame.Raised)
+ self.setFrameStyle(TQFrame.Panel | TQFrame.Raised)
self.setLineWidth(2)
self.showTime()
self.normalTimer = self.startTimer(500)
@@ -25,13 +25,13 @@ class DigitalClock(QLCDNumber):
self.showTime()
def mousePressEvent(self, e):
- if e.button() == Qt.LeftButton:
+ if e.button() == TQt.LeftButton:
self.showDate()
def showDate(self):
if self.showDateTimer != -1:
return
- d = QDate.currentDate()
+ d = TQDate.currentDate()
self.display('%2d %2d' % (d.month(), d.day()))
self.showDateTimer = self.startTimer(2000)
@@ -42,7 +42,7 @@ class DigitalClock(QLCDNumber):
def showTime(self):
self.showingColon = not self.showingColon
- s = list(str(QTime.currentTime().toString())[:5]) #.left(5)
+ s = list(str(TQTime.currentTime().toString())[:5]) #.left(5)
if not self.showingColon:
s[2] = ' '
if s[0] == '0':
@@ -50,7 +50,7 @@ class DigitalClock(QLCDNumber):
s = string.join(s,'')
self.display(s)
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
clock = DigitalClock()
clock.resize(170,80)
a.setMainWidget(clock)
diff --git a/examples2/desktop.py b/examples2/desktop.py
index a1177f2..cc0c97f 100755
--- a/examples2/desktop.py
+++ b/examples2/desktop.py
@@ -25,13 +25,13 @@ maxpoints = 5
maxcurves = 8
def poly():
- d = QApplication.desktop()
+ d = TQApplication.desktop()
d.setBackgroundColor(white)
xvel = [ 0 ] * 8
yvel = [ 0 ] * 8
head = 0
tail = -maxcurves + 2
- a = QPointArray() * maxcurves
+ a = TQPointArray() * maxcurves
r = d.rect()
for i in range(maxcurves):
a[i].resize(maxpoints)
@@ -42,11 +42,11 @@ def poly():
xvel[i] = velocity(i)
yvel[i] = velocity(i)
- paint = QPainter()
+ paint = TQPainter()
paint.begin(d)
for ntimes in range(2000):
- paint.setBrush(QColor(kindaRand()%360,180,255, QColor.Hsv))
+ paint.setBrush(TQColor(kindaRand()%360,180,255, TQColor.Hsv))
paint.drawPolygon(a[head])
tail = tail + 1
if tail >= maxcurves:
@@ -81,31 +81,31 @@ def poly():
def rotate():
w = 64
h = 64
- image = QImage(w, h, 8, 128)
+ image = TQImage(w, h, 8, 128)
for i in range(128):
image.setColor(i, qRgb(i,0,0))
for y in range(h):
for x in range(w):
image.setPixel(x,y,(x+y)%128)
- pm = QPixmap()
+ pm = TQPixmap()
pm.convertFromImage(image)
#pm.optimize(1)
- d = QApplication.desktop()
+ d = TQApplication.desktop()
for i in range(0,361,2):
- m = QWMatrix()
+ m = TQWMatrix()
m.rotate(i)
rpm = pm.xForm(m)
d.setBackgroundPixmap(rpm)
d.update()
def generateStone(pm, c1, c2, c3):
- p = QPainter()
- p1 = QPen(c1, 0)
- p2 = QPen(c2, 0)
- p3 = QPen(c3, 0)
+ p = TQPainter()
+ p1 = TQPen(c1, 0)
+ p2 = TQPen(c2, 0)
+ p3 = TQPen(c3, 0)
p.begin(pm)
for i in range(pm.width()):
@@ -129,9 +129,9 @@ def drawShadeText(p, x, y, text, topColor, bottomColor, sw=2):
p.setPen(topColor)
p.drawText(x, y, text)
-class DesktopWidget(QWidget):
+class DesktopWidget(TQWidget):
def __init__(self, s, parent=None, name=''):
- QWidget.__init__(self, parent, name, WType_Desktop | WPaintDesktop)
+ TQWidget.__init__(self, parent, name, WType_Desktop | WPaintDesktop)
self.text = s
self.pm = None
@@ -140,16 +140,16 @@ class DesktopWidget(QWidget):
c2 = c1.light(104)
c3 = c1.dark(106)
if not self.pm:
- self.pm = QPixmap(64, 64)
+ self.pm = TQPixmap(64, 64)
generateStone(self.pm, c1, c2, c3)
self.setBackgroundPixmap(self.pm)
self.update()
br = self.fontMetrics().boundingRect(self.text)
- offscreen = QPixmap(br.width(), br.height())
+ offscreen = TQPixmap(br.width(), br.height())
x = self.width()/2 - br.width()/2
y = self.height()/2 - br.height()/2
offscreen.fill(self, x, y)
- p = QPainter()
+ p = TQPainter()
p.begin(offscreen)
drawShadeText(p, -br.x(), -br.y(), self.text, c2, c3, 3)
p.end()
@@ -167,8 +167,8 @@ def desktopText(s='Troll Tech'):
c2 = c1.light(104)
c3 = c1.dark(106)
- pm = QPixmap(10, 10)
- p = QPainter()
+ pm = TQPixmap(10, 10)
+ p = TQPainter()
p.begin(pm)
r = p.fontMetrics().boundingRect(s)
p.end()
@@ -188,10 +188,10 @@ def desktopText(s='Troll Tech'):
qApp.desktop().setBackgroundPixmap(pm)
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
if len(sys.argv) > 1:
- f = QFont('charter', 96, QFont.Weight.Black)
- f.setStyleHint(QFont.StyleHint.Times)
+ f = TQFont('charter', 96, TQFont.Weight.Black)
+ f.setStyleHint(TQFont.StyleHint.Times)
a.setFont(f)
validOptions = 0
if len(sys.argv) == 2:
diff --git a/examples2/dirview.py b/examples2/dirview.py
index ae232e9..66beda1 100755
--- a/examples2/dirview.py
+++ b/examples2/dirview.py
@@ -3,10 +3,10 @@
import sys
from qt import *
-class Directory(QListViewItem):
+class Directory(TQListViewItem):
def __init__(self, parent, name=None):
- apply(QListViewItem.__init__,(self,parent))
- if isinstance(parent, QListView):
+ apply(TQListViewItem.__init__,(self,parent))
+ if isinstance(parent, TQListView):
self.p = None
self.f = '/'
else:
@@ -18,7 +18,7 @@ class Directory(QListViewItem):
def setOpen(self, o):
if o and not self.childCount():
s = self.fullName()
- thisDir = QDir(s)
+ thisDir = TQDir(s)
if not thisDir.isReadable():
self.readable = 0
return
@@ -30,7 +30,7 @@ class Directory(QListViewItem):
if fileName == '.' or fileName == '..':
continue
elif f.isSymLink():
- d = QListViewItem(self, fileName, 'Symbolic Link')
+ d = TQListViewItem(self, fileName, 'Symbolic Link')
elif f.isDir():
d = Directory(self, fileName)
else:
@@ -38,14 +38,14 @@ class Directory(QListViewItem):
s = 'File'
else:
s = 'Special'
- d = QListViewItem(self, fileName, s)
+ d = TQListViewItem(self, fileName, s)
self.c.append(d)
- QListViewItem.setOpen(self, o)
+ TQListViewItem.setOpen(self, o)
def setup(self):
self.setExpandable(1)
- QListViewItem.setup(self)
+ TQListViewItem.setup(self)
def fullName(self):
if self.p:
@@ -62,8 +62,8 @@ class Directory(QListViewItem):
else:
return 'Unreadable Directory'
-a = QApplication(sys.argv)
-mw = QListView()
+a = TQApplication(sys.argv)
+mw = TQListView()
a.setMainWidget(mw)
mw.setCaption('Directory Browser')
mw.addColumn('Name')
diff --git a/examples2/dragdrop.py b/examples2/dragdrop.py
index 4cc8c73..5ea9171 100755
--- a/examples2/dragdrop.py
+++ b/examples2/dragdrop.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# Ported to PyQt by Issac Trotts on Jan 1, 2002
+# Ported to PyTQt by Issac Trotts on Jan 1, 2002
import sys
from qt import *
@@ -9,49 +9,49 @@ import dropsite, secret
def addStuff( parent, yn_image, yn_secret = 0 ):
- tll = QVBoxLayout( parent, 10 )
+ tll = TQVBoxLayout( parent, 10 )
d = dropsite.DropSite( parent, 'dropsite' )
- d.setFrameStyle( QFrame.Sunken + QFrame.WinPanel )
+ d.setFrameStyle( TQFrame.Sunken + TQFrame.WinPanel )
tll.addWidget( d )
if yn_image:
- stuff = QPixmap()
+ stuff = TQPixmap()
if not stuff.load( "trolltech.bmp" ):
- stuff = QPixmap(20,20)
- stuff.fill(Qt.green)
+ stuff = TQPixmap(20,20)
+ stuff.fill(TQt.green)
d.setPixmap( stuff )
else:
d.setText("Drag and Drop")
- d.setFont(QFont("Helvetica",18))
+ d.setFont(TQFont("Helvetica",18))
if secret:
s = secret.SecretSource( 42, parent )
tll.addWidget( s )
- format = QLabel( "\n\n\n\nNone\n\n\n\n", parent )
+ format = TQLabel( "\n\n\n\nNone\n\n\n\n", parent )
tll.addWidget( format )
tll.activate()
parent.resize( parent.sizeHint() )
- QObject.connect( d, PYSIGNAL('message(QString &)'),
- format, SLOT('setText(QString &)') )
+ TQObject.connect( d, PYSIGNAL('message(TQString &)'),
+ format, SLOT('setText(TQString &)') )
-app = QApplication( sys.argv )
+app = TQApplication( sys.argv )
-mw = QWidget()
+mw = TQWidget()
addStuff( mw, 1 )
-mw.setCaption( "Qt Example - Drag and Drop" )
+mw.setCaption( "TQt Example - Drag and Drop" )
mw.show()
-mw2 = QWidget()
+mw2 = TQWidget()
addStuff( mw2, 0 )
-mw2.setCaption( "Qt Example - Drag and Drop" )
+mw2.setCaption( "TQt Example - Drag and Drop" )
mw2.show()
-mw3 = QWidget()
+mw3 = TQWidget()
addStuff( mw3, 1, 1 )
-mw3.setCaption( "Qt Example - Drag and Drop" )
+mw3.setCaption( "TQt Example - Drag and Drop" )
mw3.show()
-QObject.connect(qApp,SIGNAL('lastWindowClosed()'),qApp,SLOT('quit()'))
+TQObject.connect(qApp,SIGNAL('lastWindowClosed()'),qApp,SLOT('quit()'))
app.exec_loop()
diff --git a/examples2/dropsite.py b/examples2/dropsite.py
index 7897109..8dcbabc 100644
--- a/examples2/dropsite.py
+++ b/examples2/dropsite.py
@@ -6,21 +6,21 @@ from qt import *
import secret
-class DropSite(QLabel):
+class DropSite(TQLabel):
def __init__(self, parent=None, name=None):
- QLabel.__init__( self, parent, name )
+ TQLabel.__init__( self, parent, name )
self.setAcceptDrops(1)
# this is a normal event
def mousePressEvent( self, e ):
if ( self.pixmap() ) :
- drobj = QImageDrag( self.pixmap().convertToImage(), self )
- pm = QPixmap()
+ drobj = TQImageDrag( self.pixmap().convertToImage(), self )
+ pm = TQPixmap()
pm.convertFromImage(self.pixmap().convertToImage().smoothScale(
self.pixmap().width()/3,self.pixmap().height()/3))
- drobj.setPixmap(pm,QPoint(-5,-7))
+ drobj.setPixmap(pm,TQPoint(-5,-7))
else :
- drobj = QTextDrag( self.text(), self )
+ drobj = TQTextDrag( self.text(), self )
drobj.dragCopy()
def backgroundColorChange( self, qcolor ):
@@ -35,9 +35,9 @@ class DropSite(QLabel):
def dragEnterEvent( self, e ):
# Check if you want the drag...
if (secret.canDecode( e ) or
- QTextDrag.canDecode( e ) or
- QImageDrag.canDecode( e ) or
- QUriDrag.canDecode( e )):
+ TQTextDrag.canDecode( e ) or
+ TQImageDrag.canDecode( e ) or
+ TQUriDrag.canDecode( e )):
e.accept()
# Give the user some feedback...
@@ -48,41 +48,41 @@ class DropSite(QLabel):
t += "\n"
t += str(e.format( i ))
i += 1
- self.emit(PYSIGNAL('message(QString &)'), (QString(t),))
- self.setBackgroundColor(Qt.white)
+ self.emit(PYSIGNAL('message(TQString &)'), (TQString(t),))
+ self.setBackgroundColor(TQt.white)
- def dragLeaveEvent( self, QDragLeaveEvent ):
+ def dragLeaveEvent( self, TQDragLeaveEvent ):
# Give the user some feedback...
- self.emit(PYSIGNAL('message(QString &)'), (QString(''),))
- self.setBackgroundColor(Qt.lightGray)
+ self.emit(PYSIGNAL('message(TQString &)'), (TQString(''),))
+ self.setBackgroundColor(TQt.lightGray)
def dropEvent( self, e ):
- self.setBackgroundColor(Qt.lightGray)
+ self.setBackgroundColor(TQt.lightGray)
# Try to decode to the data you understand...
- str = QString()
- if ( QTextDrag.decode( e, str ) ) :
+ str = TQString()
+ if ( TQTextDrag.decode( e, str ) ) :
self.setText( str )
self.setMinimumSize( self.minimumSize().expandedTo(self.sizeHint()) )
return
- pm = QPixmap()
- if ( QImageDrag.decode( e, pm ) ) :
+ pm = TQPixmap()
+ if ( TQImageDrag.decode( e, pm ) ) :
self.setPixmap( pm )
self.setMinimumSize(self.minimumSize().expandedTo(self.sizeHint()))
return
- # QStrList strings
- #strings = QStrList()
+ # TQStrList strings
+ #strings = TQStrList()
strings = []
- if ( QUriDrag.decode( e, strings ) ) :
- m = QString("Full URLs:\n")
+ if ( TQUriDrag.decode( e, strings ) ) :
+ m = TQString("Full URLs:\n")
for u in strings:
m = m + " " + u + '\n'
- # QStringList files
+ # TQStringList files
files = []
- if ( QUriDrag.decodeLocalFiles( e, files ) ) :
+ if ( TQUriDrag.decodeLocalFiles( e, files ) ) :
m += "Files:\n"
- # for (QStringList.Iterator i=files.begin() i!=files.end() ++i)
+ # for (TQStringList.Iterator i=files.begin() i!=files.end() ++i)
for i in files:
m = m + " " + i + '\n'
self.setText( m )
diff --git a/examples2/gears.py b/examples2/gears.py
index bf5b913..3e10a67 100755
--- a/examples2/gears.py
+++ b/examples2/gears.py
@@ -129,9 +129,9 @@ def gear(inner_radius,outer_radius,width,teeth,tooth_depth):
glEnd()
##############################################################################
-class GearWidget(QGLWidget):
+class GearWidget(TQGLWidget):
def __init__(self,parent=None,name=None):
- QGLWidget.__init__(self,parent,name)
+ TQGLWidget.__init__(self,parent,name)
self.angle=0.0
self.view_rotx=0.0
@@ -223,11 +223,11 @@ class GearWidget(QGLWidget):
##############################################################################
if __name__=='__main__':
- QApplication.setColorSpec(QApplication.CustomColor)
- app=QApplication(sys.argv)
+ TQApplication.setColorSpec(TQApplication.CustomColor)
+ app=TQApplication(sys.argv)
- if not QGLFormat.hasOpenGL():
- raise 'No Qt OpenGL support.'
+ if not TQGLFormat.hasOpenGL():
+ raise 'No TQt OpenGL support.'
widget=GearWidget()
app.setMainWidget(widget)
diff --git a/examples2/menu.py b/examples2/menu.py
index 89938c3..a8efe7b 100755
--- a/examples2/menu.py
+++ b/examples2/menu.py
@@ -5,7 +5,7 @@
#**
#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved.
#**
-#** This file is part of an example program for PyQt. This example
+#** This file is part of an example program for PyTQt. This example
#** program may be used, distributed and modified without limitation.
#**
#*****************************************************************************/
@@ -114,35 +114,35 @@ p4_xpm = [
# Auxiliary class to provide fancy menu items with different fonts.
# Used for the "bold" and "underline" menu items in the options menu.
-#class MyMenuItem( QCustomMenuItem ):
+#class MyMenuItem( TQCustomMenuItem ):
# def __init__( self, s=None, f=None ):
-# apply( QCustomMenuItem.__init__,( self, s, f ) )
-# string = QString( s )
-# font = QFont( f )
+# apply( TQCustomMenuItem.__init__,( self, s, f ) )
+# string = TQString( s )
+# font = TQFont( f )
# def paint( self, p, TRUE, FALSE, x, y, w, h ) :
# p.setFont ( font )
-# p.drawText( x, y, w, h, Qt.AlignLeft | Qt.AlignVCenter | Qt.ShowPrefix | Qt.DontClip, string )
+# p.drawText( x, y, w, h, TQt.AlignLeft | TQt.AlignVCenter | TQt.ShowPrefix | TQt.DontClip, string )
# def sizeHint( self ):
-# return QFontMetrics( font ).size( Qt.AlignLeft | Qt.AlignVCenter | Qt.ShowPrefix | Qt.DontClip, string )
+# return TQFontMetrics( font ).size( TQt.AlignLeft | TQt.AlignVCenter | TQt.ShowPrefix | TQt.DontClip, string )
#
### Implementation of MenuExample class
#
-class MenuExample( QWidget ):
+class MenuExample( TQWidget ):
def __init__( self, parent=None, name=None ):
- apply( QWidget.__init__,(self, parent, name) )
- self.p1 = QIconSet( QPixmap ( p1_xpm ) )
- self.p2 = QIconSet( QPixmap ( p2_xpm ) )
- self.p3 = QIconSet( QPixmap ( p3_xpm ) )
- self.p4 = QIconSet( QPixmap ( p4_xpm ) )
- #openIcon = QPixmap()
- #saveIcon = QPixmap()
- #printIcon = QPixmap()
-
- self.printer = QPopupMenu( self )
+ apply( TQWidget.__init__,(self, parent, name) )
+ self.p1 = TQIconSet( TQPixmap ( p1_xpm ) )
+ self.p2 = TQIconSet( TQPixmap ( p2_xpm ) )
+ self.p3 = TQIconSet( TQPixmap ( p3_xpm ) )
+ self.p4 = TQIconSet( TQPixmap ( p4_xpm ) )
+ #openIcon = TQPixmap()
+ #saveIcon = TQPixmap()
+ #printIcon = TQPixmap()
+
+ self.printer = TQPopupMenu( self )
#CHECK_PTR( self.printer )
self.printer.insertTearOffHandle()
self.printer.insertItem( "&Print to printer", self.printDoc )
@@ -151,25 +151,25 @@ class MenuExample( QWidget ):
self.printer.insertSeparator()
self.printer.insertItem( "Printer &Setup", self.printerSetup )
- self.file = QPopupMenu( self )
+ self.file = TQPopupMenu( self )
#CHECK_PTR( self.file );
- self.file.insertItem( self.p1, "&Open", self.open, Qt.CTRL+Qt.Key_O )
- self.file.insertItem( self.p2, "&New", self.news, Qt.CTRL+Qt.Key_N )
- self.file.insertItem( self.p3, "&Save", self.save, Qt.CTRL+Qt.Key_S )
- self.file.insertItem( "&Close", self.closeDoc, Qt.CTRL+Qt.Key_W )
+ self.file.insertItem( self.p1, "&Open", self.open, TQt.CTRL+TQt.Key_O )
+ self.file.insertItem( self.p2, "&New", self.news, TQt.CTRL+TQt.Key_N )
+ self.file.insertItem( self.p3, "&Save", self.save, TQt.CTRL+TQt.Key_S )
+ self.file.insertItem( "&Close", self.closeDoc, TQt.CTRL+TQt.Key_W )
self.file.insertSeparator()
- self.file.insertItem( self.p4, "&Print", self.printer, Qt.CTRL+Qt.Key_P )
+ self.file.insertItem( self.p4, "&Print", self.printer, TQt.CTRL+TQt.Key_P )
self.file.insertSeparator()
- self.file.insertItem( "E&xit", qApp, SLOT( "quit()" ), Qt.CTRL+Qt.Key_Q )
+ self.file.insertItem( "E&xit", qApp, SLOT( "quit()" ), TQt.CTRL+TQt.Key_Q )
- self.edit = QPopupMenu( self )
+ self.edit = TQPopupMenu( self )
#CHECK_PTR( self.edit )
undoID = self.edit.insertItem( "&Undo", self.undo )
redoID = self.edit.insertItem( "&Redo", self.redo )
self.edit.setItemEnabled( undoID, TRUE )
self.edit.setItemEnabled( redoID, FALSE )
- self.options = QPopupMenu( self )
+ self.options = TQPopupMenu( self )
#CHECK_PTR( self.options )
self.options.insertTearOffHandle()
self.options.setCaption( 'Options' )
@@ -177,23 +177,23 @@ class MenuExample( QWidget ):
self.options.insertSeparator()
self.options.polish() # adjust system settings
- self.f = QFont( self.options.font() )
+ self.f = TQFont( self.options.font() )
self.f.setBold( TRUE )
self.boldID = self.options.insertItem( "&Bold" )
- self.options.setAccel( Qt.CTRL+Qt.Key_B, self.boldID )
+ self.options.setAccel( TQt.CTRL+TQt.Key_B, self.boldID )
self.options.connectItem( self.boldID, self.bold )
- self.f = QFont( self.options.font() )
+ self.f = TQFont( self.options.font() )
self.f.setUnderline( TRUE )
self.underlineID = self.options.insertItem( "&Underline" )
- self.options.setAccel( Qt.CTRL+Qt.Key_U, self.underlineID )
+ self.options.setAccel( TQt.CTRL+TQt.Key_U, self.underlineID )
self.options.connectItem( self.underlineID, self.underline )
self.isBold = FALSE
self.isUnderline = FALSE
self.options.setCheckable( TRUE )
- self.options = QPopupMenu()
+ self.options = TQPopupMenu()
#CHECK_PTR( self.options )
self.options.insertItem( "&Normal Font", self.normal )
self.options.insertSeparator()
@@ -204,28 +204,28 @@ class MenuExample( QWidget ):
self.isUnderline = FALSE
self.options.setCheckable( TRUE )
- self.help = QPopupMenu( self )
+ self.help = TQPopupMenu( self )
#CHECK_PTR( self.help )
- self.help.insertItem( "&About", self.about, Qt.CTRL+Qt.Key_H )
- self.help.insertItem( "About &Qt", self.aboutQt )
+ self.help.insertItem( "&About", self.about, TQt.CTRL+TQt.Key_H )
+ self.help.insertItem( "About &TQt", self.aboutTQt )
- self.menu = QMenuBar( self )
+ self.menu = TQMenuBar( self )
#CHECK_PTR( self.menu );
self.menu.insertItem( "&File", self.file )
self.menu.insertItem( "&Edit", self.edit )
self.menu.insertItem( "&Options", self.options )
self.menu.insertSeparator()
self.menu.insertItem( "&Help", self.help )
- self.menu.setSeparator( QMenuBar.InWindowsStyle )
+ self.menu.setSeparator( TQMenuBar.InWindowsStyle )
- self.label = QLabel( self )
+ self.label = TQLabel( self )
#CHECK_PTR( self.label )
self.label.setGeometry( 20, self.rect().center().y()-20, self.width()-40, 40 )
- self.label.setFrameStyle( QFrame.Box | QFrame.Raised )
+ self.label.setFrameStyle( TQFrame.Box | TQFrame.Raised )
self.label.setLineWidth( 1 )
- self.label.setAlignment( Qt.AlignCenter )
+ self.label.setAlignment( TQt.AlignCenter )
- self.label.setFont( QFont( "times", 12, QFont.Bold ) )
+ self.label.setFont( TQFont( "times", 12, TQFont.Bold ) )
self.connect( self, PYSIGNAL( "explain" ), self.label.setText )
#self.connect( self, PYSIGNAL( "explain(const char *)" ),
# self.label, SLOT( "setText(const char *)" ) )
@@ -268,13 +268,13 @@ class MenuExample( QWidget ):
self.emit(PYSIGNAL("explain"), ("Options/Underline selected",))
def about( self ):
- QMessageBox.about( self, "Qt Menu Example",
- "This example demonstrates simple use of Qt menus.\n"
+ TQMessageBox.about( self, "TQt Menu Example",
+ "This example demonstrates simple use of TQt menus.\n"
"You can cut and paste lines from it to your own\n"
"programs." )
- def aboutQt( self ):
- QMessageBox.aboutQt( self, "Qt Menu Example" )
+ def aboutTQt( self ):
+ TQMessageBox.aboutTQt( self, "TQt Menu Example" )
def printDoc( self ):
self.emit ( PYSIGNAL( "explain" ), ( "File/Printer/Print selected", ) )
@@ -291,7 +291,7 @@ class MenuExample( QWidget ):
def resizeEvent( self, ev ):
self.label.setGeometry( 20, self.rect().center().y()-20, self.width()-40, 40 )
-a = QApplication( sys.argv )
+a = TQApplication( sys.argv )
m = MenuExample()
a.setMainWidget( m )
diff --git a/examples2/secret.py b/examples2/secret.py
index 7023a0b..b405737 100644
--- a/examples2/secret.py
+++ b/examples2/secret.py
@@ -12,15 +12,15 @@ def decode(e):
payload = str(e.data( "secret/magic" ))
if ( str(payload) != '' ):
e.accept()
- return QString("The secret number is "+str(ord(payload)) )
+ return TQString("The secret number is "+str(ord(payload)) )
return None
-class SecretDrag(QStoredDrag):
+class SecretDrag(TQStoredDrag):
def __init__(self, secret, parent=None, name=None):
- QStoredDrag.__init__(self, 'secret/magic', parent, name)
- data = QByteArray(chr(secret))
+ TQStoredDrag.__init__(self, 'secret/magic', parent, name)
+ data = TQByteArray(chr(secret))
self.setEncodedData( data )
@@ -49,17 +49,17 @@ picture_xpm = [
]
-class SecretSource(QLabel):
+class SecretSource(TQLabel):
def __init__(self, secret, parent=None, name=None):
- QLabel.__init__(self, "Secret", parent, name)
- self.setBackgroundColor( Qt.blue.light() )
- self.setFrameStyle( QLabel.Box | QLabel.Sunken )
+ TQLabel.__init__(self, "Secret", parent, name)
+ self.setBackgroundColor( TQt.blue.light() )
+ self.setFrameStyle( TQLabel.Box | TQLabel.Sunken )
self.setMinimumHeight( self.sizeHint().height()*2 )
- self.setAlignment( QLabel.AlignCenter )
+ self.setAlignment( TQLabel.AlignCenter )
self.mySecret = secret
def mousePressEvent(self, e):
sd = SecretDrag( self.mySecret, self )
- sd.setPixmap(QPixmap(picture_xpm),QPoint(8,8))
+ sd.setPixmap(TQPixmap(picture_xpm),TQPoint(8,8))
sd.dragCopy()
self.mySecret = self.mySecret + 1
diff --git a/examples2/semaphore.py b/examples2/semaphore.py
index 5a3ab92..9aaf6d5 100755
--- a/examples2/semaphore.py
+++ b/examples2/semaphore.py
@@ -1,13 +1,13 @@
#!/usr/bin/env python
#
-# A port of the semaphore example from Qt.
+# A port of the semaphore example from TQt.
import sys
# Check if thread support was enabled.
try:
- from qt import QThread
+ from qt import TQThread
except:
print "Thread support not enabled"
sys.exit(1)
@@ -20,13 +20,13 @@ yellowSem = None
greenSem = None
-class YellowThread(QThread):
+class YellowThread(TQThread):
def __init__(self,o):
- QThread.__init__(self)
+ TQThread.__init__(self)
self.receiver = o
self.stopped = 0
- self.mutex = QMutex()
+ self.mutex = TQMutex()
def run(self):
global yellowSem, greenSem
@@ -34,9 +34,9 @@ class YellowThread(QThread):
for i in range(20):
yellowSem += 1
- event = QCustomEvent(12345)
- event.setData(QString("Yellow!"))
- QThread.postEvent(self.receiver,event)
+ event = TQCustomEvent(12345)
+ event.setData(TQString("Yellow!"))
+ TQThread.postEvent(self.receiver,event)
self.msleep(200);
greenSem -= 1
@@ -51,9 +51,9 @@ class YellowThread(QThread):
yellowSem += 1
- event = QCustomEvent(12346)
- event.setData(QString("Yellow!"))
- QThread.postEvent(self.receiver,event)
+ event = TQCustomEvent(12346)
+ event.setData(TQString("Yellow!"))
+ TQThread.postEvent(self.receiver,event)
greenSem -= 1
@@ -63,13 +63,13 @@ class YellowThread(QThread):
self.mutex.unlock()
-class GreenThread(QThread):
+class GreenThread(TQThread):
def __init__(self,o):
- QThread.__init__(self)
+ TQThread.__init__(self)
self.receiver = o
self.stopped = 0
- self.mutex = QMutex()
+ self.mutex = TQMutex()
def run(self):
global yellowSem, greenSem
@@ -77,9 +77,9 @@ class GreenThread(QThread):
for i in range(20):
greenSem += 1
- event = QCustomEvent(12345)
- event.setData(QString("Green!"))
- QThread.postEvent(self.receiver,event)
+ event = TQCustomEvent(12345)
+ event.setData(TQString("Green!"))
+ TQThread.postEvent(self.receiver,event)
self.msleep(200)
yellowSem -= 1
@@ -94,9 +94,9 @@ class GreenThread(QThread):
greenSem += 1
- event = QCustomEvent(12346)
- event.setData(QString("Green!"))
- QThread.postEvent(self.receiver,event)
+ event = TQCustomEvent(12346)
+ event.setData(TQString("Green!"))
+ TQThread.postEvent(self.receiver,event)
self.msleep(10)
yellowSem -= 1
@@ -107,24 +107,24 @@ class GreenThread(QThread):
self.mutex.unlock()
-class SemaphoreExample(QWidget):
+class SemaphoreExample(TQWidget):
def __init__(self):
- QWidget.__init__(self)
+ TQWidget.__init__(self)
self.yellowThread = YellowThread(self)
self.greenThread = GreenThread(self)
global yellowSem, greenSem
- yellowSem = QSemaphore(1)
- greenSem = QSemaphore(1)
+ yellowSem = TQSemaphore(1)
+ greenSem = TQSemaphore(1)
- self.button = QPushButton("&Ignition!",self)
+ self.button = TQPushButton("&Ignition!",self)
self.connect(self.button,SIGNAL("clicked()"),self.startExample)
- self.mlineedit = QMultiLineEdit(self)
- self.label = QLabel(self)
+ self.mlineedit = TQMultiLineEdit(self)
+ self.label = TQLabel(self)
- vbox = QVBoxLayout(self,5)
+ vbox = TQVBoxLayout(self,5)
vbox.addWidget(self.button)
vbox.addWidget(self.mlineedit)
vbox.addWidget(self.label)
@@ -151,7 +151,7 @@ class SemaphoreExample(QWidget):
def startExample(self):
if self.yellowThread.running() or self.greenThread.running():
- QMessageBox.information(self,"Sorry",
+ TQMessageBox.information(self,"Sorry",
"The threads have not completed yet, and must finish before "
"they can be started again.")
@@ -176,9 +176,9 @@ class SemaphoreExample(QWidget):
self.mlineedit.append(s)
if s.latin1() == "Green!":
- self.label.setBackgroundColor(Qt.green)
+ self.label.setBackgroundColor(TQt.green)
else:
- self.label.setBackgroundColor(Qt.yellow)
+ self.label.setBackgroundColor(TQt.yellow)
self.label.setText(s)
@@ -186,7 +186,7 @@ class SemaphoreExample(QWidget):
elif event.type() == 12346:
s = event.data()
- QMessageBox.information(self,s.latin1() + " - Finished",
+ TQMessageBox.information(self,s.latin1() + " - Finished",
"The thread creating the \"" + s.latin1() +
"\" events has finished.")
@@ -195,7 +195,7 @@ class SemaphoreExample(QWidget):
print "Unknown custom event type:", event.type()
-app = QApplication(sys.argv)
+app = TQApplication(sys.argv)
se = SemaphoreExample()
app.setMainWidget(se)
se.show()
diff --git a/examples2/splitter.py b/examples2/splitter.py
index 1c2fef7..b2e30cc 100755
--- a/examples2/splitter.py
+++ b/examples2/splitter.py
@@ -3,12 +3,12 @@
import sys
from qt import *
-class Test(QWidget):
+class Test(TQWidget):
def __init__(self, parent=None, name='Test', f=0):
- QWidget.__init__(self, parent, name, f)
+ TQWidget.__init__(self, parent, name, f)
def paintEvent(self, e):
- p = QPainter(self)
+ p = TQPainter(self)
p.setClipRect(e.rect())
d = 1000
x1 = 0
@@ -30,31 +30,31 @@ class Test(QWidget):
if __name__=="__main__":
- a = QApplication(sys.argv)
+ a = TQApplication(sys.argv)
- s1 = QSplitter(Qt.Vertical, None, "main")
- s2 = QSplitter(Qt.Horizontal, s1, "top")
+ s1 = TQSplitter(TQt.Vertical, None, "main")
+ s2 = TQSplitter(TQt.Horizontal, s1, "top")
t1 = Test(s2)
- t1.setBackgroundColor(Qt.blue.light(180))
+ t1.setBackgroundColor(TQt.blue.light(180))
t1.setMinimumSize(50,0)
t2 = Test(s2)
- t2.setBackgroundColor(Qt.green.light(180))
- s2.setResizeMode(t2, QSplitter.KeepSize)
+ t2.setBackgroundColor(TQt.green.light(180))
+ s2.setResizeMode(t2, TQSplitter.KeepSize)
s2.moveToFirst(t2)
- s3 = QSplitter(Qt.Horizontal, s1, "bottom")
+ s3 = TQSplitter(TQt.Horizontal, s1, "bottom")
t3 = Test(s3)
- t3.setBackgroundColor(Qt.red)
+ t3.setBackgroundColor(TQt.red)
t4 = Test(s3)
- t4.setBackgroundColor(Qt.white)
+ t4.setBackgroundColor(TQt.white)
t5 = Test(s3)
t5.setMaximumHeight(250)
t5.setMinimumSize(80,50)
- t5.setBackgroundColor(Qt.yellow)
+ t5.setBackgroundColor(TQt.yellow)
s1.setOpaqueResize(1)
s2.setOpaqueResize(1)
diff --git a/examples2/table.py b/examples2/table.py
index 58fd04b..f9502b7 100755
--- a/examples2/table.py
+++ b/examples2/table.py
@@ -3,12 +3,12 @@
import sys
from qt import *
-class Table(QTableView):
+class Table(TQTableView):
def __init__(self, numRows, numCols, parent=None, name=''):
- QTableView.__init__(self, parent, name)
+ TQTableView.__init__(self, parent, name)
self.curRow = self.curCol = 0
- self.setFocusPolicy(QWidget.StrongFocus)
- self.setBackgroundMode(QWidget.PaletteBase)
+ self.setFocusPolicy(TQWidget.StrongFocus)
+ self.setBackgroundMode(TQWidget.PaletteBase)
self.setNumCols(numCols)
self.setNumRows(numRows)
self.setCellWidth(100)
@@ -39,11 +39,11 @@ class Table(QTableView):
if self.hasFocus():
p.drawRect(0, 0, x2, y2)
else:
- p.setPen(Qt.DotLine)
+ p.setPen(TQt.DotLine)
p.drawRect(0, 0, x2, y2)
- p.setPen(Qt.SolidLine)
+ p.setPen(TQt.SolidLine)
- p.drawText(0,0,w,h,Qt.AlignCenter,self.contents[self.indexOf(row,col)])
+ p.drawText(0,0,w,h,TQt.AlignCenter,self.contents[self.indexOf(row,col)])
def mousePressEvent(self, me):
oldRow = self.curRow
@@ -105,7 +105,7 @@ class Table(QTableView):
numRows = 20
numCols = 20
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
v = Table(numRows, numCols)
for i in range(numRows):
for j in range(numCols):
diff --git a/examples2/themes.py b/examples2/themes.py
index b3dae55..4dace47 100755
--- a/examples2/themes.py
+++ b/examples2/themes.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# This is a port to PyQt of the Qt v2.x example program. It does not (yet)
+# This is a port to PyTQt of the TQt v2.x example program. It does not (yet)
# include the implementation of all of the example widgets.
@@ -16,46 +16,46 @@ import os, sys
from qt import *
-class ButtonsGroups(QVBox):
+class ButtonsGroups(TQVBox):
def __init__(self, parent=None, name=None):
- QVBox.__init__(self, parent, name)
+ TQVBox.__init__(self, parent, name)
# Create widgets which allow easy layouting
- box1=QHBox(self)
- box2=QHBox(self)
+ box1=TQHBox(self)
+ box2=TQHBox(self)
# first group
# Create an exclusive button group
- grp1=QButtonGroup( 1
- , QGroupBox.Horizontal
+ grp1=TQButtonGroup( 1
+ , TQGroupBox.Horizontal
, "Button Group 1 (exclusive)"
, box1
)
grp1.setExclusive(TRUE)
# insert 3 radiobuttons
- rb11=QRadioButton("&Radiobutton 1", grp1)
+ rb11=TQRadioButton("&Radiobutton 1", grp1)
rb11.setChecked(TRUE)
- QRadioButton("R&adiobutton 2", grp1)
- QRadioButton("Ra&diobutton 3", grp1)
+ TQRadioButton("R&adiobutton 2", grp1)
+ TQRadioButton("Ra&diobutton 3", grp1)
# second group
# Create a non-exclusive buttongroup
- grp2=QButtonGroup( 1
- , QGroupBox.Horizontal
+ grp2=TQButtonGroup( 1
+ , TQGroupBox.Horizontal
, "Button Group 2 (non-exclusive)"
, box1
)
grp2.setExclusive(FALSE)
# insert 3 checkboxes
- QCheckBox("&Checkbox 1", grp2)
- cb12=QCheckBox("C&heckbox 2", grp2)
+ TQCheckBox("&Checkbox 1", grp2)
+ cb12=TQCheckBox("C&heckbox 2", grp2)
cb12.setChecked(TRUE)
- cb13=QCheckBox("Triple &State Button", grp2)
+ cb13=TQCheckBox("Triple &State Button", grp2)
cb13.setTristate(TRUE)
cb13.setChecked(TRUE)
@@ -63,21 +63,21 @@ class ButtonsGroups(QVBox):
# create a buttongroup which is exclusive for radiobuttons and
# non-exclusive for all other buttons
- grp3=QButtonGroup( 1
- , QGroupBox.Horizontal
+ grp3=TQButtonGroup( 1
+ , TQGroupBox.Horizontal
, "Button Group 3 (Radiobutton-exclusive)"
, box2
)
grp3.setRadioButtonExclusive(TRUE)
# insert three radiobuttons
- self.rb21=QRadioButton("Rad&iobutton 1", grp3)
- self.rb22=QRadioButton("Radi&obutton 2", grp3)
- self.rb23=QRadioButton("Radio&button 3", grp3)
+ self.rb21=TQRadioButton("Rad&iobutton 1", grp3)
+ self.rb22=TQRadioButton("Radi&obutton 2", grp3)
+ self.rb23=TQRadioButton("Radio&button 3", grp3)
self.rb23.setChecked(TRUE)
# insert a checkbox...
- self.state=QCheckBox("E&nable Radiobuttons", grp3)
+ self.state=TQCheckBox("E&nable Radiobuttons", grp3)
self.state.setChecked(TRUE)
# ...and connect its SIGNAL clicked() with the SLOT slotChangeGrp3State()
self.connect(self.state, SIGNAL('clicked()'),self.slotChangeGrp3State)
@@ -85,15 +85,15 @@ class ButtonsGroups(QVBox):
# fourth group
# create a groupbox which lays out its childs in a column
- grp4=QGroupBox( 1
- , QGroupBox.Horizontal
+ grp4=TQGroupBox( 1
+ , TQGroupBox.Horizontal
, "Groupbox with normal buttons"
, box2
)
# insert two pushbuttons...
- QPushButton("&Push Button", grp4)
- tb=QPushButton("&Toggle Button", grp4)
+ TQPushButton("&Push Button", grp4)
+ tb=TQPushButton("&Toggle Button", grp4)
# ...and make the second one a toggle button
tb.setToggleButton(TRUE)
@@ -105,22 +105,22 @@ class ButtonsGroups(QVBox):
self.rb23.setEnabled(self.state.isChecked())
-class LineEdits(QVBox):
+class LineEdits(TQVBox):
def __init__(self, parent=None, name=None):
- QVBox.__init__(self, parent, name)
+ TQVBox.__init__(self, parent, name)
self.setMargin(10)
# Widget for layouting
- row1=QHBox(self)
+ row1=TQHBox(self)
row1.setMargin(5)
# Create a label
- QLabel("Echo Mode: ", row1)
+ TQLabel("Echo Mode: ", row1)
# Create a Combobox with three items...
- self.combo1=QComboBox(FALSE, row1)
+ self.combo1=TQComboBox(FALSE, row1)
self.combo1.insertItem("Normal", -1)
self.combo1.insertItem("Password", -1)
self.combo1.insertItem("No Echo", -1)
@@ -129,17 +129,17 @@ class LineEdits(QVBox):
self.connect(self.combo1, SIGNAL('activated(int)'), self.slotEchoChanged)
# insert the first LineEdit
- self.lined1=QLineEdit(self)
+ self.lined1=TQLineEdit(self)
# another widget which is used for layouting
- row2=QHBox(self)
+ row2=TQHBox(self)
row2.setMargin(5)
# and the second label
- QLabel("Validator: ", row2)
+ TQLabel("Validator: ", row2)
# A second Combobox with again three items...
- self.combo2=QComboBox(FALSE, row2)
+ self.combo2=TQComboBox(FALSE, row2)
self.combo2.insertItem("No Validator", -1)
self.combo2.insertItem("Integer Validator", -1)
self.combo2.insertItem("Double Validator", -1)
@@ -147,17 +147,17 @@ class LineEdits(QVBox):
self.connect(self.combo2, SIGNAL('activated(int)'), self.slotValidatorChanged)
# and the second LineEdit
- self.lined2=QLineEdit(self)
+ self.lined2=TQLineEdit(self)
# yet another widget which is used for layouting
- row3=QHBox(self)
+ row3=TQHBox(self)
row3.setMargin(5)
# we need a label for this too
- QLabel("Alignment: ", row3)
+ TQLabel("Alignment: ", row3)
# A combo box for setting alignment
- self.combo3=QComboBox(FALSE, row3)
+ self.combo3=TQComboBox(FALSE, row3)
self.combo3.insertItem("Left", -1)
self.combo3.insertItem("Centered", -1)
self.combo3.insertItem("Right", -1)
@@ -165,18 +165,18 @@ class LineEdits(QVBox):
self.connect(self.combo3, SIGNAL('activated(int)'), self.slotAlignmentChanged)
# and the lineedit
- self.lined3=QLineEdit(self)
+ self.lined3=TQLineEdit(self)
# give the first LineEdit the focus at the beginning
self.lined1.setFocus()
def slotEchoChanged(self, i):
if i == 0:
- self.lined1.setEchoMode(QLineEdit.EchoMode.Normal)
+ self.lined1.setEchoMode(TQLineEdit.EchoMode.Normal)
elif i == 1:
- self.lined1.setEchoMode(QLineEdit.EchoMode.Password)
+ self.lined1.setEchoMode(TQLineEdit.EchoMode.Password)
elif i == 2:
- self.lined1.setEchoMode(QLineEdit.EchoMode.NoEcho)
+ self.lined1.setEchoMode(TQLineEdit.EchoMode.NoEcho)
self.lined1.setFocus()
@@ -185,10 +185,10 @@ class LineEdits(QVBox):
self.validator=None
self.lined2.setValidator(self.validator)
elif i == 1:
- self.validator=QIntValidator(self.lined2)
+ self.validator=TQIntValidator(self.lined2)
self.lined2.setValidator(self.validator)
elif i == 2:
- self.validator=QDoubleValidator(-999.0, 999.0, 2, self.lined2)
+ self.validator=TQDoubleValidator(-999.0, 999.0, 2, self.lined2)
self.lined2.setValidator(self.validator)
self.lined2.setText("")
@@ -196,40 +196,40 @@ class LineEdits(QVBox):
def slotAlignmentChanged(self, i):
if i == 0:
- self.lined3.setAlignment(Qt.AlignLeft)
+ self.lined3.setAlignment(TQt.AlignLeft)
elif i == 1:
- self.lined3.setAlignment(Qt.AlignCenter)
+ self.lined3.setAlignment(TQt.AlignCenter)
elif i == 2:
- self.lined3.setAlignment(Qt.AlignRight)
+ self.lined3.setAlignment(TQt.AlignRight)
self.lined3.setFocus()
-class ProgressBar(QVBox):
+class ProgressBar(TQVBox):
def __init__(self, parent=None, name=None):
- QVBox.__init__(self, parent, name)
+ TQVBox.__init__(self, parent, name)
- self.timer=QTimer()
+ self.timer=TQTimer()
self.setMargin(10)
# Create a radiobutton-exclusive Buttongroup which aligns its childs in two
# columns
- bg=QButtonGroup(2, QGroupBox.Horizontal, self)
+ bg=TQButtonGroup(2, TQGroupBox.Horizontal, self)
bg.setRadioButtonExclusive(TRUE)
# insert three radiobuttons which the user can use to set the speed of the
# progress and two pushbuttons to start/pause/continue and reset the
# progress
- self.slow=QRadioButton("&Slow", bg)
- self.start=QPushButton("S&tart", bg)
- self.normal=QRadioButton("&Normal", bg)
- self.reset=QPushButton("&Reset", bg)
- self.fast=QRadioButton("&Fast", bg)
+ self.slow=TQRadioButton("&Slow", bg)
+ self.start=TQPushButton("S&tart", bg)
+ self.normal=TQRadioButton("&Normal", bg)
+ self.reset=TQPushButton("&Reset", bg)
+ self.fast=TQRadioButton("&Fast", bg)
# Create the progressbar
- self.progress=QProgressBar(100, self)
+ self.progress=TQProgressBar(100, self)
# connect the clicked() SIGNALs of the pushbuttons to SLOTs
self.connect(self.start, SIGNAL('clicked()'), self.slotStart)
@@ -303,34 +303,34 @@ class ProgressBar(QVBox):
self.progress.setProgress(p+1)
-class ListBoxCombo(QVBox):
+class ListBoxCombo(TQVBox):
def __init__(self, parent=None, name=None):
- QVBox.__init__(self, parent, name)
+ TQVBox.__init__(self, parent, name)
self.setMargin(5)
- row1=QHBox(self)
+ row1=TQHBox(self)
row1.setMargin(5)
# Create a multi-selection ListBox...
- self.lb1=QListBox(row1)
+ self.lb1=TQListBox(row1)
self.lb1.setMultiSelection(TRUE)
# ...insert a pixmap item...
- self.lb1.insertItem(QPixmap("qtlogo.png"))
+ self.lb1.insertItem(TQPixmap("qtlogo.png"))
# ...and 100 text items
for i in range(100):
- str=QString("Listbox Item %1").arg(i)
+ str=TQString("Listbox Item %1").arg(i)
self.lb1.insertItem(str)
# Create a pushbutton...
- self.arrow1=QPushButton(" -> ", row1)
+ self.arrow1=TQPushButton(" -> ", row1)
# ...and connect the clicked SIGNAL with the SLOT slotLeft2Right
self.connect(self.arrow1, SIGNAL('clicked()'), self.slotLeft2Right)
# create an empty single-selection ListBox
- self.lb2=QListBox(row1)
+ self.lb2=TQListBox(row1)
def slotLeft2Right(self):
# Go through all items of the first ListBox
@@ -341,107 +341,107 @@ class ListBoxCombo(QVBox):
# ...and it is a text item...
if not item.text().isEmpty():
# ...insert an item with the same text into the second ListBox
- self.lb2.insertItem(QListBoxText(item.text()))
+ self.lb2.insertItem(TQListBoxText(item.text()))
# ...and if it is a pixmap item...
elif item.pixmap():
# ...insert an item with the same pixmap into the second ListBox
- self.lb2.insertItem(QListBoxPixmap(item.pixmap()))
+ self.lb2.insertItem(TQListBoxPixmap(item.pixmap()))
-class NorwegianWoodStyle(QMotifStyle):
+class NorwegianWoodStyle(TQMotifStyle):
def __init__(self):
- QMotifStyle.__init__(self)
+ TQMotifStyle.__init__(self)
def polish(self,o):
- if isinstance(o,QApplication):
+ if isinstance(o,TQApplication):
self.polish_qapplication(o)
- elif isinstance(o,QWidget):
+ elif isinstance(o,TQWidget):
self.polish_qwidget(o)
else:
- QMotifStyle.polish(self,o)
+ TQMotifStyle.polish(self,o)
def unPolish(self,o):
- if isinstance(o,QApplication):
+ if isinstance(o,TQApplication):
self.unPolish_qapplication(o)
- elif isinstance(o,QWidget):
+ elif isinstance(o,TQWidget):
self.unPolish_qwidget(o)
else:
- QMotifStyle.unPolish(self,o)
+ TQMotifStyle.unPolish(self,o)
def polish_qapplication(self,app):
global button_xpm, polish_xpm
self.oldPalette=app.palette()
- # we simply create a nice QColorGroup with a couple of fancy wood pixmaps
+ # we simply create a nice TQColorGroup with a couple of fancy wood pixmaps
# here and apply it to all widgets
- img=QImage(button_xpm)
- orig=QImage(img)
+ img=TQImage(button_xpm)
+ orig=TQImage(img)
orig.detach()
- button=QPixmap()
+ button=TQPixmap()
button.convertFromImage(img)
- background=QPixmap(polish_xpm)
+ background=TQPixmap(polish_xpm)
for i in range(img.numColors()):
rgb=img.color(i)
- c=QColor(rgb)
+ c=TQColor(rgb)
(r, g, b)=c.dark().rgb()
img.setColor(i,qRgb(r, g, b))
- mid=QPixmap()
+ mid=TQPixmap()
mid.convertFromImage(img)
- img=QImage(orig)
+ img=TQImage(orig)
for i in range(img.numColors()):
rgb=img.color(i)
- c=QColor(rgb)
+ c=TQColor(rgb)
(r, g, b)=c.light().rgb()
img.setColor(i,qRgb(r, g, b))
- light=QPixmap()
+ light=TQPixmap()
light.convertFromImage(img)
- img=QImage(orig)
+ img=TQImage(orig)
for i in range(img.numColors()):
rgb=img.color(i)
- c=QColor(rgb)
+ c=TQColor(rgb)
(r, g, b)=c.dark().rgb()
img.setColor(i,qRgb(r, g, b))
- dark=QPixmap()
+ dark=TQPixmap()
dark.convertFromImage(img)
- op=QPalette(QColor(212,140,95))
-
- nor=QColorGroup(QBrush(op.normal().foreground()),
- QBrush(op.normal().button(), button),
- QBrush(op.normal().light(), light),
- QBrush(op.normal().dark(), dark),
- QBrush(op.normal().mid(), mid),
- QBrush(op.normal().text()),
- QBrush(Qt.white),
- QBrush(QColor(236,182,120)),
- QBrush(op.normal().background(), background))
- disabled=QColorGroup(QBrush(op.disabled().foreground()),
- QBrush(op.disabled().button(), button),
- QBrush(op.disabled().light(), light),
- QBrush(op.disabled().dark()),
- QBrush(op.disabled().mid(), mid),
- QBrush(op.disabled().text()),
- QBrush(Qt.white),
- QBrush(QColor(236,182,120)),
- QBrush(op.disabled().background(), background))
- active=QColorGroup(QBrush(op.active().foreground()),
- QBrush(op.active().button(), button),
- QBrush(op.active().light(), light),
- QBrush(op.active().dark()),
- QBrush(op.active().mid(), mid),
- QBrush(op.active().text()),
- QBrush(Qt.white),
- QBrush(QColor(236,182,120)),
- QBrush(op.active().background(), background))
-
- app.setPalette(QPalette(nor, disabled, active), TRUE)
+ op=TQPalette(TQColor(212,140,95))
+
+ nor=TQColorGroup(TQBrush(op.normal().foreground()),
+ TQBrush(op.normal().button(), button),
+ TQBrush(op.normal().light(), light),
+ TQBrush(op.normal().dark(), dark),
+ TQBrush(op.normal().mid(), mid),
+ TQBrush(op.normal().text()),
+ TQBrush(TQt.white),
+ TQBrush(TQColor(236,182,120)),
+ TQBrush(op.normal().background(), background))
+ disabled=TQColorGroup(TQBrush(op.disabled().foreground()),
+ TQBrush(op.disabled().button(), button),
+ TQBrush(op.disabled().light(), light),
+ TQBrush(op.disabled().dark()),
+ TQBrush(op.disabled().mid(), mid),
+ TQBrush(op.disabled().text()),
+ TQBrush(TQt.white),
+ TQBrush(TQColor(236,182,120)),
+ TQBrush(op.disabled().background(), background))
+ active=TQColorGroup(TQBrush(op.active().foreground()),
+ TQBrush(op.active().button(), button),
+ TQBrush(op.active().light(), light),
+ TQBrush(op.active().dark()),
+ TQBrush(op.active().mid(), mid),
+ TQBrush(op.active().text()),
+ TQBrush(TQt.white),
+ TQBrush(TQColor(236,182,120)),
+ TQBrush(op.active().background(), background))
+
+ app.setPalette(TQPalette(nor, disabled, active), TRUE)
def unPolish_qapplication(self,app):
app.setPalette(self.oldPalette, TRUE)
@@ -450,37 +450,37 @@ class NorwegianWoodStyle(QMotifStyle):
# the polish function will set some widgets to transparent mode, to get the
# full benefit from the nice pixmaps in the color group.
- if w.inherits("QTipLabel"):
+ if w.inherits("TQTipLabel"):
return
- if w.inherits("QLCDNumber"):
+ if w.inherits("TQLCDNumber"):
return
if not w.isTopLevel():
- if w.inherits("QLabel") \
- or w.inherits("QButton") \
- or w.inherits("QComboBox") \
- or w.inherits("QGroupBox") \
- or w.inherits("QSlider") \
- or w.inherits("QTabWidget") \
- or w.inherits("QTabBar"):
+ if w.inherits("TQLabel") \
+ or w.inherits("TQButton") \
+ or w.inherits("TQComboBox") \
+ or w.inherits("TQGroupBox") \
+ or w.inherits("TQSlider") \
+ or w.inherits("TQTabWidget") \
+ or w.inherits("TQTabBar"):
w.setAutoMask(TRUE)
def unPolish_qwidget(self,w):
- if w.inherits("QTipLabel"):
+ if w.inherits("TQTipLabel"):
return
- if w.inherits("QLCDNumber"):
+ if w.inherits("TQLCDNumber"):
return
if not w.isTopLevel():
- if w.inherits("QLabel") \
- or w.inherits("QButton") \
- or w.inherits("QComboBox") \
- or w.inherits("QGroupBox") \
- or w.inherits("QSlider") \
- or w.inherits("QTabWidget") \
- or w.inherits("QTabBar"):
+ if w.inherits("TQLabel") \
+ or w.inherits("TQButton") \
+ or w.inherits("TQComboBox") \
+ or w.inherits("TQGroupBox") \
+ or w.inherits("TQSlider") \
+ or w.inherits("TQTabWidget") \
+ or w.inherits("TQTabBar"):
w.setAutoMask(FALSE)
def drawroundrect(self, p, x, y, w, h, d):
@@ -493,14 +493,14 @@ class NorwegianWoodStyle(QMotifStyle):
oldBrush=p.brush()
oldPen=p.pen()
- p.setPen(Qt.NoPen)
+ p.setPen(TQt.NoPen)
if fill != None:
newBrush=fill
else:
if sunken:
- newBrush=g.brush(QColorGroup.Mid)
+ newBrush=g.brush(TQColorGroup.Mid)
else:
- newBrush=g.brush(QColorGroup.Button)
+ newBrush=g.brush(TQColorGroup.Button)
self.drawroundrect(p, x+3, y+3, w-6, h-6, 5)
p.setBrush(oldBrush)
p.setPen(g.foreground())
@@ -508,7 +508,7 @@ class NorwegianWoodStyle(QMotifStyle):
p.setPen(oldPen)
def drawBevelButton(self, p, x, y, w, h, g, sunken=FALSE, fill=None):
- QMotifStyle.drawBevelButton(self, p, x, y, w, h, g, sunken, fill)
+ TQMotifStyle.drawBevelButton(self, p, x, y, w, h, g, sunken, fill)
def drawPushButton(self, btn, p):
g = btn.colorGroup()
@@ -516,19 +516,19 @@ class NorwegianWoodStyle(QMotifStyle):
(x1, y1, x2, y2)=btn.rect().coords()
p.setPen(g.foreground())
- p.setBrush(QBrush(g.button(),Qt.NoBrush))
+ p.setBrush(TQBrush(g.button(),TQt.NoBrush))
if btn.isDown():
- fill=g.brush(QColorGroup.Mid)
+ fill=g.brush(TQColorGroup.Mid)
elif btn.isOn():
- fill=QBrush(g.mid(),Qt.Dense4Pattern)
+ fill=TQBrush(g.mid(),TQt.Dense4Pattern)
else:
- fill=g.brush(QColorGroup.Button)
+ fill=g.brush(TQColorGroup.Button)
if btn.isDefault():
- a=QPointArray([x1, y1, x2, y1, x2, y2, x1, y2, x1, y1+1,
+ a=TQPointArray([x1, y1, x2, y1, x2, y2, x1, y2, x1, y1+1,
x2-1, y1+1, x2-1, y2-1, x1+1, y2-1, x1+1, y1+1])
- p.setPen(Qt.black)
+ p.setPen(TQt.black)
p.drawPolyline(a)
x1=x1+2
y1=y1+2
@@ -544,12 +544,12 @@ class NorwegianWoodStyle(QMotifStyle):
if btn.isMenuButton():
dx=(y1-y2-4)/3
- self.drawArrow(p, Qt.DownArrow, FALSE,
+ self.drawArrow(p, TQt.DownArrow, FALSE,
x2-dx, dx, y1, y2-y1,
g, btn.isEnabled())
- if p.brush().style != Qt.NoBrush:
- p.setBrush(Qt.NoBrush)
+ if p.brush().style != TQt.NoBrush:
+ p.setBrush(TQt.NoBrush)
def drawPushButtonLabel(self, btn, p):
r=btn.rect()
@@ -573,7 +573,7 @@ class NorwegianWoodStyle(QMotifStyle):
else:
pencolour=btn.colorGroup().buttonText()
self.drawItem(p, x, y, w, h,
- Qt.AlignCenter|Qt.ShowPrefix,
+ TQt.AlignCenter|TQt.ShowPrefix,
g, btn.isEnabled(),
btn.pixmap(), btn.text(), -1,
pencolour)
@@ -582,89 +582,89 @@ class NorwegianWoodStyle(QMotifStyle):
p.translate(-dx,-dy)
def buttonRect(self, x, y, w, h):
- return QRect(x+3, y+2, w-6, h-4)
+ return TQRect(x+3, y+2, w-6, h-4)
def drawButtonMask(self, p, x, y, w, h):
self.drawroundrect(p, x, y, w, h, 8)
-class MetalStyle(QWindowsStyle):
+class MetalStyle(TQWindowsStyle):
def __init__(self):
- QWindowsStyle.__init__(self)
+ TQWindowsStyle.__init__(self)
def polish(self,o):
- if isinstance(o,QApplication):
+ if isinstance(o,TQApplication):
self.polish_qapplication(o)
- elif isinstance(o,QWidget):
+ elif isinstance(o,TQWidget):
self.polish_qwidget(o)
else:
- QWindowsStyle.polish(self,o)
+ TQWindowsStyle.polish(self,o)
def unPolish(self,o):
- if isinstance(o,QApplication):
+ if isinstance(o,TQApplication):
self.unPolish_qapplication(o)
- elif isinstance(o,QWidget):
+ elif isinstance(o,TQWidget):
self.unPolish_qwidget(o)
else:
- QWindowsStyle.unPolish(self,o)
+ TQWindowsStyle.unPolish(self,o)
def polish_qapplication(self,app):
global stone1_xpm, stonebright_xpm
self.oldPalette=app.palette()
- # we simply create a nice QColorGroup with a couple of fancy pixmaps here
+ # we simply create a nice TQColorGroup with a couple of fancy pixmaps here
# and apply it to all widgets
- f=QFont("times", app.font().pointSize())
+ f=TQFont("times", app.font().pointSize())
f.setBold(TRUE)
f.setItalic(TRUE)
- app.setFont(f, TRUE, "QMenuBar")
- app.setFont(f, TRUE, "QPopupMenu")
-
- button=QPixmap(stone1_xpm)
- background=QPixmap(stonebright_xpm)
- dark=QPixmap(1,1)
- dark.fill(Qt.red.dark())
- mid=QPixmap(stone1_xpm)
- light=QPixmap(stone1_xpm)
+ app.setFont(f, TRUE, "TQMenuBar")
+ app.setFont(f, TRUE, "TQPopupMenu")
+
+ button=TQPixmap(stone1_xpm)
+ background=TQPixmap(stonebright_xpm)
+ dark=TQPixmap(1,1)
+ dark.fill(TQt.red.dark())
+ mid=TQPixmap(stone1_xpm)
+ light=TQPixmap(stone1_xpm)
op=app.palette()
- backCol=QColor(227,227,227)
-
- nor=QColorGroup(QBrush(op.normal().foreground()),
- QBrush(op.normal().button(), button),
- QBrush(op.normal().light(), light),
- QBrush(op.normal().dark(), dark),
- QBrush(op.normal().mid(), mid),
- QBrush(op.normal().text()),
- QBrush(Qt.white),
- QBrush(op.normal().base()),
- QBrush(backCol, background))
- nor.setColor(QColorGroup.ButtonText, Qt.white)
- nor.setColor(QColorGroup.Shadow, Qt.black)
- disabled=QColorGroup(QBrush(op.disabled().foreground()),
- QBrush(op.disabled().button(), button),
- QBrush(op.disabled().light(), light),
- QBrush(op.disabled().dark()),
- QBrush(op.disabled().mid(), mid),
- QBrush(op.disabled().text()),
- QBrush(Qt.white),
- QBrush(op.disabled().base()),
- QBrush(backCol, background))
- active=QColorGroup(QBrush(op.active().foreground()),
- QBrush(op.active().button(), button),
- QBrush(op.active().light(), light),
- QBrush(op.active().dark()),
- QBrush(op.active().mid(), mid),
- QBrush(op.active().text()),
- QBrush(Qt.white),
- QBrush(op.active().base()),
- QBrush(backCol, background))
- active.setColor(QColorGroup.ButtonText, Qt.white)
-
- newPalette=QPalette(nor, disabled, active)
+ backCol=TQColor(227,227,227)
+
+ nor=TQColorGroup(TQBrush(op.normal().foreground()),
+ TQBrush(op.normal().button(), button),
+ TQBrush(op.normal().light(), light),
+ TQBrush(op.normal().dark(), dark),
+ TQBrush(op.normal().mid(), mid),
+ TQBrush(op.normal().text()),
+ TQBrush(TQt.white),
+ TQBrush(op.normal().base()),
+ TQBrush(backCol, background))
+ nor.setColor(TQColorGroup.ButtonText, TQt.white)
+ nor.setColor(TQColorGroup.Shadow, TQt.black)
+ disabled=TQColorGroup(TQBrush(op.disabled().foreground()),
+ TQBrush(op.disabled().button(), button),
+ TQBrush(op.disabled().light(), light),
+ TQBrush(op.disabled().dark()),
+ TQBrush(op.disabled().mid(), mid),
+ TQBrush(op.disabled().text()),
+ TQBrush(TQt.white),
+ TQBrush(op.disabled().base()),
+ TQBrush(backCol, background))
+ active=TQColorGroup(TQBrush(op.active().foreground()),
+ TQBrush(op.active().button(), button),
+ TQBrush(op.active().light(), light),
+ TQBrush(op.active().dark()),
+ TQBrush(op.active().mid(), mid),
+ TQBrush(op.active().text()),
+ TQBrush(TQt.white),
+ TQBrush(op.active().base()),
+ TQBrush(backCol, background))
+ active.setColor(TQColorGroup.ButtonText, TQt.white)
+
+ newPalette=TQPalette(nor, disabled, active)
app.setPalette(newPalette, TRUE)
def unPolish_qapplication(self,app):
@@ -675,26 +675,26 @@ class MetalStyle(QWindowsStyle):
# the polish function will set some widgets to transparent mode, to get the
# full benefit from the nice pixmaps in the color group.
- if w.inherits("QPushButton"):
- w.setBackgroundMode(QWidget.NoBackground)
+ if w.inherits("TQPushButton"):
+ w.setBackgroundMode(TQWidget.NoBackground)
def unPolish_qwidget(self,w):
- if w.inherits("QPushButton"):
- w.setBackgroundMode(QWidget.PaletteButton)
+ if w.inherits("TQPushButton"):
+ w.setBackgroundMode(TQWidget.PaletteButton)
def drawButton(self, p, x, y, w, h, g, sunken=FALSE, fill=None):
global img1, metal_xpm
if not img1:
- img1=QImage(metal_xpm)
+ img1=TQImage(metal_xpm)
scaledImage=img1.smoothScale(w, h)
- pix=QPixmap()
+ pix=TQPixmap()
pix.convertFromImage(scaledImage)
p.drawPixmap(x, y, pix)
- g2=QColorGroup()
- g2.setColor(QColorGroup.Light, Qt.white)
- g2.setColor(QColorGroup.Dark, Qt.black)
+ g2=TQColorGroup()
+ g2.setColor(TQColorGroup.Light, TQt.white)
+ g2.setColor(TQColorGroup.Dark, TQt.black)
if sunken:
linewidth=2
@@ -712,19 +712,19 @@ class MetalStyle(QWindowsStyle):
(x1, y1, x2, y2)=btn.rect().coords()
p.setPen(g.foreground())
- p.setBrush(QBrush(g.button(),Qt.NoBrush))
+ p.setBrush(TQBrush(g.button(),TQt.NoBrush))
if btn.isDown():
- fill=g.brush(QColorGroup.Mid)
+ fill=g.brush(TQColorGroup.Mid)
elif btn.isOn():
- fill=QBrush(g.mid(),Qt.Dense4Pattern)
+ fill=TQBrush(g.mid(),TQt.Dense4Pattern)
else:
- fill=g.brush(QColorGroup.Button)
+ fill=g.brush(TQColorGroup.Button)
if btn.isDefault():
- a=QPointArray([x1, y1, x2, y1, x2, y2, x1, y2, x1, y1+1,
+ a=TQPointArray([x1, y1, x2, y1, x2, y2, x1, y2, x1, y1+1,
x2-1, y1+1, x2-1, y2-1, x1+1, y2-1, x1+1, y1+1])
- p.setPen(Qt.black)
+ p.setPen(TQt.black)
p.drawPolyline(a)
x1=x1+2
y1=y1+2
@@ -740,12 +740,12 @@ class MetalStyle(QWindowsStyle):
if btn.isMenuButton():
dx=(y1-y2-4)/3
- self.drawArrow(p, Qt.DownArrow, FALSE,
+ self.drawArrow(p, TQt.DownArrow, FALSE,
x2-dx, dx, y1, y2-y1,
g, btn.isEnabled())
- if p.brush().style != Qt.NoBrush:
- p.setBrush(Qt.NoBrush)
+ if p.brush().style != TQt.NoBrush:
+ p.setBrush(TQt.NoBrush)
def drawPushButtonLabel(self, btn, p):
r=btn.rect()
@@ -771,7 +771,7 @@ class MetalStyle(QWindowsStyle):
h=h-4
g=btn.colorGroup()
self.drawItem(p, x, y, w, h,
- Qt.AlignCenter|Qt.ShowPrefix,
+ TQt.AlignCenter|TQt.ShowPrefix,
g, btn.isEnabled(),
btn.pixmap(), btn.text(), -1,
pencolour)
@@ -780,20 +780,20 @@ class MetalStyle(QWindowsStyle):
p.translate(-dx,-dy)
def drawPanel(self, p, x, y, w, h, g, sunken, lineWidth, fill):
- QStyle.drawPanel(self, p, x, y, w, h, g, sunken, lineWidth, fill)
+ TQStyle.drawPanel(self, p, x, y, w, h, g, sunken, lineWidth, fill)
-class Themes(QMainWindow):
+class Themes(TQMainWindow):
- def __init__(self, parent=None, name=None, f=Qt.WType_TopLevel):
- QMainWindow.__init__(self, parent, name, f)
+ def __init__(self, parent=None, name=None, f=TQt.WType_TopLevel):
+ TQMainWindow.__init__(self, parent, name, f)
- self.appFont=QApplication.font()
- self.tabwidget=QTabWidget(self)
+ self.appFont=TQApplication.font()
+ self.tabwidget=TQTabWidget(self)
self.buttonsgroups=ButtonsGroups(self.tabwidget)
self.tabwidget.addTab(self.buttonsgroups,"Buttons/Groups")
- self.hbox=QHBox(self.tabwidget)
+ self.hbox=TQHBox(self.tabwidget)
self.hbox.setMargin(5)
self.linedits=LineEdits(self.hbox)
self.progressbar=ProgressBar(self.hbox)
@@ -803,7 +803,7 @@ class Themes(QMainWindow):
self.setCentralWidget(self.tabwidget)
- self.style=QPopupMenu(self)
+ self.style=TQPopupMenu(self)
self.style.setCheckable(TRUE)
self.menuBar().insertItem("&Style", self.style)
@@ -815,13 +815,13 @@ class Themes(QMainWindow):
self.sMotif=self.style.insertItem("M&otif", self.styleMotif)
self.sMotifPlus=self.style.insertItem("Motif P&lus", self.styleMotifPlus)
self.style.insertSeparator()
- self.style.insertItem("&Quit", qApp.quit, Qt.CTRL | Qt.Key_Q)
+ self.style.insertItem("&Quit", qApp.quit, TQt.CTRL | TQt.Key_Q)
- self.help=QPopupMenu(self)
+ self.help=TQPopupMenu(self)
self.menuBar().insertSeparator()
self.menuBar().insertItem("&Help", self.help)
- self.help.insertItem("&About", self.about, Qt.Key_F1)
- self.help.insertItem("About &Qt", self.aboutQt)
+ self.help.insertItem("&About", self.about, TQt.Key_F1)
+ self.help.insertItem("About &TQt", self.aboutTQt)
self.style=NorwegianWoodStyle()
qApp.setStyle(self.style)
@@ -846,75 +846,75 @@ class Themes(QMainWindow):
self.selectStyleMenu(self.sMetal)
def stylePlatinum(self):
- newstyle=QPlatinumStyle()
+ newstyle=TQPlatinumStyle()
qApp.setStyle(newstyle)
self.style=newstyle
- p=QPalette(QColor(239, 239, 239))
+ p=TQPalette(TQColor(239, 239, 239))
qApp.setPalette(p, TRUE)
qApp.setFont(self.appFont, TRUE)
self.selectStyleMenu(self.sPlatinum)
def styleWindows(self):
- newstyle=QWindowsStyle()
+ newstyle=TQWindowsStyle()
qApp.setStyle(newstyle)
self.style=newstyle
qApp.setFont(self.appFont, TRUE)
self.selectStyleMenu(self.sWindows)
def styleCDE(self):
- newstyle=QCDEStyle(TRUE)
+ newstyle=TQCDEStyle(TRUE)
qApp.setStyle(newstyle)
self.style=newstyle
self.selectStyleMenu(self.sCDE)
- p=QPalette(QColor(75, 123, 130))
- p.setColor(QPalette.Active, QColorGroup.Base, QColor(55, 77, 78));
- p.setColor(QPalette.Inactive, QColorGroup.Base, QColor(55, 77, 78));
- p.setColor(QPalette.Disabled, QColorGroup.Base, QColor(55, 77, 78));
- p.setColor(QPalette.Active, QColorGroup.Highlight, Qt.white);
- p.setColor(QPalette.Active, QColorGroup.HighlightedText, QColor(55, 77, 78));
- p.setColor(QPalette.Inactive, QColorGroup.Highlight, Qt.white);
- p.setColor(QPalette.Inactive, QColorGroup.HighlightedText, QColor(55, 77, 78));
- p.setColor(QPalette.Disabled, QColorGroup.Highlight, Qt.white);
- p.setColor(QPalette.Disabled, QColorGroup.HighlightedText, QColor(55, 77, 78));
- p.setColor(QPalette.Active, QColorGroup.Foreground, Qt.white);
- p.setColor(QPalette.Active, QColorGroup.Text, Qt.white);
- p.setColor(QPalette.Active, QColorGroup.ButtonText, Qt.white);
- p.setColor(QPalette.Inactive, QColorGroup.Foreground, Qt.white);
- p.setColor(QPalette.Inactive, QColorGroup.Text, Qt.white);
- p.setColor(QPalette.Inactive, QColorGroup.ButtonText, Qt.white);
- p.setColor(QPalette.Disabled, QColorGroup.Foreground, Qt.lightGray);
- p.setColor(QPalette.Disabled, QColorGroup.Text, Qt.lightGray);
- p.setColor(QPalette.Disabled, QColorGroup.ButtonText, Qt.lightGray);
+ p=TQPalette(TQColor(75, 123, 130))
+ p.setColor(TQPalette.Active, TQColorGroup.Base, TQColor(55, 77, 78));
+ p.setColor(TQPalette.Inactive, TQColorGroup.Base, TQColor(55, 77, 78));
+ p.setColor(TQPalette.Disabled, TQColorGroup.Base, TQColor(55, 77, 78));
+ p.setColor(TQPalette.Active, TQColorGroup.Highlight, TQt.white);
+ p.setColor(TQPalette.Active, TQColorGroup.HighlightedText, TQColor(55, 77, 78));
+ p.setColor(TQPalette.Inactive, TQColorGroup.Highlight, TQt.white);
+ p.setColor(TQPalette.Inactive, TQColorGroup.HighlightedText, TQColor(55, 77, 78));
+ p.setColor(TQPalette.Disabled, TQColorGroup.Highlight, TQt.white);
+ p.setColor(TQPalette.Disabled, TQColorGroup.HighlightedText, TQColor(55, 77, 78));
+ p.setColor(TQPalette.Active, TQColorGroup.Foreground, TQt.white);
+ p.setColor(TQPalette.Active, TQColorGroup.Text, TQt.white);
+ p.setColor(TQPalette.Active, TQColorGroup.ButtonText, TQt.white);
+ p.setColor(TQPalette.Inactive, TQColorGroup.Foreground, TQt.white);
+ p.setColor(TQPalette.Inactive, TQColorGroup.Text, TQt.white);
+ p.setColor(TQPalette.Inactive, TQColorGroup.ButtonText, TQt.white);
+ p.setColor(TQPalette.Disabled, TQColorGroup.Foreground, TQt.lightGray);
+ p.setColor(TQPalette.Disabled, TQColorGroup.Text, TQt.lightGray);
+ p.setColor(TQPalette.Disabled, TQColorGroup.ButtonText, TQt.lightGray);
qApp.setPalette(p, TRUE)
- qApp.setFont(QFont("times", self.appFont.pointSize()), TRUE)
+ qApp.setFont(TQFont("times", self.appFont.pointSize()), TRUE)
def styleMotif(self):
- newstyle=QMotifStyle(TRUE)
+ newstyle=TQMotifStyle(TRUE)
qApp.setStyle(newstyle)
self.style=newstyle
- p=QPalette(QColor(192, 192, 192))
+ p=TQPalette(TQColor(192, 192, 192))
qApp.setPalette(p, TRUE)
qApp.setFont(self.appFont, TRUE)
self.selectStyleMenu(self.sMotif)
def styleMotifPlus(self):
- newstyle=QMotifPlusStyle(TRUE)
+ newstyle=TQMotifPlusStyle(TRUE)
qApp.setStyle(newstyle)
self.style=newstyle
- p=QPalette(QColor(192, 192, 192))
+ p=TQPalette(TQColor(192, 192, 192))
qApp.setPalette(p, TRUE)
qApp.setFont(self.appFont, TRUE)
self.selectStyleMenu(self.sMotifPlus)
def about(self):
- QMessageBox.about(self, "Qt Themes Example",
+ TQMessageBox.about(self, "TQt Themes Example",
"<p>This example demonstrates the concept of "
"<b>generalized GUI styles </b> first introduced "
- " with the 2.0 release of Qt.</p>" )
+ " with the 2.0 release of TQt.</p>" )
- def aboutQt(self):
- QMessageBox.aboutQt(self, "Qt Themes Example")
+ def aboutTQt(self):
+ TQMessageBox.aboutTQt(self, "TQt Themes Example")
def selectStyleMenu(self, s):
self.menuBar().setItemChecked(self.sWood, FALSE)
@@ -928,12 +928,12 @@ class Themes(QMainWindow):
def main(argv):
- QApplication.setColorSpec(QApplication.CustomColor)
- QApplication.setStyle(QWindowsStyle())
- a=QApplication(sys.argv)
+ TQApplication.setColorSpec(TQApplication.CustomColor)
+ TQApplication.setStyle(TQWindowsStyle())
+ a=TQApplication(sys.argv)
themes=Themes()
- themes.setCaption('Theme (QStyle) example')
+ themes.setCaption('Theme (TQStyle) example')
themes.resize(640,400)
a.setMainWidget(themes)
themes.show()
@@ -2399,44 +2399,44 @@ metal_xpm = [
"P c #646a74",
"Q c #747a84",
"R c #6c727c",
-"DNDDDDDDDDDDNDNDNDNNiNNiNiNyiyiyqyyyyIyIcIcIcAsAsAAKAKeKememkmmmQEQEEaoaoaaFRFFFftftlfPllllpxpxpxHbbbrbrzrzrJddddOdOOjOjOnwwwwwGwGG#GCGC#CCCCCCCMCMMMhMBhB",
-"DDDNDNDNDNDNDDNDiDNDNDiyNNiNNyNyiyqyqyIyIIcIcIAcAsAseAKeKekemkmkEmEQEEoaoaoRFRFFtFtftltlPllplpxpbpbHbbrbrrzrdrdJdddOOOOjOwOwOGwwwGwGGGCGCG#CvCCMCMCCMMMMMM",
-"NNDNDNDNDNDNDiDNDNiNiNNDNNyNyqNqyqyqycyIcIcIAIAsAsAKAKKeKkKmkmkEmQQoQoEaoFoaFRtRFftftfPlPpllpxpbpbHbbbbrzrrdrdrdddOddOOwOOwOwwwwGwGwCGwCGGCvCCvCCChCMCBhMB",
-"DDiDNDNDNDiDNNNiNNDiNyNiyNiyNyyNyyyIqIIcIcIAIcAsAAseKeKemKmkmkQmEEQEoaEaoaFRoFFtttftltlPlPppxppxbpbHbrrrrzrzrdddJdOdjOOOjwOwwOGwGwGGw#CGGCvCvCCCMMCMhCMCBM",
-"iNNNiNiNiNNiDNDNNiNyNiNiNyNyiyqyqIqyIIyIcIcIcAsAsKAKAKeKeekmkmEkQQEEQaooaRoFFtRFFftltflPllllppxpHbpbHbbzrrdrdrOrOddOOjOwOOGOwGwwGwGwCGGCGCCGCCMvCCMCMMhMMB",
-"NiNNNNNNNNiNiNiNiNNNiyNyiqyNyqyyyyIyIcIcIAcAsAsAAAseKeKmkmkmkQmEEQEoaEaoRoFRRFtfttftlPtllppxpxpbpbbrbrrbrzrdddddOdOOdOOwOwwOGOGwGGGGwCGGCGCCvCvCMMCMhMBChM",
-"iNNiiNiiNiNNiNiNyiyNyNyNyyqyqyyqIqycIcIcIsIsAsAAseK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dOOOOwOOwOwO#wO#wGGwCGGGCGCGCCvCMCMCMMMChBChMMBhBMBBuBBB",
"EaoEoEoQoEoQoEoEoooEaEoQaoEoaoaoaoaoRFoRFRRRFtRtRttfttftltPltlPlPllpxppxpxbpbbbHbrbrrrzrrdrOrdOdOdOdOjOOwOjwOwwGGwGwGGG#GCGCGCCGCCvCMCMChMMMMBhBMBMBuuBBuL",
"oQaoaoEaEoaEoaoaoaQaoaoaoaaoaaoRRoFFRFRFRFFFFtFtfFftftftlPlPlPlpppplpxxpbpbbHbrbrbrrzrzrdrddddddOdOOOOwOwOwwwwOGwGwG#CwCGGCGCvCCCGMCMCMMMMBCMMBMhBuBBBuBBB",
"oaoaQoaooaEaoQaooaoaoaoaoaoaoaFoaRFoaRFRFFRttRfttftftltfPltlllplllxpxpxpxbHbpHbrbrbrzrrdzddrdOdOdOOjOjOwOwO#OwGwGwGGGwGGGCGCGCCvCMCMCMMChMMMhBMMBMBuMBuBuL",
diff --git a/examples2/trolltech.bmp b/examples2/trolltech.bmp
index 220861e..9f399c7 100644
--- a/examples2/trolltech.bmp
+++ b/examples2/trolltech.bmp
Binary files differ
diff --git a/examples2/trolltech.gif b/examples2/trolltech.gif
index f674369..7b0b8c9 100644
--- a/examples2/trolltech.gif
+++ b/examples2/trolltech.gif
Binary files differ
diff --git a/examples2/tt-logo.png b/examples2/tt-logo.png
index a0d9e34..1e51bfe 100644
--- a/examples2/tt-logo.png
+++ b/examples2/tt-logo.png
Binary files differ
diff --git a/examples2/tut1.py b/examples2/tut1.py
index 2eca8c5..43649bf 100755
--- a/examples2/tut1.py
+++ b/examples2/tut1.py
@@ -1,14 +1,14 @@
#!/usr/bin/env python
-# Qt tutorial 1.
+# TQt tutorial 1.
import sys
from qt import *
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
-hello = QPushButton("Hello world!",None)
+hello = TQPushButton("Hello world!",None)
hello.resize(100,30)
a.setMainWidget(hello)
diff --git a/examples2/tut10.py b/examples2/tut10.py
index 0470a85..c852626 100755
--- a/examples2/tut10.py
+++ b/examples2/tut10.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
-# Qt tutorial 10.
+# TQt tutorial 10.
import sys
from qt import *
-class LCDRange(QVBox):
+class LCDRange(TQVBox):
def __init__(self,parent=None,name=None):
- QVBox.__init__(self,parent,name)
+ TQVBox.__init__(self,parent,name)
- lcd = QLCDNumber(2,self,'lcd')
- self.slider = QSlider(Qt.Horizontal,self,'slider')
+ lcd = TQLCDNumber(2,self,'lcd')
+ self.slider = TQSlider(TQt.Horizontal,self,'slider')
self.slider.setRange(0,99)
self.slider.setValue(0)
self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)'))
@@ -31,13 +31,13 @@ class LCDRange(QVBox):
self.slider.setRange(minVal,maxVal)
-class CannonField(QWidget):
+class CannonField(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
self.ang = 45
self.f = 0
- self.setPalette(QPalette(QColor(250,250,200)))
+ self.setPalette(TQPalette(TQColor(250,250,200)))
def angle(self):
return self.ang
@@ -69,38 +69,38 @@ class CannonField(QWidget):
return
cr = self.cannonRect()
- pix = QPixmap(cr.size())
+ pix = TQPixmap(cr.size())
pix.fill(self,cr.topLeft())
- p = QPainter(pix)
+ p = TQPainter(pix)
- p.setBrush(Qt.blue)
- p.setPen(Qt.NoPen)
+ p.setBrush(TQt.blue)
+ p.setPen(TQt.NoPen)
p.translate(0,pix.height() - 1)
- p.drawPie(QRect(-35,-35,70,70),0,90 * 16)
+ p.drawPie(TQRect(-35,-35,70,70),0,90 * 16)
p.rotate(-self.ang)
- p.drawRect(QRect(33,-4,15,8))
+ p.drawRect(TQRect(33,-4,15,8))
p.end()
p.begin(self)
p.drawPixmap(cr.topLeft(),pix)
def cannonRect(self):
- r = QRect(0,0,50,50)
+ r = TQRect(0,0,50,50)
r.moveBottomLeft(self.rect().bottomLeft())
return r
def sizePolicy(self):
- return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding)
+ return TQSizePolicy(TQSizePolicy.Expanding,TQSizePolicy.Expanding)
-class MyWidget(QWidget):
+class MyWidget(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
- quit = QPushButton('&Quit',self,'quit')
- quit.setFont(QFont('Times',18,QFont.Bold))
+ quit = TQPushButton('&Quit',self,'quit')
+ quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.angle = LCDRange(self,'angle')
@@ -117,13 +117,13 @@ class MyWidget(QWidget):
self.connect(self.force,PYSIGNAL('valueChanged(int)'),self.cannonField.setForce)
self.connect(self.cannonField,PYSIGNAL('forceChanged(int)'),self.force.setValue)
- grid = QGridLayout(self,2,2,10)
+ grid = TQGridLayout(self,2,2,10)
grid.addWidget(quit,0,0)
grid.addWidget(self.cannonField,1,1)
grid.setColStretch(1,10)
- leftBox = QVBoxLayout()
+ leftBox = TQVBoxLayout()
grid.addLayout(leftBox,1,0)
@@ -135,8 +135,8 @@ class MyWidget(QWidget):
self.angle.setFocus()
-QApplication.setColorSpec(QApplication.CustomColor)
-a = QApplication(sys.argv)
+TQApplication.setColorSpec(TQApplication.CustomColor)
+a = TQApplication(sys.argv)
w = MyWidget()
w.setGeometry(100,100,500,355)
diff --git a/examples2/tut11.py b/examples2/tut11.py
index 32fb436..6d1dc67 100755
--- a/examples2/tut11.py
+++ b/examples2/tut11.py
@@ -1,18 +1,18 @@
#!/usr/bin/env python
-# Qt tutorial 11.
+# TQt tutorial 11.
import sys
import math
from qt import *
-class LCDRange(QVBox):
+class LCDRange(TQVBox):
def __init__(self,parent=None,name=None):
- QVBox.__init__(self,parent,name)
+ TQVBox.__init__(self,parent,name)
- lcd = QLCDNumber(2,self,'lcd')
- self.slider = QSlider(Qt.Horizontal,self,'slider')
+ lcd = TQLCDNumber(2,self,'lcd')
+ self.slider = TQSlider(TQt.Horizontal,self,'slider')
self.slider.setRange(0,99)
self.slider.setValue(0)
self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)'))
@@ -32,23 +32,23 @@ class LCDRange(QVBox):
self.slider.setRange(minVal,maxVal)
-class CannonField(QWidget):
+class CannonField(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
self.ang = 45
self.f = 0
self.timerCount = 0
- self.autoShootTimer = QTimer(self,'movement handler')
+ self.autoShootTimer = TQTimer(self,'movement handler')
self.connect(self.autoShootTimer,SIGNAL('timeout()'),self.moveShot)
self.shoot_ang = 0
self.shoot_f = 0
- self.setPalette(QPalette(QColor(250,250,200)))
+ self.setPalette(TQPalette(TQColor(250,250,200)))
- self.barrelRect = QRect(33,-4,15,8)
+ self.barrelRect = TQRect(33,-4,15,8)
def angle(self):
return self.ang
@@ -85,7 +85,7 @@ class CannonField(QWidget):
self.autoShootTimer.start(50)
def moveShot(self):
- r = QRegion(self.shotRect())
+ r = TQRegion(self.shotRect())
self.timerCount = self.timerCount + 1
shotR = self.shotRect()
@@ -93,13 +93,13 @@ class CannonField(QWidget):
if shotR.x() > self.width() or shotR.y() > self.height():
self.autoShootTimer.stop()
else:
- r = r.unite(QRegion(shotR))
+ r = r.unite(TQRegion(shotR))
self.repaint(r)
def paintEvent(self,ev):
updateR = ev.rect()
- p = QPainter(self)
+ p = TQPainter(self)
if updateR.intersects(self.cannonRect()):
self.paintCannon(p)
@@ -108,21 +108,21 @@ class CannonField(QWidget):
self.paintShot(p)
def paintShot(self,p):
- p.setBrush(Qt.black)
- p.setPen(Qt.NoPen)
+ p.setBrush(TQt.black)
+ p.setPen(TQt.NoPen)
p.drawRect(self.shotRect())
def paintCannon(self,p):
cr = self.cannonRect()
- pix = QPixmap(cr.size())
+ pix = TQPixmap(cr.size())
pix.fill(self,cr.topLeft())
- tmp = QPainter(pix)
- tmp.setBrush(Qt.blue)
- tmp.setPen(Qt.NoPen)
+ tmp = TQPainter(pix)
+ tmp.setBrush(TQt.blue)
+ tmp.setPen(TQt.NoPen)
tmp.translate(0,pix.height() - 1)
- tmp.drawPie(QRect(-35,-35,70,70),0,90 * 16)
+ tmp.drawPie(TQRect(-35,-35,70,70),0,90 * 16)
tmp.rotate(-self.ang)
tmp.drawRect(self.barrelRect)
tmp.end()
@@ -130,7 +130,7 @@ class CannonField(QWidget):
p.drawPixmap(cr.topLeft(),pix)
def cannonRect(self):
- r = QRect(0,0,50,50)
+ r = TQRect(0,0,50,50)
r.moveBottomLeft(self.rect().bottomLeft())
return r
@@ -148,20 +148,20 @@ class CannonField(QWidget):
x = x0 + velx * time
y = y0 + vely * time - 0.5 * gravity * time * time
- r = QRect(0,0,6,6)
- r.moveCenter(QPoint(x,self.height() - 1 - y))
+ r = TQRect(0,0,6,6)
+ r.moveCenter(TQPoint(x,self.height() - 1 - y))
return r
def sizePolicy(self):
- return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding)
+ return TQSizePolicy(TQSizePolicy.Expanding,TQSizePolicy.Expanding)
-class MyWidget(QWidget):
+class MyWidget(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
- quit = QPushButton('&Quit',self,'quit')
- quit.setFont(QFont('Times',18,QFont.Bold))
+ quit = TQPushButton('&Quit',self,'quit')
+ quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.angle = LCDRange(self,'angle')
@@ -178,22 +178,22 @@ class MyWidget(QWidget):
self.connect(self.force,PYSIGNAL('valueChanged(int)'),self.cannonField.setForce)
self.connect(self.cannonField,PYSIGNAL('forceChanged(int)'),self.force.setValue)
- shoot = QPushButton('&Shoot',self,'shoot')
- shoot.setFont(QFont('Times',18,QFont.Bold))
+ shoot = TQPushButton('&Shoot',self,'shoot')
+ shoot.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(shoot,SIGNAL('clicked()'),self.cannonField.shoot)
- grid = QGridLayout(self,2,2,10)
+ grid = TQGridLayout(self,2,2,10)
grid.addWidget(quit,0,0)
grid.addWidget(self.cannonField,1,1)
grid.setColStretch(1,10)
- leftBox = QVBoxLayout()
+ leftBox = TQVBoxLayout()
grid.addLayout(leftBox,1,0)
leftBox.addWidget(self.angle)
leftBox.addWidget(self.force)
- topBox = QHBoxLayout()
+ topBox = TQHBoxLayout()
grid.addLayout(topBox,0,1)
topBox.addWidget(shoot)
topBox.addStretch(1)
@@ -203,8 +203,8 @@ class MyWidget(QWidget):
self.angle.setFocus()
-QApplication.setColorSpec(QApplication.CustomColor)
-a = QApplication(sys.argv)
+TQApplication.setColorSpec(TQApplication.CustomColor)
+a = TQApplication(sys.argv)
w = MyWidget()
w.setGeometry(100,100,500,355)
diff --git a/examples2/tut12.py b/examples2/tut12.py
index 65490ca..e52af95 100755
--- a/examples2/tut12.py
+++ b/examples2/tut12.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# Qt tutorial 12.
+# TQt tutorial 12.
import sys
import math
@@ -8,17 +8,17 @@ import random
from qt import *
-class LCDRange(QVBox):
+class LCDRange(TQVBox):
def __init__(self,s=None,parent=None,name=None):
- QVBox.__init__(self,parent,name)
+ TQVBox.__init__(self,parent,name)
- lcd = QLCDNumber(2,self,'lcd')
- self.slider = QSlider(Qt.Horizontal,self,'slider')
+ lcd = TQLCDNumber(2,self,'lcd')
+ self.slider = TQSlider(TQt.Horizontal,self,'slider')
self.slider.setRange(0,99)
self.slider.setValue(0)
- self.label = QLabel(' ',self,'label')
- self.label.setAlignment(Qt.AlignCenter)
+ self.label = TQLabel(' ',self,'label')
+ self.label.setAlignment(TQt.AlignCenter)
self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)'))
self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)'))
@@ -46,24 +46,24 @@ class LCDRange(QVBox):
self.label.setText(s)
-class CannonField(QWidget):
+class CannonField(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
self.ang = 45
self.f = 0
self.timerCount = 0
- self.autoShootTimer = QTimer(self,'movement handler')
+ self.autoShootTimer = TQTimer(self,'movement handler')
self.connect(self.autoShootTimer,SIGNAL('timeout()'),self.moveShot)
self.shoot_ang = 0
self.shoot_f = 0
- self.target = QPoint(0,0)
+ self.target = TQPoint(0,0)
- self.setPalette(QPalette(QColor(250,250,200)))
+ self.setPalette(TQPalette(TQColor(250,250,200)))
- self.barrelRect = QRect(33,-4,15,8)
+ self.barrelRect = TQRect(33,-4,15,8)
self.newTarget()
@@ -102,12 +102,12 @@ class CannonField(QWidget):
self.autoShootTimer.start(50)
def newTarget(self):
- r = QRegion(self.targetRect())
- self.target = QPoint(random.randint(200,390),random.randint(10,265))
- self.repaint(r.unite(QRegion(self.targetRect())))
+ r = TQRegion(self.targetRect())
+ self.target = TQPoint(random.randint(200,390),random.randint(10,265))
+ self.repaint(r.unite(TQRegion(self.targetRect())))
def moveShot(self):
- r = QRegion(self.shotRect())
+ r = TQRegion(self.shotRect())
self.timerCount = self.timerCount + 1
shotR = self.shotRect()
@@ -119,13 +119,13 @@ class CannonField(QWidget):
self.autoShootTimer.stop()
self.emit(PYSIGNAL('missed()'),())
else:
- r = r.unite(QRegion(shotR))
+ r = r.unite(TQRegion(shotR))
self.repaint(r)
def paintEvent(self,ev):
updateR = ev.rect()
- p = QPainter(self)
+ p = TQPainter(self)
if updateR.intersects(self.cannonRect()):
self.paintCannon(p)
@@ -137,26 +137,26 @@ class CannonField(QWidget):
self.paintTarget(p)
def paintShot(self,p):
- p.setBrush(Qt.black)
- p.setPen(Qt.NoPen)
+ p.setBrush(TQt.black)
+ p.setPen(TQt.NoPen)
p.drawRect(self.shotRect())
def paintTarget(self,p):
- p.setBrush(Qt.red)
- p.setPen(Qt.black)
+ p.setBrush(TQt.red)
+ p.setPen(TQt.black)
p.drawRect(self.targetRect())
def paintCannon(self,p):
cr = self.cannonRect()
- pix = QPixmap(cr.size())
+ pix = TQPixmap(cr.size())
pix.fill(self,cr.topLeft())
- tmp = QPainter(pix)
- tmp.setBrush(Qt.blue)
- tmp.setPen(Qt.NoPen)
+ tmp = TQPainter(pix)
+ tmp.setBrush(TQt.blue)
+ tmp.setPen(TQt.NoPen)
tmp.translate(0,pix.height() - 1)
- tmp.drawPie(QRect(-35,-35,70,70),0,90 * 16)
+ tmp.drawPie(TQRect(-35,-35,70,70),0,90 * 16)
tmp.rotate(-self.ang)
tmp.drawRect(self.barrelRect)
tmp.end()
@@ -164,7 +164,7 @@ class CannonField(QWidget):
p.drawPixmap(cr.topLeft(),pix)
def cannonRect(self):
- r = QRect(0,0,50,50)
+ r = TQRect(0,0,50,50)
r.moveBottomLeft(self.rect().bottomLeft())
return r
@@ -182,25 +182,25 @@ class CannonField(QWidget):
x = x0 + velx * time
y = y0 + vely * time - 0.5 * gravity * time * time
- r = QRect(0,0,6,6)
- r.moveCenter(QPoint(x,self.height() - 1 - y))
+ r = TQRect(0,0,6,6)
+ r.moveCenter(TQPoint(x,self.height() - 1 - y))
return r
def targetRect(self):
- r = QRect(0,0,20,10)
- r.moveCenter(QPoint(self.target.x(),self.height() - 1 - self.target.y()))
+ r = TQRect(0,0,20,10)
+ r.moveCenter(TQPoint(self.target.x(),self.height() - 1 - self.target.y()))
return r
def sizePolicy(self):
- return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding)
+ return TQSizePolicy(TQSizePolicy.Expanding,TQSizePolicy.Expanding)
-class MyWidget(QWidget):
+class MyWidget(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
- quit = QPushButton('&Quit',self,'quit')
- quit.setFont(QFont('Times',18,QFont.Bold))
+ quit = TQPushButton('&Quit',self,'quit')
+ quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.angle = LCDRange('ANGLE',self,'angle')
@@ -217,22 +217,22 @@ class MyWidget(QWidget):
self.connect(self.force,PYSIGNAL('valueChanged(int)'),self.cannonField.setForce)
self.connect(self.cannonField,PYSIGNAL('forceChanged(int)'),self.force.setValue)
- shoot = QPushButton('&Shoot',self,'shoot')
- shoot.setFont(QFont('Times',18,QFont.Bold))
+ shoot = TQPushButton('&Shoot',self,'shoot')
+ shoot.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(shoot,SIGNAL('clicked()'),self.cannonField.shoot)
- grid = QGridLayout(self,2,2,10)
+ grid = TQGridLayout(self,2,2,10)
grid.addWidget(quit,0,0)
grid.addWidget(self.cannonField,1,1)
grid.setColStretch(1,10)
- leftBox = QVBoxLayout()
+ leftBox = TQVBoxLayout()
grid.addLayout(leftBox,1,0)
leftBox.addWidget(self.angle)
leftBox.addWidget(self.force)
- topBox = QHBoxLayout()
+ topBox = TQHBoxLayout()
grid.addLayout(topBox,0,1)
topBox.addWidget(shoot)
topBox.addStretch(1)
@@ -242,8 +242,8 @@ class MyWidget(QWidget):
self.angle.setFocus()
-QApplication.setColorSpec(QApplication.CustomColor)
-a = QApplication(sys.argv)
+TQApplication.setColorSpec(TQApplication.CustomColor)
+a = TQApplication(sys.argv)
w = MyWidget()
w.setGeometry(100,100,500,355)
diff --git a/examples2/tut13.py b/examples2/tut13.py
index 7231a7a..0ac9a00 100755
--- a/examples2/tut13.py
+++ b/examples2/tut13.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# Qt tutorial 13.
+# TQt tutorial 13.
import sys
import math
@@ -8,24 +8,24 @@ import random
from qt import *
-class LCDRange(QWidget):
+class LCDRange(TQWidget):
def __init__(self,s=None,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
- lcd = QLCDNumber(2,self,'lcd')
- self.slider = QSlider(Qt.Horizontal,self,'slider')
+ lcd = TQLCDNumber(2,self,'lcd')
+ self.slider = TQSlider(TQt.Horizontal,self,'slider')
self.slider.setRange(0,99)
self.slider.setValue(0)
- self.label = QLabel(' ',self,'label')
- self.label.setAlignment(Qt.AlignCenter)
+ self.label = TQLabel(' ',self,'label')
+ self.label.setAlignment(TQt.AlignCenter)
self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)'))
self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)'))
self.setFocusProxy(self.slider)
- l = QVBoxLayout(self)
+ l = TQVBoxLayout(self)
l.addWidget(lcd,1)
l.addWidget(self.slider)
l.addWidget(self.label)
@@ -51,25 +51,25 @@ class LCDRange(QWidget):
self.label.setText(s)
-class CannonField(QWidget):
+class CannonField(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
self.ang = 45
self.f = 0
self.timerCount = 0
- self.autoShootTimer = QTimer(self,'movement handler')
+ self.autoShootTimer = TQTimer(self,'movement handler')
self.connect(self.autoShootTimer,SIGNAL('timeout()'),self.moveShot)
self.shoot_ang = 0
self.shoot_f = 0
- self.target = QPoint(0,0)
+ self.target = TQPoint(0,0)
self.gameEnded = 0
- self.setPalette(QPalette(QColor(250,250,200)))
+ self.setPalette(TQPalette(TQColor(250,250,200)))
- self.barrelRect = QRect(33,-4,15,8)
+ self.barrelRect = TQRect(33,-4,15,8)
self.newTarget()
@@ -109,9 +109,9 @@ class CannonField(QWidget):
self.emit(PYSIGNAL('canShoot(bool)'),(0,))
def newTarget(self):
- r = QRegion(self.targetRect())
- self.target = QPoint(random.randint(200,390),random.randint(10,265))
- self.repaint(r.unite(QRegion(self.targetRect())))
+ r = TQRegion(self.targetRect())
+ self.target = TQPoint(random.randint(200,390),random.randint(10,265))
+ self.repaint(r.unite(TQRegion(self.targetRect())))
def gameOver(self):
return self.gameEnded
@@ -132,7 +132,7 @@ class CannonField(QWidget):
self.emit(PYSIGNAL('canShoot(bool)'),(1,))
def moveShot(self):
- r = QRegion(self.shotRect())
+ r = TQRegion(self.shotRect())
self.timerCount = self.timerCount + 1
shotR = self.shotRect()
@@ -146,18 +146,18 @@ class CannonField(QWidget):
self.emit(PYSIGNAL('missed()'),())
self.emit(PYSIGNAL('canShoot(bool)'),(1,))
else:
- r = r.unite(QRegion(shotR))
+ r = r.unite(TQRegion(shotR))
self.repaint(r)
def paintEvent(self,ev):
updateR = ev.rect()
- p = QPainter(self)
+ p = TQPainter(self)
if self.gameEnded:
- p.setPen(Qt.black)
- p.setFont(QFont('Courier',48,QFont.Bold))
- p.drawText(self.rect(),Qt.AlignCenter,'Game Over')
+ p.setPen(TQt.black)
+ p.setFont(TQFont('Courier',48,TQFont.Bold))
+ p.drawText(self.rect(),TQt.AlignCenter,'Game Over')
if updateR.intersects(self.cannonRect()):
self.paintCannon(p)
@@ -169,26 +169,26 @@ class CannonField(QWidget):
self.paintTarget(p)
def paintShot(self,p):
- p.setBrush(Qt.black)
- p.setPen(Qt.NoPen)
+ p.setBrush(TQt.black)
+ p.setPen(TQt.NoPen)
p.drawRect(self.shotRect())
def paintTarget(self,p):
- p.setBrush(Qt.red)
- p.setPen(Qt.black)
+ p.setBrush(TQt.red)
+ p.setPen(TQt.black)
p.drawRect(self.targetRect())
def paintCannon(self,p):
cr = self.cannonRect()
- pix = QPixmap(cr.size())
+ pix = TQPixmap(cr.size())
pix.fill(self,cr.topLeft())
- tmp = QPainter(pix)
- tmp.setBrush(Qt.blue)
- tmp.setPen(Qt.NoPen)
+ tmp = TQPainter(pix)
+ tmp.setBrush(TQt.blue)
+ tmp.setPen(TQt.NoPen)
tmp.translate(0,pix.height() - 1)
- tmp.drawPie(QRect(-35,-35,70,70),0,90 * 16)
+ tmp.drawPie(TQRect(-35,-35,70,70),0,90 * 16)
tmp.rotate(-self.ang)
tmp.drawRect(self.barrelRect)
tmp.end()
@@ -196,7 +196,7 @@ class CannonField(QWidget):
p.drawPixmap(cr.topLeft(),pix)
def cannonRect(self):
- r = QRect(0,0,50,50)
+ r = TQRect(0,0,50,50)
r.moveBottomLeft(self.rect().bottomLeft())
return r
@@ -214,28 +214,28 @@ class CannonField(QWidget):
x = x0 + velx * time
y = y0 + vely * time - 0.5 * gravity * time * time
- r = QRect(0,0,6,6)
- r.moveCenter(QPoint(x,self.height() - 1 - y))
+ r = TQRect(0,0,6,6)
+ r.moveCenter(TQPoint(x,self.height() - 1 - y))
return r
def targetRect(self):
- r = QRect(0,0,20,10)
- r.moveCenter(QPoint(self.target.x(),self.height() - 1 - self.target.y()))
+ r = TQRect(0,0,20,10)
+ r.moveCenter(TQPoint(self.target.x(),self.height() - 1 - self.target.y()))
return r
def isShooting(self):
return self.autoShootTimer.isActive()
def sizePolicy(self):
- return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding)
+ return TQSizePolicy(TQSizePolicy.Expanding,TQSizePolicy.Expanding)
-class GameBoard(QWidget):
+class GameBoard(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
- quit = QPushButton('&Quit',self,'quit')
- quit.setFont(QFont('Times',18,QFont.Bold))
+ quit = TQPushButton('&Quit',self,'quit')
+ quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.angle = LCDRange('ANGLE',self,'angle')
@@ -255,31 +255,31 @@ class GameBoard(QWidget):
self.connect(self.cannonField,PYSIGNAL('hit()'),self.hit)
self.connect(self.cannonField,PYSIGNAL('missed()'),self.missed)
- self.shoot = QPushButton('&Shoot',self,'shoot')
- self.shoot.setFont(QFont('Times',18,QFont.Bold))
+ self.shoot = TQPushButton('&Shoot',self,'shoot')
+ self.shoot.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(self.shoot,SIGNAL('clicked()'),self.fire)
self.connect(self.cannonField,PYSIGNAL('canShoot(bool)'),self.shoot,SLOT('setEnabled(bool)'))
- restart = QPushButton('&New Game',self,'newgame')
- restart.setFont(QFont('Times',18,QFont.Bold))
+ restart = TQPushButton('&New Game',self,'newgame')
+ restart.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(restart,SIGNAL('clicked()'),self.newGame)
- self.hits = QLCDNumber(2,self,'hits')
- self.shotsLeft = QLCDNumber(2,self,'shotsleft')
- hitsL = QLabel('HITS',self,'hitsLabel')
- shotsLeftL = QLabel('SHOTS LEFT',self,'shotsleftLabel')
+ self.hits = TQLCDNumber(2,self,'hits')
+ self.shotsLeft = TQLCDNumber(2,self,'shotsleft')
+ hitsL = TQLabel('HITS',self,'hitsLabel')
+ shotsLeftL = TQLabel('SHOTS LEFT',self,'shotsleftLabel')
- grid = QGridLayout(self,2,2,10)
+ grid = TQGridLayout(self,2,2,10)
grid.addWidget(quit,0,0)
grid.addWidget(self.cannonField,1,1)
grid.setColStretch(1,10)
- leftBox = QVBoxLayout()
+ leftBox = TQVBoxLayout()
grid.addLayout(leftBox,1,0)
leftBox.addWidget(self.angle)
leftBox.addWidget(self.force)
- topBox = QHBoxLayout()
+ topBox = TQHBoxLayout()
grid.addLayout(topBox,0,1)
topBox.addWidget(self.shoot)
topBox.addWidget(self.hits)
@@ -319,8 +319,8 @@ class GameBoard(QWidget):
self.cannonField.newTarget()
-QApplication.setColorSpec(QApplication.CustomColor)
-a = QApplication(sys.argv)
+TQApplication.setColorSpec(TQApplication.CustomColor)
+a = TQApplication(sys.argv)
gb = GameBoard()
gb.setGeometry(100,100,500,355)
diff --git a/examples2/tut14.py b/examples2/tut14.py
index aeb4ca6..8a75538 100755
--- a/examples2/tut14.py
+++ b/examples2/tut14.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# Qt tutorial 14.
+# TQt tutorial 14.
import sys
import math
@@ -8,24 +8,24 @@ import random
from qt import *
-class LCDRange(QWidget):
+class LCDRange(TQWidget):
def __init__(self,s=None,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
- lcd = QLCDNumber(2,self,'lcd')
- self.slider = QSlider(Qt.Horizontal,self,'slider')
+ lcd = TQLCDNumber(2,self,'lcd')
+ self.slider = TQSlider(TQt.Horizontal,self,'slider')
self.slider.setRange(0,99)
self.slider.setValue(0)
- self.label = QLabel(' ',self,'label')
- self.label.setAlignment(Qt.AlignCenter)
+ self.label = TQLabel(' ',self,'label')
+ self.label.setAlignment(TQt.AlignCenter)
self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)'))
self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)'))
self.setFocusProxy(self.slider)
- l = QVBoxLayout(self)
+ l = TQVBoxLayout(self)
l.addWidget(lcd,1)
l.addWidget(self.slider)
l.addWidget(self.label)
@@ -51,26 +51,26 @@ class LCDRange(QWidget):
self.label.setText(s)
-class CannonField(QWidget):
+class CannonField(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
self.ang = 45
self.f = 0
self.timerCount = 0
- self.autoShootTimer = QTimer(self,'movement handler')
+ self.autoShootTimer = TQTimer(self,'movement handler')
self.connect(self.autoShootTimer,SIGNAL('timeout()'),self.moveShot)
self.shoot_ang = 0
self.shoot_f = 0
- self.target = QPoint(0,0)
+ self.target = TQPoint(0,0)
self.gameEnded = 0
self.barrelPressed = 0
- self.setPalette(QPalette(QColor(250,250,200)))
+ self.setPalette(TQPalette(TQColor(250,250,200)))
- self.barrelRect = QRect(33,-4,15,8)
+ self.barrelRect = TQRect(33,-4,15,8)
self.newTarget()
@@ -110,9 +110,9 @@ class CannonField(QWidget):
self.emit(PYSIGNAL('canShoot(bool)'),(0,))
def newTarget(self):
- r = QRegion(self.targetRect())
- self.target = QPoint(random.randint(200,390),random.randint(10,265))
- self.repaint(r.unite(QRegion(self.targetRect())))
+ r = TQRegion(self.targetRect())
+ self.target = TQPoint(random.randint(200,390),random.randint(10,265))
+ self.repaint(r.unite(TQRegion(self.targetRect())))
def gameOver(self):
return self.gameEnded
@@ -133,7 +133,7 @@ class CannonField(QWidget):
self.emit(PYSIGNAL('canShoot(bool)'),(1,))
def moveShot(self):
- r = QRegion(self.shotRect())
+ r = TQRegion(self.shotRect())
self.timerCount = self.timerCount + 1
shotR = self.shotRect()
@@ -147,12 +147,12 @@ class CannonField(QWidget):
self.emit(PYSIGNAL('missed()'),())
self.emit(PYSIGNAL('canShoot(bool)'),(1,))
else:
- r = r.unite(QRegion(shotR))
+ r = r.unite(TQRegion(shotR))
self.repaint(r)
def mousePressEvent(self,ev):
- if ev.button() != Qt.LeftButton:
+ if ev.button() != TQt.LeftButton:
return
if self.barrelHit(ev.pos()):
self.barrelPressed = 1
@@ -169,17 +169,17 @@ class CannonField(QWidget):
self.setAngle(int(round(rad * 180 / math.pi)))
def mouseReleaseEvent(self,ev):
- if ev.button() == Qt.LeftButton:
+ if ev.button() == TQt.LeftButton:
self.barrelPressed = 0
def paintEvent(self,ev):
updateR = ev.rect()
- p = QPainter(self)
+ p = TQPainter(self)
if self.gameEnded:
- p.setPen(Qt.black)
- p.setFont(QFont('Courier',48,QFont.Bold))
- p.drawText(self.rect(),Qt.AlignCenter,'Game Over')
+ p.setPen(TQt.black)
+ p.setFont(TQFont('Courier',48,TQFont.Bold))
+ p.drawText(self.rect(),TQt.AlignCenter,'Game Over')
if updateR.intersects(self.cannonRect()):
self.paintCannon(p)
@@ -194,31 +194,31 @@ class CannonField(QWidget):
self.paintTarget(p)
def paintShot(self,p):
- p.setBrush(Qt.black)
- p.setPen(Qt.NoPen)
+ p.setBrush(TQt.black)
+ p.setPen(TQt.NoPen)
p.drawRect(self.shotRect())
def paintTarget(self,p):
- p.setBrush(Qt.red)
- p.setPen(Qt.black)
+ p.setBrush(TQt.red)
+ p.setPen(TQt.black)
p.drawRect(self.targetRect())
def paintBarrier(self,p):
- p.setBrush(Qt.yellow)
- p.setPen(Qt.black)
+ p.setBrush(TQt.yellow)
+ p.setPen(TQt.black)
p.drawRect(self.barrierRect())
def paintCannon(self,p):
cr = self.cannonRect()
- pix = QPixmap(cr.size())
+ pix = TQPixmap(cr.size())
pix.fill(self,cr.topLeft())
- tmp = QPainter(pix)
- tmp.setBrush(Qt.blue)
- tmp.setPen(Qt.NoPen)
+ tmp = TQPainter(pix)
+ tmp.setBrush(TQt.blue)
+ tmp.setPen(TQt.NoPen)
tmp.translate(0,pix.height() - 1)
- tmp.drawPie(QRect(-35,-35,70,70),0,90 * 16)
+ tmp.drawPie(TQRect(-35,-35,70,70),0,90 * 16)
tmp.rotate(-self.ang)
tmp.drawRect(self.barrelRect)
tmp.end()
@@ -226,7 +226,7 @@ class CannonField(QWidget):
p.drawPixmap(cr.topLeft(),pix)
def cannonRect(self):
- r = QRect(0,0,50,50)
+ r = TQRect(0,0,50,50)
r.moveBottomLeft(self.rect().bottomLeft())
return r
@@ -244,20 +244,20 @@ class CannonField(QWidget):
x = x0 + velx * time
y = y0 + vely * time - 0.5 * gravity * time * time
- r = QRect(0,0,6,6)
- r.moveCenter(QPoint(x,self.height() - 1 - y))
+ r = TQRect(0,0,6,6)
+ r.moveCenter(TQPoint(x,self.height() - 1 - y))
return r
def targetRect(self):
- r = QRect(0,0,20,10)
- r.moveCenter(QPoint(self.target.x(),self.height() - 1 - self.target.y()))
+ r = TQRect(0,0,20,10)
+ r.moveCenter(TQPoint(self.target.x(),self.height() - 1 - self.target.y()))
return r
def barrierRect(self):
- return QRect(145,self.height() - 100,15,100)
+ return TQRect(145,self.height() - 100,15,100)
def barrelHit(self,p):
- mtx = QWMatrix()
+ mtx = TQWMatrix()
mtx.translate(0,self.height() - 1)
mtx.rotate(-self.ang)
(mtx, invertable) = mtx.invert()
@@ -267,15 +267,15 @@ class CannonField(QWidget):
return self.autoShootTimer.isActive()
def sizePolicy(self):
- return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding)
+ return TQSizePolicy(TQSizePolicy.Expanding,TQSizePolicy.Expanding)
-class GameBoard(QWidget):
+class GameBoard(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
- quit = QPushButton('&Quit',self,'quit')
- quit.setFont(QFont('Times',18,QFont.Bold))
+ quit = TQPushButton('&Quit',self,'quit')
+ quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.angle = LCDRange('ANGLE',self,'angle')
@@ -284,8 +284,8 @@ class GameBoard(QWidget):
self.force = LCDRange('FORCE',self,'force')
self.force.setRange(10,50)
- box = QVBox(self,'cannonFrame')
- box.setFrameStyle(QFrame.WinPanel | QFrame.Sunken)
+ box = TQVBox(self,'cannonFrame')
+ box.setFrameStyle(TQFrame.WinPanel | TQFrame.Sunken)
self.cannonField = CannonField(box,'cannonField')
@@ -298,36 +298,36 @@ class GameBoard(QWidget):
self.connect(self.cannonField,PYSIGNAL('hit()'),self.hit)
self.connect(self.cannonField,PYSIGNAL('missed()'),self.missed)
- self.shoot = QPushButton('&Shoot',self,'shoot')
- self.shoot.setFont(QFont('Times',18,QFont.Bold))
+ self.shoot = TQPushButton('&Shoot',self,'shoot')
+ self.shoot.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(self.shoot,SIGNAL('clicked()'),self.fire)
self.connect(self.cannonField,PYSIGNAL('canShoot(bool)'),self.shoot,SLOT('setEnabled(bool)'))
- restart = QPushButton('&New Game',self,'newgame')
- restart.setFont(QFont('Times',18,QFont.Bold))
+ restart = TQPushButton('&New Game',self,'newgame')
+ restart.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(restart,SIGNAL('clicked()'),self.newGame)
- self.hits = QLCDNumber(2,self,'hits')
- self.shotsLeft = QLCDNumber(2,self,'shotsleft')
- hitsL = QLabel('HITS',self,'hitsLabel')
- shotsLeftL = QLabel('SHOTS LEFT',self,'shotsleftLabel')
+ self.hits = TQLCDNumber(2,self,'hits')
+ self.shotsLeft = TQLCDNumber(2,self,'shotsleft')
+ hitsL = TQLabel('HITS',self,'hitsLabel')
+ shotsLeftL = TQLabel('SHOTS LEFT',self,'shotsleftLabel')
- accel = QAccel(self)
- accel.connectItem(accel.insertItem(Qt.Key_Enter),self.fire)
- accel.connectItem(accel.insertItem(Qt.Key_Return),self.fire)
- accel.connectItem(accel.insertItem(Qt.CTRL + Qt.Key_Q),qApp,SLOT('quit()'))
+ accel = TQAccel(self)
+ accel.connectItem(accel.insertItem(TQt.Key_Enter),self.fire)
+ accel.connectItem(accel.insertItem(TQt.Key_Return),self.fire)
+ accel.connectItem(accel.insertItem(TQt.CTRL + TQt.Key_Q),qApp,SLOT('quit()'))
- grid = QGridLayout(self,2,2,10)
+ grid = TQGridLayout(self,2,2,10)
grid.addWidget(quit,0,0)
grid.addWidget(box,1,1)
grid.setColStretch(1,10)
- leftBox = QVBoxLayout()
+ leftBox = TQVBoxLayout()
grid.addLayout(leftBox,1,0)
leftBox.addWidget(self.angle)
leftBox.addWidget(self.force)
- topBox = QHBoxLayout()
+ topBox = TQHBoxLayout()
grid.addLayout(topBox,0,1)
topBox.addWidget(self.shoot)
topBox.addWidget(self.hits)
@@ -367,8 +367,8 @@ class GameBoard(QWidget):
self.cannonField.newTarget()
-QApplication.setColorSpec(QApplication.CustomColor)
-a = QApplication(sys.argv)
+TQApplication.setColorSpec(TQApplication.CustomColor)
+a = TQApplication(sys.argv)
gb = GameBoard()
gb.setGeometry(100,100,500,355)
diff --git a/examples2/tut2.py b/examples2/tut2.py
index a31b784..48ddb89 100755
--- a/examples2/tut2.py
+++ b/examples2/tut2.py
@@ -1,18 +1,18 @@
#!/usr/bin/env python
-# Qt tutorial 2.
+# TQt tutorial 2.
import sys
from qt import *
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
-quit = QPushButton("Quit",None)
+quit = TQPushButton("Quit",None)
quit.resize(75,30)
-quit.setFont(QFont("Times",18,QFont.Bold))
+quit.setFont(TQFont("Times",18,TQFont.Bold))
-QObject.connect(quit,SIGNAL("clicked()"),a,SLOT("quit()"))
+TQObject.connect(quit,SIGNAL("clicked()"),a,SLOT("quit()"))
a.setMainWidget(quit)
quit.show()
diff --git a/examples2/tut3.py b/examples2/tut3.py
index 2cc3576..5284840 100755
--- a/examples2/tut3.py
+++ b/examples2/tut3.py
@@ -1,19 +1,19 @@
#!/usr/bin/env python
-# Qt tutorial 3.
+# TQt tutorial 3.
import sys
from qt import *
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
-box = QVBox()
+box = TQVBox()
box.resize(200,120)
-quit = QPushButton("Quit",box)
-quit.setFont(QFont("Times",18,QFont.Bold))
+quit = TQPushButton("Quit",box)
+quit.setFont(TQFont("Times",18,TQFont.Bold))
-QObject.connect(quit,SIGNAL("clicked()"),a,SLOT("quit()"))
+TQObject.connect(quit,SIGNAL("clicked()"),a,SLOT("quit()"))
a.setMainWidget(box)
box.show()
diff --git a/examples2/tut4.py b/examples2/tut4.py
index 23c44d0..7cafd36 100755
--- a/examples2/tut4.py
+++ b/examples2/tut4.py
@@ -1,26 +1,26 @@
#!/usr/bin/env python
-# Qt tutorial 4.
+# TQt tutorial 4.
import sys
from qt import *
-class MyWidget(QWidget):
+class MyWidget(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
self.setMinimumSize(200,120)
self.setMaximumSize(200,120)
- quit = QPushButton("Quit",self,"quit")
+ quit = TQPushButton("Quit",self,"quit")
quit.setGeometry(62,40,75,30)
- quit.setFont(QFont("Times",18,QFont.Bold))
+ quit.setFont(TQFont("Times",18,TQFont.Bold))
self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()"))
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
w = MyWidget()
w.setGeometry(100,100,200,120)
diff --git a/examples2/tut5.py b/examples2/tut5.py
index 01c20aa..e7662fb 100755
--- a/examples2/tut5.py
+++ b/examples2/tut5.py
@@ -1,30 +1,30 @@
#!/usr/bin/env python
-# Qt tutorial 5.
+# TQt tutorial 5.
import sys
from qt import *
-class MyWidget(QVBox):
+class MyWidget(TQVBox):
def __init__(self,parent=None,name=None):
- QVBox.__init__(self,parent,name)
+ TQVBox.__init__(self,parent,name)
- quit = QPushButton("Quit",self,"quit")
- quit.setFont(QFont("Times",18,QFont.Bold))
+ quit = TQPushButton("Quit",self,"quit")
+ quit.setFont(TQFont("Times",18,TQFont.Bold))
self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()"))
- lcd = QLCDNumber(2,self,"lcd")
+ lcd = TQLCDNumber(2,self,"lcd")
- slider = QSlider(Qt.Horizontal,self,"slider")
+ slider = TQSlider(TQt.Horizontal,self,"slider")
slider.setRange(0,99)
slider.setValue(0)
self.connect(slider,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)"))
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
w = MyWidget()
a.setMainWidget(w)
diff --git a/examples2/tut6.py b/examples2/tut6.py
index 38f07d8..3108345 100755
--- a/examples2/tut6.py
+++ b/examples2/tut6.py
@@ -1,39 +1,39 @@
#!/usr/bin/env python
-# Qt tutorial 6.
+# TQt tutorial 6.
import sys
from qt import *
-class LCDRange(QVBox):
+class LCDRange(TQVBox):
def __init__(self,parent=None,name=None):
- QVBox.__init__(self,parent,name)
+ TQVBox.__init__(self,parent,name)
- lcd = QLCDNumber(2,self,"lcd")
- slider = QSlider(Qt.Horizontal,self,"slider")
+ lcd = TQLCDNumber(2,self,"lcd")
+ slider = TQSlider(TQt.Horizontal,self,"slider")
slider.setRange(0,99)
slider.setValue(0)
self.connect(slider,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)"))
-class MyWidget(QVBox):
+class MyWidget(TQVBox):
def __init__(self,parent=None,name=None):
- QVBox.__init__(self,parent,name)
+ TQVBox.__init__(self,parent,name)
- quit = QPushButton("Quit",self,"quit")
- quit.setFont(QFont("Times",18,QFont.Bold))
+ quit = TQPushButton("Quit",self,"quit")
+ quit.setFont(TQFont("Times",18,TQFont.Bold))
self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()"))
- grid = QGrid(4,self)
+ grid = TQGrid(4,self)
for c in range(4):
for r in range(4):
LCDRange(grid)
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
w = MyWidget()
a.setMainWidget(w)
diff --git a/examples2/tut7.py b/examples2/tut7.py
index d40ae74..2c03e89 100755
--- a/examples2/tut7.py
+++ b/examples2/tut7.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
-# Qt tutorial 7.
+# TQt tutorial 7.
import sys
from qt import *
-class LCDRange(QVBox):
+class LCDRange(TQVBox):
def __init__(self,parent=None,name=None):
- QVBox.__init__(self,parent,name)
+ TQVBox.__init__(self,parent,name)
- lcd = QLCDNumber(2,self,'lcd')
- self.slider = QSlider(Qt.Horizontal,self,'slider')
+ lcd = TQLCDNumber(2,self,'lcd')
+ self.slider = TQSlider(TQt.Horizontal,self,'slider')
self.slider.setRange(0,99)
self.slider.setValue(0)
self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)'))
@@ -24,16 +24,16 @@ class LCDRange(QVBox):
self.slider.setValue(value)
-class MyWidget(QVBox):
+class MyWidget(TQVBox):
def __init__(self,parent=None,name=None):
- QVBox.__init__(self,parent,name)
+ TQVBox.__init__(self,parent,name)
- quit = QPushButton("Quit",self,"quit")
- quit.setFont(QFont("Times",18,QFont.Bold))
+ quit = TQPushButton("Quit",self,"quit")
+ quit.setFont(TQFont("Times",18,TQFont.Bold))
self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()"))
- grid = QGrid(4,self)
+ grid = TQGrid(4,self)
self.lcdlist = []
previous = None
@@ -49,7 +49,7 @@ class MyWidget(QVBox):
self.lcdlist.append(lr)
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
w = MyWidget()
a.setMainWidget(w)
diff --git a/examples2/tut8.py b/examples2/tut8.py
index 045a4ef..2c16d22 100755
--- a/examples2/tut8.py
+++ b/examples2/tut8.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
-# Qt tutorial 8.
+# TQt tutorial 8.
import sys
from qt import *
-class LCDRange(QVBox):
+class LCDRange(TQVBox):
def __init__(self,parent=None,name=None):
- QVBox.__init__(self,parent,name)
+ TQVBox.__init__(self,parent,name)
- lcd = QLCDNumber(2,self,'lcd')
- self.slider = QSlider(Qt.Horizontal,self,'slider')
+ lcd = TQLCDNumber(2,self,'lcd')
+ self.slider = TQSlider(TQt.Horizontal,self,'slider')
self.slider.setRange(0,99)
self.slider.setValue(0)
self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)'))
@@ -31,12 +31,12 @@ class LCDRange(QVBox):
self.slider.setRange(minVal,maxVal)
-class CannonField(QWidget):
+class CannonField(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
self.ang = 45
- self.setPalette(QPalette(QColor(250,250,200)))
+ self.setPalette(TQPalette(TQColor(250,250,200)))
def angle(self):
return self.ang
@@ -53,19 +53,19 @@ class CannonField(QWidget):
self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,))
def paintEvent(self,ev):
- p = QPainter(self)
+ p = TQPainter(self)
p.drawText(200,200,'Angle = %d' % (self.ang))
def sizePolicy(self):
- return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding)
+ return TQSizePolicy(TQSizePolicy.Expanding,TQSizePolicy.Expanding)
-class MyWidget(QWidget):
+class MyWidget(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
- quit = QPushButton('Quit',self,'quit')
- quit.setFont(QFont('Times',18,QFont.Bold))
+ quit = TQPushButton('Quit',self,'quit')
+ quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.angle = LCDRange(self,'angle')
@@ -76,10 +76,10 @@ class MyWidget(QWidget):
self.connect(self.angle,PYSIGNAL('valueChanged(int)'),self.cannonField.setAngle)
self.connect(self.cannonField,PYSIGNAL('angleChanged(int)'),self.angle.setValue)
- grid = QGridLayout(self,2,2,10)
+ grid = TQGridLayout(self,2,2,10)
grid.addWidget(quit,0,0)
- grid.addWidget(self.angle,1,0,Qt.AlignTop)
+ grid.addWidget(self.angle,1,0,TQt.AlignTop)
grid.addWidget(self.cannonField,1,1)
grid.setColStretch(1,10)
@@ -87,7 +87,7 @@ class MyWidget(QWidget):
self.angle.setFocus()
-a = QApplication(sys.argv)
+a = TQApplication(sys.argv)
w = MyWidget()
w.setGeometry(100,100,500,355)
diff --git a/examples2/tut9.py b/examples2/tut9.py
index 16c7d69..fdcd9f0 100755
--- a/examples2/tut9.py
+++ b/examples2/tut9.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
-# Qt tutorial 9.
+# TQt tutorial 9.
import sys
from qt import *
-class LCDRange(QVBox):
+class LCDRange(TQVBox):
def __init__(self,parent=None,name=None):
- QVBox.__init__(self,parent,name)
+ TQVBox.__init__(self,parent,name)
- lcd = QLCDNumber(2,self,'lcd')
- self.slider = QSlider(Qt.Horizontal,self,'slider')
+ lcd = TQLCDNumber(2,self,'lcd')
+ self.slider = TQSlider(TQt.Horizontal,self,'slider')
self.slider.setRange(0,99)
self.slider.setValue(0)
self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)'))
@@ -31,12 +31,12 @@ class LCDRange(QVBox):
self.slider.setRange(minVal,maxVal)
-class CannonField(QWidget):
+class CannonField(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
self.ang = 45
- self.setPalette(QPalette(QColor(250,250,200)))
+ self.setPalette(TQPalette(TQColor(250,250,200)))
def angle(self):
return self.ang
@@ -53,26 +53,26 @@ class CannonField(QWidget):
self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,))
def paintEvent(self,ev):
- p = QPainter(self)
+ p = TQPainter(self)
- p.setBrush(Qt.blue)
- p.setPen(Qt.NoPen)
+ p.setBrush(TQt.blue)
+ p.setPen(TQt.NoPen)
p.translate(0,self.rect().bottom())
- p.drawPie(QRect(-35,-35,70,70),0,90 * 16)
+ p.drawPie(TQRect(-35,-35,70,70),0,90 * 16)
p.rotate(-self.ang)
- p.drawRect(QRect(33,-4,15,8))
+ p.drawRect(TQRect(33,-4,15,8))
def sizePolicy(self):
- return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding)
+ return TQSizePolicy(TQSizePolicy.Expanding,TQSizePolicy.Expanding)
-class MyWidget(QWidget):
+class MyWidget(TQWidget):
def __init__(self,parent=None,name=None):
- QWidget.__init__(self,parent,name)
+ TQWidget.__init__(self,parent,name)
- quit = QPushButton('&Quit',self,'quit')
- quit.setFont(QFont('Times',18,QFont.Bold))
+ quit = TQPushButton('&Quit',self,'quit')
+ quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.angle = LCDRange(self,'angle')
@@ -83,10 +83,10 @@ class MyWidget(QWidget):
self.connect(self.angle,PYSIGNAL('valueChanged(int)'),self.cannonField.setAngle)
self.connect(self.cannonField,PYSIGNAL('angleChanged(int)'),self.angle.setValue)
- grid = QGridLayout(self,2,2,10)
+ grid = TQGridLayout(self,2,2,10)
grid.addWidget(quit,0,0)
- grid.addWidget(self.angle,1,0,Qt.AlignTop)
+ grid.addWidget(self.angle,1,0,TQt.AlignTop)
grid.addWidget(self.cannonField,1,1)
grid.setColStretch(1,10)
@@ -94,8 +94,8 @@ class MyWidget(QWidget):
self.angle.setFocus()
-QApplication.setColorSpec(QApplication.CustomColor)
-a = QApplication(sys.argv)
+TQApplication.setColorSpec(TQApplication.CustomColor)
+a = TQApplication(sys.argv)
w = MyWidget()
w.setGeometry(100,100,500,355)
diff --git a/examples2/widgets.py b/examples2/widgets.py
index 7b85ab3..59d9249 100755
--- a/examples2/widgets.py
+++ b/examples2/widgets.py
@@ -5,31 +5,31 @@ import sys, string
from qt import *
#
-## Constructs an analog clock widget that uses an internal QTimer.
+## Constructs an analog clock widget that uses an internal TQTimer.
#
-def QMIN( x, y ):
+def TQMIN( x, y ):
if y > x:
return y
return x
#
-## Constructs an analog clock widget that uses an internal QTimer.
+## Constructs an analog clock widget that uses an internal TQTimer.
#
-class AnalogClock( QWidget ):
+class AnalogClock( TQWidget ):
def __init__( self, *args ):
- apply( QWidget.__init__, (self,) + args )
- self.time = QTime.currentTime() # get current time
- internalTimer = QTimer( self ) # create internal timer
+ apply( TQWidget.__init__, (self,) + args )
+ self.time = TQTime.currentTime() # get current time
+ internalTimer = TQTimer( self ) # create internal timer
self.connect( internalTimer, SIGNAL("timeout()"), self.timeout )
internalTimer.start( 5000 ) # emit signal every 5 seconds
#
-## The QTimer::timeout() signal is received by this slot.
+## The TQTimer::timeout() signal is received by this slot.
#
def timeout( self ):
- new_time = QTime.currentTime() # get the current time
+ new_time = TQTime.currentTime() # get the current time
if new_time.minute() != self.time.minute(): # minute has changed
self.update()
@@ -39,16 +39,16 @@ class AnalogClock( QWidget ):
def paintEvent( self, qe ): # paint clock
if not self.isVisible(): # is is invisible
return
- self.time = QTime.currentTime() # save current time
+ self.time = TQTime.currentTime() # save current time
- pts = QPointArray()
- paint = QPainter( self )
+ pts = TQPointArray()
+ paint = TQPainter( self )
paint.setBrush( self.foregroundColor() ) # fill with foreground color
- cp = QPoint( self.rect().center() ) # widget center point
- d = QMIN( self.width(), self.height() ) # we want a circular clock
+ cp = TQPoint( self.rect().center() ) # widget center point
+ d = TQMIN( self.width(), self.height() ) # we want a circular clock
- matrix = QWMatrix() # setup transformation matrix
+ matrix = TQWMatrix() # setup transformation matrix
matrix.translate( cp.x(), cp.y() ) # origin at widget center
matrix.scale( d / 1000.0, d / 1000.0 ) # scale coordinate system
@@ -72,11 +72,11 @@ class AnalogClock( QWidget ):
matrix.rotate( 30 )
-class DigitalClock( QLCDNumber ):
+class DigitalClock( TQLCDNumber ):
def __init__( self, *args ):
- apply( QLCDNumber.__init__,(self,) + args )
+ apply( TQLCDNumber.__init__,(self,) + args )
self.showingColon = 0
- self.setFrameStyle(QFrame.Panel | QFrame.Raised)
+ self.setFrameStyle(TQFrame.Panel | TQFrame.Raised)
self.setLineWidth( 2 )
self.showTime()
self.normalTimer = self.startTimer( 500 )
@@ -90,13 +90,13 @@ class DigitalClock( QLCDNumber ):
self.showTime()
def mousePressEvent( self, e ):
- if e.button() == Qt.LeftButton:
+ if e.button() == TQt.LeftButton:
self.showDate()
def showDate( self ):
if self.showDateTimer != -1:
return
- d = QDate.currentDate()
+ d = TQDate.currentDate()
self.display('%2d %2d' % (d.month(), d.day()))
self.showDateTimer = self.startTimer(2000)
@@ -107,7 +107,7 @@ class DigitalClock( QLCDNumber ):
def showTime( self ):
self.showingColon = not self.showingColon
- s = list(str(QTime.currentTime().toString())[:5]) #.left(5)
+ s = list(str(TQTime.currentTime().toString())[:5]) #.left(5)
if not self.showingColon:
s[2] = ' '
if s[0] == '0':
@@ -115,7 +115,7 @@ class DigitalClock( QLCDNumber ):
s = string.join(s,'')
self.display( s )
- def QMIN( x, y ):
+ def TQMIN( x, y ):
if y > x:
return y
return x
@@ -125,43 +125,43 @@ FALSE = 0
MOVIEFILENAME = "trolltech.gif"
#
-# WidgetView contains lots of Qt widgets.
+# WidgetView contains lots of TQt widgets.
#
-class WidgetView ( QWidget ):
+class WidgetView ( TQWidget ):
def __init__( self, *args ):
- apply( QWidget.__init__, (self,) + args )
+ apply( TQWidget.__init__, (self,) + args )
# Set the window caption/title
- self.setCaption( "Qt Widgets Demo Application" )
+ self.setCaption( "TQt Widgets Demo Application" )
# Install an application-global event filter
qApp.installEventFilter( self )
# Create a layout to position the widgets
- self.topLayout = QVBoxLayout( self, 10 )
+ self.topLayout = TQVBoxLayout( self, 10 )
# Create a grid layout to hold most of the widgets
- self.grid = QGridLayout( 6, 3 )
+ self.grid = TQGridLayout( 6, 3 )
# This layout will get all of the stretch
self.topLayout.addLayout( self.grid, 10 )
# Create a menubar
- self.menubar = QMenuBar( self )
- #self.menubar.setSeparator( QMenuBar.InWindowsStyle )
+ self.menubar = TQMenuBar( self )
+ #self.menubar.setSeparator( TQMenuBar.InWindowsStyle )
self.menubar.setSeparator( 1 )
# Create an easter egg
- QToolTip.add( self.menubar, QRect( 0, 0, 2, 2 ), "easter egg" )
+ TQToolTip.add( self.menubar, TQRect( 0, 0, 2, 2 ), "easter egg" )
- self.popup = QPopupMenu()
+ self.popup = TQPopupMenu()
self.id = self.popup.insertItem( "&New" )
self.popup.setItemEnabled( self.id, FALSE )
self.id = self.popup.insertItem( "&Open" )
self.popup.setItemEnabled( self.id, FALSE )
self.popup.insertSeparator()
- self.popup.insertItem( "&Quit", qApp, SLOT("quit()"), Qt.CTRL+Qt.Key_Q )
+ self.popup.insertItem( "&Quit", qApp, SLOT("quit()"), TQt.CTRL+TQt.Key_Q )
self.menubar.insertItem( "&File", self.popup )
@@ -177,63 +177,63 @@ class WidgetView ( QWidget ):
self.grid.addWidget( self.dclock, 1, 2 )
# Give the dclock widget a blue palette
- col = QColor()
+ col = TQColor()
col.setRgb( 0xaa, 0xbe, 0xff )
- self.dclock.setPalette( QPalette( col ) )
+ self.dclock.setPalette( TQPalette( col ) )
# make tool tips for both of them
- QToolTip.add( self.aclock, "custom widget: analog clock" )
- QToolTip.add( self.dclock, "custom widget: digital clock" )
+ TQToolTip.add( self.aclock, "custom widget: analog clock" )
+ TQToolTip.add( self.dclock, "custom widget: digital clock" )
# Create a push button.
- self.pb = QPushButton( self, "button1" ) # create button 1
+ self.pb = TQPushButton( self, "button1" ) # create button 1
self.pb.setText( "Push button 1" )
self.pb.setFixedHeight( self.pb.sizeHint().height() )
- self.grid.addWidget( self.pb, 0, 0, Qt.AlignVCenter )
+ self.grid.addWidget( self.pb, 0, 0, TQt.AlignVCenter )
self.connect( self.pb, SIGNAL("clicked()"), self.button1Clicked )
- QToolTip.add( self.pb, "push button 1" )
- self.pm = QPixmap()
+ TQToolTip.add( self.pb, "push button 1" )
+ self.pm = TQPixmap()
self.pix = self.pm.load( "qt.png" ) # load pixmap for button 2
if not self.pix:
- QMessageBox.information( None, "Qt Widgets Example",
+ TQMessageBox.information( None, "TQt Widgets Example",
"Could not load the file \"qt.png\", which\n"
"contains an icon used...\n\n"
"The text \"line 42\" will be substituted.",
- QMessageBox.Ok + QMessageBox.Default )
+ TQMessageBox.Ok + TQMessageBox.Default )
- # Create a label containing a QMovie
- self.movielabel = QLabel( self, "label0" )
- self.movie = QMovie( MOVIEFILENAME )
+ # Create a label containing a TQMovie
+ self.movielabel = TQLabel( self, "label0" )
+ self.movie = TQMovie( MOVIEFILENAME )
self.movie.connectStatus( self.movieStatus )
self.movie.connectUpdate( self.movieUpdate )
- self.movielabel.setFrameStyle( QFrame.Box | QFrame.Plain )
+ self.movielabel.setFrameStyle( TQFrame.Box | TQFrame.Plain )
self.movielabel.setMovie( self.movie )
self.movielabel.setMargin( 0 )
self.movielabel.setFixedSize( 128 + self.movielabel.frameWidth() * 2,
64 + self.movielabel.frameWidth() * 2 )
- self.grid.addWidget( self.movielabel, 0, 1, Qt.AlignCenter )
- QToolTip.add( self.movielabel, "movie" )
+ self.grid.addWidget( self.movielabel, 0, 1, TQt.AlignCenter )
+ TQToolTip.add( self.movielabel, "movie" )
# Create a group of check boxes
- self.bg = QButtonGroup( self, "checkGroup" )
+ self.bg = TQButtonGroup( self, "checkGroup" )
self.bg.setTitle( "Check Boxes" )
self.grid.addWidget( self.bg, 1, 0 )
# Create a layout for the check boxes
- self.vbox = QVBoxLayout(self.bg, 10)
+ self.vbox = TQVBoxLayout(self.bg, 10)
self.vbox.addSpacing( self.bg.fontMetrics().height() )
self.cb = range(3)
- self.cb[0] = QCheckBox( self.bg )
+ self.cb[0] = TQCheckBox( self.bg )
self.cb[0].setText( "Read" )
self.vbox.addWidget( self.cb[0] )
self.cb[0].setMinimumSize( self.cb[0].sizeHint() )
- self.cb[1] = QCheckBox( self.bg )
+ self.cb[1] = TQCheckBox( self.bg )
self.cb[1].setText( "Write" )
self.vbox.addWidget( self.cb[1] )
self.cb[1].setMinimumSize( self.cb[1].sizeHint() )
- self.cb[2] = QCheckBox( self.bg )
+ self.cb[2] = TQCheckBox( self.bg )
self.cb[2].setText( "Execute" )
self.cb[2].setMinimumSize( self.cb[2].sizeHint() )
self.vbox.addWidget( self.cb[2] )
@@ -242,44 +242,44 @@ class WidgetView ( QWidget ):
self.connect( self.bg, SIGNAL("clicked(int)"), self.checkBoxClicked )
- QToolTip.add( self.cb[0], "check box 1" )
- QToolTip.add( self.cb[1], "check box 2" )
- QToolTip.add( self.cb[2], "check box 3" )
+ TQToolTip.add( self.cb[0], "check box 1" )
+ TQToolTip.add( self.cb[1], "check box 2" )
+ TQToolTip.add( self.cb[2], "check box 3" )
# Create a group of radio buttons
- self.bg = QButtonGroup( self, "radioGroup" )
+ self.bg = TQButtonGroup( self, "radioGroup" )
self.bg.setTitle( "Radio buttons" )
self.grid.addWidget( self.bg, 1, 1 )
# Create a layout for the radio buttons
- self.vbox = QVBoxLayout( self.bg, 10 )
+ self.vbox = TQVBoxLayout( self.bg, 10 )
self.vbox.addSpacing( self.bg.fontMetrics().height() )
- self.rb = QRadioButton( self.bg )
+ self.rb = TQRadioButton( self.bg )
self.rb.setText( "&AM" )
self.rb.setChecked( TRUE )
self.vbox.addWidget( self.rb )
self.rb.setMinimumSize( self.rb.sizeHint() )
- QToolTip.add( self.rb, "radio button 1" )
- self.rb = QRadioButton( self.bg )
+ TQToolTip.add( self.rb, "radio button 1" )
+ self.rb = TQRadioButton( self.bg )
self.rb.setText( "&FM" )
self.vbox.addWidget( self.rb )
self.rb.setMinimumSize( self.rb.sizeHint() )
- QToolTip.add( self.rb, "radio button 2" )
- self.rb = QRadioButton( self.bg )
+ TQToolTip.add( self.rb, "radio button 2" )
+ self.rb = TQRadioButton( self.bg )
self.rb.setText( "&Short Wave" )
self.vbox.addWidget( self.rb )
self.rb.setMinimumSize( self.rb.sizeHint() )
self.vbox.activate()
self.connect( self.bg, SIGNAL("clicked(int)"), self.radioButtonClicked )
- QToolTip.add( self.rb, "radio button 3" )
+ TQToolTip.add( self.rb, "radio button 3" )
# Create a list box
- self.lb = QListBox( self, "listBox" )
+ self.lb = TQListBox( self, "listBox" )
for i in range( 0, 100, 1 ): # fill list box
- txt = QString()
+ txt = TQString()
txt = "line %d" % i
if i == 42 and self.pix:
self.lb.insertItem( self.pm )
@@ -288,26 +288,26 @@ class WidgetView ( QWidget ):
self.grid.addMultiCellWidget( self.lb, 2, 4, 0, 0 )
self.connect( self.lb, SIGNAL("selected(int)"), self.listBoxItemSelected )
- QToolTip.add( self.lb, "list box" )
+ TQToolTip.add( self.lb, "list box" )
- self.vbox = QVBoxLayout( 8 )
+ self.vbox = TQVBoxLayout( 8 )
self.grid.addLayout( self.vbox, 2, 1 )
# Create a slider
- self.sb = QSlider( 0, 300, 1, 100, QSlider.Horizontal, self, "Slider" )
- #self.sb.setTickmarks( QSlider.Below )
+ self.sb = TQSlider( 0, 300, 1, 100, TQSlider.Horizontal, self, "Slider" )
+ #self.sb.setTickmarks( TQSlider.Below )
self.sb.setTickmarks( 1 )
self.sb.setTickInterval( 10 )
- #self.sb.setFocusPolicy( QWidget.TabFocus )
+ #self.sb.setFocusPolicy( TQWidget.TabFocus )
self.sb.setFocusPolicy( 1 )
self.sb.setFixedHeight( self.sb.sizeHint().height() )
self.vbox.addWidget( self.sb )
self.connect( self.sb, SIGNAL("valueChanged(int)"), self.sliderValueChanged )
- QToolTip.add( self.sb, "slider" )
+ TQToolTip.add( self.sb, "slider" )
# Create a combo box
- self.combo = QComboBox( FALSE, self, "comboBox" )
+ self.combo = TQComboBox( FALSE, self, "comboBox" )
self.combo.insertItem( "darkBlue" )
self.combo.insertItem( "darkRed" )
self.combo.insertItem( "darkGreen" )
@@ -316,10 +316,10 @@ class WidgetView ( QWidget ):
self.combo.setFixedHeight( self.combo.sizeHint().height() )
self.vbox.addWidget( self.combo )
self.connect( self.combo, SIGNAL("activated(int)"), self.comboBoxItemActivated )
- QToolTip.add( self.combo, "read-only combo box" )
+ TQToolTip.add( self.combo, "read-only combo box" )
# Create an editable combo box
- self.edCombo = QComboBox( TRUE, self, "edComboBox" )
+ self.edCombo = TQComboBox( TRUE, self, "edComboBox" )
self.edCombo.insertItem( "Permutable" )
self.edCombo.insertItem( "Malleable" )
self.edCombo.insertItem( "Adaptable" )
@@ -327,50 +327,50 @@ class WidgetView ( QWidget ):
self.edCombo.insertItem( "Inconstant" )
self.edCombo.setFixedHeight( self.edCombo.sizeHint().height() )
self.vbox.addWidget( self.edCombo )
- self.connect( self.edCombo, SIGNAL("activated(const QString &)"), self.edComboBoxItemActivated)
- QToolTip.add( self.edCombo, "editable combo box" )
+ self.connect( self.edCombo, SIGNAL("activated(const TQString &)"), self.edComboBoxItemActivated)
+ TQToolTip.add( self.edCombo, "editable combo box" )
self.edCombo.setAutoCompletion( TRUE )
self.vbox.addStretch( 1 )
- self.vbox = QVBoxLayout( 8 )
+ self.vbox = TQVBoxLayout( 8 )
self.grid.addLayout( self.vbox, 2, 2 )
# Create a spin box
- self.spin = QSpinBox( 0, 10, 1, self, "spin" )
+ self.spin = TQSpinBox( 0, 10, 1, self, "spin" )
self.spin.setSuffix( " mm" )
self.spin.setSpecialValueText( "Auto" )
self.spin.setMinimumSize( self.spin.sizeHint() )
- self.connect( self.spin, SIGNAL( "valueChanged(const QString &)" ), self.spinBoxValueChanged )
- QToolTip.add( self.spin, "spin box" )
+ self.connect( self.spin, SIGNAL( "valueChanged(const TQString &)" ), self.spinBoxValueChanged )
+ TQToolTip.add( self.spin, "spin box" )
self.vbox.addWidget( self.spin )
self.vbox.addStretch( 1 )
# Create a multi line edit
- self.mle = QMultiLineEdit( self, "multiLineEdit" )
+ self.mle = TQMultiLineEdit( self, "multiLineEdit" )
self.grid.addMultiCellWidget( self.mle, 3, 3, 1, 2 )
self.mle.setMinimumHeight( self.mle.fontMetrics().height() * 3 )
- self.mle.setText("This is a QMultiLineEdit widget,\n"
+ self.mle.setText("This is a TQMultiLineEdit widget,\n"
"useful for small multi-line\n"
"input fields.")
- QToolTip.add( self.mle, "multi line editor" )
+ TQToolTip.add( self.mle, "multi line editor" )
# Create a single line edit
- self.le = QLineEdit( self, "lineEdit" )
+ self.le = TQLineEdit( self, "lineEdit" )
self.grid.addMultiCellWidget( self.le, 4, 4, 1, 2 )
self.le.setFixedHeight( self.le.sizeHint().height() )
- self.connect( self.le, SIGNAL("textChanged(const QString &)"), self.lineEditTextChanged )
- QToolTip.add( self.le, "single line editor" )
+ self.connect( self.le, SIGNAL("textChanged(const TQString &)"), self.lineEditTextChanged )
+ TQToolTip.add( self.le, "single line editor" )
- # Create a horizontal line (sort of QFrame) above the message line
- self.separator = QFrame( self, "separatorLine" )
- self.separator.setFrameStyle( QFrame.HLine | QFrame.Sunken )
+ # Create a horizontal line (sort of TQFrame) above the message line
+ self.separator = TQFrame( self, "separatorLine" )
+ self.separator.setFrameStyle( TQFrame.HLine | TQFrame.Sunken )
self.separator.setFixedHeight( self.separator.sizeHint().height() )
self.grid.addMultiCellWidget( self.separator, 5, 5, 0, 2 )
- QToolTip.add( self.separator, "tool tips on a separator! wow!" )
+ TQToolTip.add( self.separator, "tool tips on a separator! wow!" )
self.grid.setRowStretch( 0, 0 )
self.grid.setRowStretch( 1, 0 )
@@ -386,24 +386,24 @@ class WidgetView ( QWidget ):
# Create an label and a message in a plain widget
# The message is updated when buttons are clicked etc.
- self.hbox = QHBoxLayout()
+ self.hbox = TQHBoxLayout()
self.topLayout.addLayout( self.hbox )
- self.msgLabel = QLabel( self, "msgLabel" )
+ self.msgLabel = TQLabel( self, "msgLabel" )
self.msgLabel.setText( "Message:" )
- self.msgLabel.setAlignment( Qt.AlignHCenter | Qt.AlignVCenter )
+ self.msgLabel.setAlignment( TQt.AlignHCenter | TQt.AlignVCenter )
self.msgLabel.setFixedSize( self.msgLabel.sizeHint() )
self.hbox.addWidget( self.msgLabel )
- QToolTip.add( self.msgLabel, "label 1" )
+ TQToolTip.add( self.msgLabel, "label 1" )
- self.msg = QLabel( self, "message" )
- self.msg.setFrameStyle( QFrame.Panel | QFrame.Sunken )
- self.msg.setAlignment( Qt.AlignCenter )
- self.msg.setFont( QFont( "times", 12, QFont.Bold ) )
+ self.msg = TQLabel( self, "message" )
+ self.msg.setFrameStyle( TQFrame.Panel | TQFrame.Sunken )
+ self.msg.setAlignment( TQt.AlignCenter )
+ self.msg.setFont( TQFont( "times", 12, TQFont.Bold ) )
self.msg.setText( "Message" )
self.msg.setFixedHeight( self.msg.sizeHint().height() )
self.msg.setText( "" )
self.hbox.addWidget( self.msg, 5 )
- QToolTip.add( self.msg, "label 2" )
+ TQToolTip.add( self.msg, "label 2" )
self.topLayout.activate()
@@ -415,19 +415,19 @@ class WidgetView ( QWidget ):
self.setIcon( self.movie.framePixmap() )
def movieStatus( self, s ):
- if s == QMovie.SourceEmpty or s == QMovie.UnrecognizedFormat:
- pm = QPixmap('tt-logo.png')
+ if s == TQMovie.SourceEmpty or s == TQMovie.UnrecognizedFormat:
+ pm = TQPixmap('tt-logo.png')
self.movielabel.setPixmap(pm)
self.movielabel.setFixedSize(pm.size())
else:
if ( self.movielabel.movie() ): # for flicker-free animation:
- self.movielabel.setBackgroundMode( QWidget.NoBackground )
+ self.movielabel.setBackgroundMode( TQWidget.NoBackground )
def button1Clicked( self ):
self.msg.setText( "The first push button was clicked" )
def checkBoxClicked( self, id ):
- txt = QString()
+ txt = TQString()
txt = "Check box %s clicked : " % str(id)
chk = ["-","-","-"]
if self.cb[0].isChecked():
@@ -440,40 +440,40 @@ class WidgetView ( QWidget ):
self.msg.setText( txt )
def edComboBoxItemActivated( self, text):
- txt = QString()
+ txt = TQString()
txt = "Editable Combo Box set to %s" % text
self.msg.setText( txt )
def radioButtonClicked( self, id ):
- txt = QString()
+ txt = TQString()
txt = "Radio button #%d clicked" % id
self.msg.setText( txt )
def listBoxItemSelected( self, index ):
- txt = QString()
+ txt = TQString()
txt = "List box item %d selected" % index
self.msg.setText( txt )
def sliderValueChanged( self, value ):
- txt = QString()
+ txt = TQString()
txt = "Movie set to %d%% of normal speed" % value
self.msg.setText( txt )
self.movie.setSpeed( value )
def comboBoxItemActivated( self, index ):
- txt = QString()
+ txt = TQString()
txt = "Comboxo box item %d activated" % index
self.msg.setText( txt )
if index == 0:
- QApplication.setWinStyleHighlightColor( Qt.darkBlue )
+ TQApplication.setWinStyleHighlightColor( TQt.darkBlue )
elif index == 1:
- QApplication.setWinStyleHighlightColor( Qt.darkRed )
+ TQApplication.setWinStyleHighlightColor( TQt.darkRed )
elif index == 2:
- QApplication.setWinStyleHighlightColor( Qt.darkGreen )
+ TQApplication.setWinStyleHighlightColor( TQt.darkGreen )
elif index == 3:
- QApplication.setWinStyleHighlightColor( Qt.blue )
+ TQApplication.setWinStyleHighlightColor( TQt.blue )
elif index == 4:
- QApplication.setWinStyleHighlightColor( Qt.red )
+ TQApplication.setWinStyleHighlightColor( TQt.red )
def lineEditTextChanged( self, newText ):
self.msg.setText("Line edit text: " + unicode(newText))
@@ -487,24 +487,24 @@ class WidgetView ( QWidget ):
#def eventFilter( self, event ):
# identify_now = TRUE
# if event.type() == Event_MouseButtonPress and identify_now:
- # e = QMouseEvent( event )
- # if (e.button() == Qt.RightButton) and (e.state() & Qt.ControlButton) != 0:
- # txt = QString( "The clicked widget is a\n" )
- # txt = txt + QObect.className()
+ # e = TQMouseEvent( event )
+ # if (e.button() == TQt.RightButton) and (e.state() & TQt.ControlButton) != 0:
+ # txt = TQString( "The clicked widget is a\n" )
+ # txt = txt + TQObect.className()
# txt = txt + "\nThe widget's name is\n"
- # if QObject.name():
- # txt = txt + QObject.name()
+ # if TQObject.name():
+ # txt = txt + TQObject.name()
# else:
# txt = txt + "<no name>"
# identify_now = FALSE # don't do it in message box
- # QMessageBox.message( "Identify Widget", txt, 0, QObject )
+ # TQMessageBox.message( "Identify Widget", txt, 0, TQObject )
# identify_now = TRUE; # allow it again
# return FALSE # don't eat event
################################################################################################
-#QApplication.setColourSpec( QApplication.CustomColor )
-a = QApplication( sys.argv )
+#TQApplication.setColourSpec( TQApplication.CustomColor )
+a = TQApplication( sys.argv )
w = WidgetView()
a.setMainWidget( w )