diff options
author | Timothy Pearson <[email protected]> | 2012-02-27 17:38:16 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-02-27 17:38:16 -0600 |
commit | 104997c6f7b545c0095fdc1b1573367bc4cb4d5b (patch) | |
tree | cb6ae5f9464208d78cb51515f5a3c3a0a7edc64f /examples3 | |
parent | e87fff3247e64b4e9509be991a8f2d6bd4ccfacc (diff) | |
download | pytqt-104997c6f7b545c0095fdc1b1573367bc4cb4d5b.tar.gz pytqt-104997c6f7b545c0095fdc1b1573367bc4cb4d5b.zip |
Rename tqt3 color functions
Diffstat (limited to 'examples3')
-rwxr-xr-x | examples3/addressbook.py | 2 | ||||
-rwxr-xr-x | examples3/application.py | 2 | ||||
-rwxr-xr-x | examples3/canvas/canvas.py | 14 | ||||
-rwxr-xr-x | examples3/desktop.py | 12 | ||||
-rwxr-xr-x | examples3/dragdrop.py | 2 | ||||
-rwxr-xr-x | examples3/i18n/i18n.py | 10 | ||||
-rw-r--r-- | examples3/i18n/mywidget.py | 8 | ||||
-rwxr-xr-x | examples3/mdi.py | 2 | ||||
-rwxr-xr-x | examples3/menu.py | 2 | ||||
-rwxr-xr-x | examples3/progress.py | 2 | ||||
-rwxr-xr-x | examples3/qmag.py | 8 | ||||
-rwxr-xr-x | examples3/richtext.py | 2 | ||||
-rwxr-xr-x | examples3/tabdialog.py | 2 | ||||
-rw-r--r-- | examples3/webbrowser/mainwindow.py | 2 | ||||
-rwxr-xr-x | examples3/widgets.py | 4 |
15 files changed, 37 insertions, 37 deletions
diff --git a/examples3/addressbook.py b/examples3/addressbook.py index e151996..6d7309b 100755 --- a/examples3/addressbook.py +++ b/examples3/addressbook.py @@ -396,7 +396,7 @@ class ABMainWindow(TQMainWindow): self.file.insertSeparator() #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 ) + self.file.insertItem( 'Quit', tqApp, SLOT( 'quit()' ), TQt.CTRL + TQt.Key_Q ) def setupFileTools( self ): pass diff --git a/examples3/application.py b/examples3/application.py index c0224f3..eca45a9 100755 --- a/examples3/application.py +++ b/examples3/application.py @@ -141,7 +141,7 @@ class ApplicationWindow(TQMainWindow): self.file.insertSeparator() 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.file.insertItem('&Quit',tqApp,SLOT('closeAllWindows()'),TQt.CTRL + TQt.Key_Q) self.help = TQPopupMenu(self) self.menuBar().insertSeparator() diff --git a/examples3/canvas/canvas.py b/examples3/canvas/canvas.py index 7d36592..8c0998e 100755 --- a/examples3/canvas/canvas.py +++ b/examples3/canvas/canvas.py @@ -34,7 +34,7 @@ class ImageItem(TQCanvasRectangle): if not self.image.valid( ix , iy ): return False self.pixel = self.image.pixel( ix, iy ) - return (qAlpha( self.pixel ) != 0) + return (tqAlpha( self.pixel ) != 0) def drawShape(self,p): p.drawPixmap( self.x(), self.y(), self.pixmap ) @@ -212,7 +212,7 @@ class Main (TQMainWindow): file.insertSeparator(); file.insertItem("&Print", self._print, TQt.CTRL+TQt.Key_P) file.insertSeparator() - file.insertItem("E&xit", qApp, SLOT("quit()"), TQt.CTRL+TQt.Key_Q) + file.insertItem("E&xit", tqApp, SLOT("quit()"), TQt.CTRL+TQt.Key_Q) self.menuBar().insertItem("&File", file) edit = TQPopupMenu(self.menuBar() ) @@ -280,9 +280,9 @@ class Main (TQMainWindow): def newView(self): m=Main(self.canvas,None,"new windiw",TQt.WDestructiveClose) - qApp.setMainWidget(m) + tqApp.setMainWidget(m) m.show() - qApp.setMainWidget(None) + tqApp.setMainWidget(None) views.append(m) def clear(self): @@ -596,7 +596,7 @@ if __name__=='__main__': m=Main(canvas,None,"pyqt canvas example") m.resize(m.sizeHint()) - qApp.setMainWidget(m) + tqApp.setMainWidget(m) m.setCaption("TQt Canvas Example ported to PyTQt") if TQApplication.desktop().width() > m.width() + 10 and TQApplication.desktop().height() > m.height() + 30: m.show() @@ -605,9 +605,9 @@ if __name__=='__main__': m.show(); #// m.help(); - qApp.setMainWidget(None); + tqApp.setMainWidget(None); - TQObject.connect( qApp, SIGNAL("lastWindowClosed()"), qApp, SLOT("quit()") ) + TQObject.connect( tqApp, SIGNAL("lastWindowClosed()"), tqApp, SLOT("quit()") ) app.exec_loop() diff --git a/examples3/desktop.py b/examples3/desktop.py index 46c41dc..393558b 100755 --- a/examples3/desktop.py +++ b/examples3/desktop.py @@ -84,7 +84,7 @@ def rotate(): h = 64 image = TQImage(w, h, 8, 128) for i in range(128): - image.setColor(i, qRgb(i,0,0)) + image.setColor(i, tqRgb(i,0,0)) for y in range(h): for x in range(w): image.setPixel(x,y,(x+y)%128) @@ -159,12 +159,12 @@ class DesktopWidget(TQWidget): def desktopWidget(s='Trolltech'): t = DesktopWidget(s) t.update() - qApp.exec_loop() + tqApp.exec_loop() def desktopText(s='Trolltech'): border = 20 - c1 = qApp.palette().normal().background() + c1 = tqApp.palette().normal().background() c2 = c1.light(104) c3 = c1.dark(106) @@ -174,8 +174,8 @@ def desktopText(s='Trolltech'): r = p.fontMetrics().boundingRect(s) p.end() - appWidth = qApp.desktop().width() - appHeight = qApp.desktop().height() + appWidth = tqApp.desktop().width() + appHeight = tqApp.desktop().height() if r.width() > appWidth - border*2: r.setWidth(appWidth - border*2) if r.height() > appHeight - border*2: @@ -187,7 +187,7 @@ def desktopText(s='Trolltech'): drawShadeText(p, -r.x()+border, -r.y()+border, s, c2, c3) p.end() - qApp.desktop().setErasePixmap(pm) + tqApp.desktop().setErasePixmap(pm) a = TQApplication(sys.argv) if len(sys.argv) > 1: diff --git a/examples3/dragdrop.py b/examples3/dragdrop.py index 5ea9171..0a7177b 100755 --- a/examples3/dragdrop.py +++ b/examples3/dragdrop.py @@ -52,6 +52,6 @@ addStuff( mw3, 1, 1 ) mw3.setCaption( "TQt Example - Drag and Drop" ) mw3.show() -TQObject.connect(qApp,SIGNAL('lastWindowClosed()'),qApp,SLOT('quit()')) +TQObject.connect(tqApp,SIGNAL('lastWindowClosed()'),tqApp,SLOT('quit()')) app.exec_loop() diff --git a/examples3/i18n/i18n.py b/examples3/i18n/i18n.py index 8595d0b..866b097 100755 --- a/examples3/i18n/i18n.py +++ b/examples3/i18n/i18n.py @@ -61,7 +61,7 @@ wlist = [] # keep reference to widgets def showLang(lang): global translator - qApp.setPalette(TQPalette(TQColor(220-randint(0,64),220-randint(0,64),220-randint(0,64)))) + tqApp.setPalette(TQPalette(TQColor(220-randint(0,64),220-randint(0,64),220-randint(0,64)))) language = "mywidget_"+lang+".qm" fi = TQFileInfo(language) @@ -73,12 +73,12 @@ def showLang(lang): return None if translator is not None: - qApp.removeTranslator(translator) + tqApp.removeTranslator(translator) translator = None translator = TQTranslator(None) translator.load(language,".") - qApp.installTranslator(translator) + tqApp.installTranslator(translator) m = MyWidget() m.setCaption("PyTQt Example - i18n - " + unicode(m.caption())) wlist.append(m) @@ -109,7 +109,7 @@ def main(argv): r = dlg.exec_loop() if r: - tight = qApp.desktop().screen().width < 1024 + tight = tqApp.desktop().screen().width < 1024 x = 5 y = 25 for i in range(0,len(qm)): @@ -119,7 +119,7 @@ def main(argv): if w == None: sys.exit(0) - app.connect(app, SIGNAL('lastWindowClosed()'), qApp, SLOT('quit()')) + app.connect(app, SIGNAL('lastWindowClosed()'), tqApp, SLOT('quit()')) w.setGeometry(x,y,197,356) w.show() if tight: diff --git a/examples3/i18n/mywidget.py b/examples3/i18n/mywidget.py index f69cebf..c714910 100644 --- a/examples3/i18n/mywidget.py +++ b/examples3/i18n/mywidget.py @@ -15,7 +15,7 @@ class MyWidget(TQMainWindow): self.setCaption(self.trUtf8("""Internationalization Example""")) self.file = TQPopupMenu(self) - self.file.insertItem(self.trUtf8("E&xit"), qApp, SLOT("quit()"), + self.file.insertItem(self.trUtf8("E&xit"), tqApp, SLOT("quit()"), TQKeySequence(self.trUtf8("Ctrl+Q","File|Quit"))) self.menuBar().insertItem(self.trUtf8("&File"), self.file) @@ -25,9 +25,9 @@ class MyWidget(TQMainWindow): self.gbox = TQButtonGroup(1, TQGroupBox.Horizontal, self.trUtf8("View"), self.central) - rb = TQRadioButton(qApp.translate('MyWidget','Perspective'), self.gbox) - rb = TQRadioButton(qApp.translate('MyWidget','Isometric'), self.gbox) - rb = TQRadioButton(qApp.translate('MyWidget','Oblique'), self.gbox) + rb = TQRadioButton(tqApp.translate('MyWidget','Perspective'), self.gbox) + rb = TQRadioButton(tqApp.translate('MyWidget','Isometric'), self.gbox) + rb = TQRadioButton(tqApp.translate('MyWidget','Oblique'), self.gbox) self.initChoices(self.central) diff --git a/examples3/mdi.py b/examples3/mdi.py index 3ff7e2e..8418678 100755 --- a/examples3/mdi.py +++ b/examples3/mdi.py @@ -164,7 +164,7 @@ class ApplicationWindow(TQMainWindow): self.file.insertSeparator() 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.file.insertItem('&Quit',tqApp,SLOT('closeAllWindows()'),TQt.CTRL + TQt.Key_Q) self.menuBar().insertSeparator() self.windows = TQPopupMenu( self ) diff --git a/examples3/menu.py b/examples3/menu.py index bb3f998..a303fb2 100755 --- a/examples3/menu.py +++ b/examples3/menu.py @@ -131,7 +131,7 @@ class MenuExample( TQWidget ): self.file.insertSeparator() self.file.insertItem( "&Print", self.printer, TQt.CTRL+TQt.Key_P ) self.file.insertSeparator() - self.file.insertItem( "E&xit", qApp, SLOT( "quit()" ), TQt.CTRL+TQt.Key_Q ) + self.file.insertItem( "E&xit", tqApp, SLOT( "quit()" ), TQt.CTRL+TQt.Key_Q ) self.edit = TQPopupMenu( self ) undoID = self.edit.insertItem( "&Undo", self.undo ) diff --git a/examples3/progress.py b/examples3/progress.py index cb852b9..3c84f83 100755 --- a/examples3/progress.py +++ b/examples3/progress.py @@ -126,7 +126,7 @@ class CPUWaster(TQWidget): "Ctrl+%s" % (i - self.first_draw_item)), i) self.connect(menubar, SIGNAL("activated(int)"), self.doMenuItem) file_.insertSeparator() - file_.insertItem("Quit", qApp, SLOT("quit()"), TQKeySequence("Ctrl+Q")) + file_.insertItem("Quit", tqApp, SLOT("quit()"), TQKeySequence("Ctrl+Q")) self.options = options = TQPopupMenu() menubar.insertItem("&Options", options) self.ld_id = options.insertItem("Loop driven", self.loopDriven, diff --git a/examples3/qmag.py b/examples3/qmag.py index d52a48c..28725e5 100755 --- a/examples3/qmag.py +++ b/examples3/qmag.py @@ -26,8 +26,8 @@ refreshrates = [ timer = (0, 20, 250, 333, 500, 1000, 2000, 3000, 5000, 10000) class MagWidget(TQWidget): - def __init__(self, qApp, parent = None, name = None): - self.qApp = qApp + def __init__(self, tqApp, parent = None, name = None): + self.qApp = tqApp TQWidget.__init__(self, parent, name) self.pm = TQPixmap() # pixmap magnified self.p = TQPixmap() # pixmap @@ -210,8 +210,8 @@ class MagWidget(TQWidget): if self.image.valid(x, y): px = self.image.pixel(x, y) pixelinfo = "%3d,%3d,%3d #%02x%02x%02x" % ( - qRed(px), qGreen(px), qBlue(px), - qRed(px), qGreen(px), qBlue(px)) + tqRed(px), tqGreen(px), tqBlue(px), + tqRed(px), tqGreen(px), tqBlue(px)) self.rgb.setText("x=%d, y=%d %s" % \ (x + self.grabx, y + self.graby, pixelinfo)) diff --git a/examples3/richtext.py b/examples3/richtext.py index f7eb73e..7c99ee2 100755 --- a/examples3/richtext.py +++ b/examples3/richtext.py @@ -97,7 +97,7 @@ class MyRichText( TQVBox ): self.bPrev.setEnabled( False ) - self.connect( self.bClose, SIGNAL("clicked()"), qApp, SLOT("quit()") ) + self.connect( self.bClose, SIGNAL("clicked()"), tqApp, SLOT("quit()") ) self.connect( self.bPrev, SIGNAL("clicked()"), self.prev ) self.connect( self.bNext, SIGNAL("clicked()"), self.next ) diff --git a/examples3/tabdialog.py b/examples3/tabdialog.py index fe1ecd7..19fd1a2 100755 --- a/examples3/tabdialog.py +++ b/examples3/tabdialog.py @@ -21,7 +21,7 @@ class TabDialog( TQTabDialog ): self.setupTab1() self.setupTab2() self.setupTab3() - self.connect( self, SIGNAL("applyButtonPressed()"), qApp, SLOT("quit()" ) ) + self.connect( self, SIGNAL("applyButtonPressed()"), tqApp, SLOT("quit()" ) ) def setupTab1( self ): tab1 = TQVBox( self ) diff --git a/examples3/webbrowser/mainwindow.py b/examples3/webbrowser/mainwindow.py index c88be2f..96f0213 100644 --- a/examples3/webbrowser/mainwindow.py +++ b/examples3/webbrowser/mainwindow.py @@ -1094,4 +1094,4 @@ class MainWindow(TQMainWindow): print "MainWindow.aboutTQtSlot(): Not implemented yet" def __tr(self,s,c = None): - return qApp.translate("MainWindow",s,c) + return tqApp.translate("MainWindow",s,c) diff --git a/examples3/widgets.py b/examples3/widgets.py index c0927b2..372a63c 100755 --- a/examples3/widgets.py +++ b/examples3/widgets.py @@ -136,7 +136,7 @@ class WidgetView ( TQWidget ): self.setCaption( "TQt Widgets Demo Application" ) # Install an application-global event filter - qApp.installEventFilter( self ) + tqApp.installEventFilter( self ) # Create a layout to position the widgets self.topLayout = TQVBoxLayout( self, 10 ) @@ -160,7 +160,7 @@ class WidgetView ( TQWidget ): self.id = self.popup.insertItem( "&Open" ) self.popup.setItemEnabled( self.id, FALSE ) self.popup.insertSeparator() - self.popup.insertItem( "&Quit", qApp, SLOT("quit()"), TQt.CTRL+TQt.Key_Q ) + self.popup.insertItem( "&Quit", tqApp, SLOT("quit()"), TQt.CTRL+TQt.Key_Q ) self.menubar.insertItem( "&File", self.popup ) |