Rename tqt3 color functions

pull/1/head
Timothy Pearson 12 years ago
parent e87fff3247
commit 104997c6f7

@ -1555,7 +1555,7 @@ their own function name.
2003/05/30 17:47:57 phil
Added the listbox.py and listboxcombo.py examples from Jorge Arroyo.
build.py improvement in detecting executable programs.
Changed pyuic3 to generate calls to qApp.translate() rather than self.tr().
Changed pyuic3 to generate calls to tqApp.translate() rather than self.tr().
Documented the issues related to translations.
@ -2533,7 +2533,7 @@ Added /CreatesThread/ and /NewThread/ to TQThread.
2002/04/14 18:07:56 phil
Reinstated PyTQtDisownTopLevelWidgets() because it solves the problem where we
can't guarantee that the order in which qApp and the top level widgets will be
can't guarantee that the order in which tqApp and the top level widgets will be
destroyed.
Changed -MT to -MD for Windows (thanks to Paul Felix).

@ -548,7 +548,7 @@ v0.6 20th February 1999
v0.5 21st January 1999
The bindings are now packaged with autoconf configure scripts. The
enum in TQFrame is now unnamed as it is in TQt. All the examples changed
to use the new form of enums. Added support for qApp, the global
to use the new form of enums. Added support for tqApp, the global
TQColors, kapp, i18n(), Icon() and ICON(). Same test environment as
v0.4.

@ -1744,7 +1744,7 @@ CLASS="PROGRAMLISTING"
TQObject.__init__(self)
def hello(self):
return qApp.translate("A","Hello")</PRE
return tqApp.translate("A","Hello")</PRE
></TD
></TR
></TABLE

@ -1090,7 +1090,7 @@ class A(TQObject):
TQObject.__init__(self)
def hello(self):
return qApp.translate("A","Hello")
return tqApp.translate("A","Hello")
</ProgramListing>
<Para>

@ -1123,7 +1123,7 @@ class A(TQObject):
TQObject.__init__(self)
def hello(self):
return qApp.translate("A","Hello")
return tqApp.translate("A","Hello")
</ProgramListing>
<Para>

@ -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

@ -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()

@ -83,7 +83,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)
@ -158,12 +158,12 @@ class DesktopWidget(TQWidget):
def desktopWidget(s='Troll Tech'):
t = DesktopWidget(s)
t.update()
qApp.exec_loop()
tqApp.exec_loop()
def desktopText(s='Troll Tech'):
border = 20
c1 = qApp.palette().normal().background()
c1 = tqApp.palette().normal().background()
c2 = c1.light(104)
c3 = c1.dark(106)
@ -173,8 +173,8 @@ def desktopText(s='Troll Tech'):
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:
@ -186,7 +186,7 @@ def desktopText(s='Troll Tech'):
drawShadeText(p, -r.x()+border, -r.y()+border, s, c2, c3)
p.end()
qApp.desktop().setBackgroundPixmap(pm)
tqApp.desktop().setBackgroundPixmap(pm)
a = TQApplication(sys.argv)
if len(sys.argv) > 1:

@ -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()

@ -160,7 +160,7 @@ class MenuExample( TQWidget ):
self.file.insertSeparator()
self.file.insertItem( self.p4, "&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 )
#CHECK_PTR( self.edit )

@ -389,7 +389,7 @@ class NorwegianWoodStyle(TQMotifStyle):
rgb=img.color(i)
c=TQColor(rgb)
(r, g, b)=c.dark().rgb()
img.setColor(i,qRgb(r, g, b))
img.setColor(i,tqRgb(r, g, b))
mid=TQPixmap()
mid.convertFromImage(img)
@ -398,7 +398,7 @@ class NorwegianWoodStyle(TQMotifStyle):
rgb=img.color(i)
c=TQColor(rgb)
(r, g, b)=c.light().rgb()
img.setColor(i,qRgb(r, g, b))
img.setColor(i,tqRgb(r, g, b))
light=TQPixmap()
light.convertFromImage(img)
@ -407,7 +407,7 @@ class NorwegianWoodStyle(TQMotifStyle):
rgb=img.color(i)
c=TQColor(rgb)
(r, g, b)=c.dark().rgb()
img.setColor(i,qRgb(r, g, b))
img.setColor(i,tqRgb(r, g, b))
dark=TQPixmap()
dark.convertFromImage(img)
@ -815,7 +815,7 @@ class Themes(TQMainWindow):
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, TQt.CTRL | TQt.Key_Q)
self.style.insertItem("&Quit", tqApp.quit, TQt.CTRL | TQt.Key_Q)
self.help=TQPopupMenu(self)
self.menuBar().insertSeparator()
@ -824,7 +824,7 @@ class Themes(TQMainWindow):
self.help.insertItem("About &TQt", self.aboutTQt)
self.style=NorwegianWoodStyle()
qApp.setStyle(self.style)
tqApp.setStyle(self.style)
self.menuBar().setItemChecked(self.sWood, TRUE)
# In the following we cannot simply set the new style as we can in C++. We
@ -833,37 +833,37 @@ class Themes(TQMainWindow):
def styleWood(self):
newstyle=NorwegianWoodStyle()
qApp.setStyle(newstyle)
tqApp.setStyle(newstyle)
self.style=newstyle
qApp.setFont(self.appFont, TRUE)
tqApp.setFont(self.appFont, TRUE)
self.selectStyleMenu(self.sWood)
def styleMetal(self):
newstyle=MetalStyle()
qApp.setStyle(newstyle)
tqApp.setStyle(newstyle)
self.style=newstyle
qApp.setFont(self.appFont, TRUE)
tqApp.setFont(self.appFont, TRUE)
self.selectStyleMenu(self.sMetal)
def stylePlatinum(self):
newstyle=TQPlatinumStyle()
qApp.setStyle(newstyle)
tqApp.setStyle(newstyle)
self.style=newstyle
p=TQPalette(TQColor(239, 239, 239))
qApp.setPalette(p, TRUE)
qApp.setFont(self.appFont, TRUE)
tqApp.setPalette(p, TRUE)
tqApp.setFont(self.appFont, TRUE)
self.selectStyleMenu(self.sPlatinum)
def styleWindows(self):
newstyle=TQWindowsStyle()
qApp.setStyle(newstyle)
tqApp.setStyle(newstyle)
self.style=newstyle
qApp.setFont(self.appFont, TRUE)
tqApp.setFont(self.appFont, TRUE)
self.selectStyleMenu(self.sWindows)
def styleCDE(self):
newstyle=TQCDEStyle(TRUE)
qApp.setStyle(newstyle)
tqApp.setStyle(newstyle)
self.style=newstyle
self.selectStyleMenu(self.sCDE)
@ -886,25 +886,25 @@ class Themes(TQMainWindow):
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(TQFont("times", self.appFont.pointSize()), TRUE)
tqApp.setPalette(p, TRUE)
tqApp.setFont(TQFont("times", self.appFont.pointSize()), TRUE)
def styleMotif(self):
newstyle=TQMotifStyle(TRUE)
qApp.setStyle(newstyle)
tqApp.setStyle(newstyle)
self.style=newstyle
p=TQPalette(TQColor(192, 192, 192))
qApp.setPalette(p, TRUE)
qApp.setFont(self.appFont, TRUE)
tqApp.setPalette(p, TRUE)
tqApp.setFont(self.appFont, TRUE)
self.selectStyleMenu(self.sMotif)
def styleMotifPlus(self):
newstyle=TQMotifPlusStyle(TRUE)
qApp.setStyle(newstyle)
tqApp.setStyle(newstyle)
self.style=newstyle
p=TQPalette(TQColor(192, 192, 192))
qApp.setPalette(p, TRUE)
qApp.setFont(self.appFont, TRUE)
tqApp.setPalette(p, TRUE)
tqApp.setFont(self.appFont, TRUE)
self.selectStyleMenu(self.sMotifPlus)
def about(self):

@ -101,7 +101,7 @@ class MyWidget(TQWidget):
quit = TQPushButton('&Quit',self,'quit')
quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.connect(quit,SIGNAL('clicked()'),tqApp,SLOT('quit()'))
self.angle = LCDRange(self,'angle')
self.angle.setRange(5,70)

@ -162,7 +162,7 @@ class MyWidget(TQWidget):
quit = TQPushButton('&Quit',self,'quit')
quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.connect(quit,SIGNAL('clicked()'),tqApp,SLOT('quit()'))
self.angle = LCDRange(self,'angle')
self.angle.setRange(5,70)

@ -201,7 +201,7 @@ class MyWidget(TQWidget):
quit = TQPushButton('&Quit',self,'quit')
quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.connect(quit,SIGNAL('clicked()'),tqApp,SLOT('quit()'))
self.angle = LCDRange('ANGLE',self,'angle')
self.angle.setRange(5,70)

@ -236,7 +236,7 @@ class GameBoard(TQWidget):
quit = TQPushButton('&Quit',self,'quit')
quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.connect(quit,SIGNAL('clicked()'),tqApp,SLOT('quit()'))
self.angle = LCDRange('ANGLE',self,'angle')
self.angle.setRange(5,70)

@ -276,7 +276,7 @@ class GameBoard(TQWidget):
quit = TQPushButton('&Quit',self,'quit')
quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.connect(quit,SIGNAL('clicked()'),tqApp,SLOT('quit()'))
self.angle = LCDRange('ANGLE',self,'angle')
self.angle.setRange(5,70)
@ -315,7 +315,7 @@ class GameBoard(TQWidget):
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()'))
accel.connectItem(accel.insertItem(TQt.CTRL + TQt.Key_Q),tqApp,SLOT('quit()'))
grid = TQGridLayout(self,2,2,10)
grid.addWidget(quit,0,0)

@ -17,7 +17,7 @@ class MyWidget(TQWidget):
quit.setGeometry(62,40,75,30)
quit.setFont(TQFont("Times",18,TQFont.Bold))
self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()"))
self.connect(quit,SIGNAL("clicked()"),tqApp,SLOT("quit()"))
a = TQApplication(sys.argv)

@ -13,7 +13,7 @@ class MyWidget(TQVBox):
quit = TQPushButton("Quit",self,"quit")
quit.setFont(TQFont("Times",18,TQFont.Bold))
self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()"))
self.connect(quit,SIGNAL("clicked()"),tqApp,SLOT("quit()"))
lcd = TQLCDNumber(2,self,"lcd")

@ -24,7 +24,7 @@ class MyWidget(TQVBox):
quit = TQPushButton("Quit",self,"quit")
quit.setFont(TQFont("Times",18,TQFont.Bold))
self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()"))
self.connect(quit,SIGNAL("clicked()"),tqApp,SLOT("quit()"))
grid = TQGrid(4,self)

@ -31,7 +31,7 @@ class MyWidget(TQVBox):
quit = TQPushButton("Quit",self,"quit")
quit.setFont(TQFont("Times",18,TQFont.Bold))
self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()"))
self.connect(quit,SIGNAL("clicked()"),tqApp,SLOT("quit()"))
grid = TQGrid(4,self)

@ -66,7 +66,7 @@ class MyWidget(TQWidget):
quit = TQPushButton('Quit',self,'quit')
quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.connect(quit,SIGNAL('clicked()'),tqApp,SLOT('quit()'))
self.angle = LCDRange(self,'angle')
self.angle.setRange(5,70)

@ -73,7 +73,7 @@ class MyWidget(TQWidget):
quit = TQPushButton('&Quit',self,'quit')
quit.setFont(TQFont('Times',18,TQFont.Bold))
self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()'))
self.connect(quit,SIGNAL('clicked()'),tqApp,SLOT('quit()'))
self.angle = LCDRange(self,'angle')
self.angle.setRange(5,70)

@ -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 )
@ -161,7 +161,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 )

@ -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

@ -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()

@ -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()

@ -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:

@ -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()

@ -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:

@ -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)

@ -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 )

@ -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 )

@ -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,

@ -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))

@ -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 )

@ -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 )

@ -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)

@ -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 )

@ -174,10 +174,10 @@ bool TsHandler::fatalError( const TQXmlParseException& exception )
msg.sprintf( "Parse error at line %d, column %d (%s).",
exception.lineNumber(), exception.columnNumber(),
exception.message().latin1() );
if ( qApp == 0 )
if ( tqApp == 0 )
qWarning( "XML error: %s", msg.latin1() );
else
TQMessageBox::information( qApp->mainWidget(),
TQMessageBox::information( tqApp->mainWidget(),
TQObject::tr("TQt Linguist"), msg );
}
return FALSE;

@ -38,7 +38,7 @@ static void init_colors()
return;
#if 0 // a calculated alternative for backColor1
TQColorGroup myCg = qApp->palette().active();
TQColorGroup myCg = tqApp->palette().active();
int h1, s1, v1;
int h2, s2, v2;
myCg.color( TQColorGroup::Base ).hsv( &h1, &s1, &v1 );

@ -249,7 +249,7 @@ Uic::Uic( const TQString &fn, const char *outputFn, TQTextStream &outStream,
out << "\n";
out << indent << "def __tr(self,s,c = None):\n";
++indent;
out << indent << "return qApp.translate(\"" << nameOfClass << "\",s,c)\n";
out << indent << "return tqApp.translate(\"" << nameOfClass << "\",s,c)\n";
--indent;
}
@ -258,7 +258,7 @@ Uic::Uic( const TQString &fn, const char *outputFn, TQTextStream &outStream,
out << "\n";
out << indent << "def __trUtf8(self,s,c = None):\n";
++indent;
out << indent << "return qApp.translate(\"" << nameOfClass << "\",s,c,TQApplication.UnicodeUTF8)\n";
out << indent << "return tqApp.translate(\"" << nameOfClass << "\",s,c,TQApplication.UnicodeUTF8)\n";
--indent;
}

@ -65,7 +65,7 @@ This has been renamed to <Literal>exec_loop</Literal> in Python.
%End
TQApplication *qApp;
TQApplication *tqApp;
class TQApplication : TQObject

@ -106,16 +106,16 @@ TQColor darkYellow;
// Related functions.
int qRed(TQRgb);
int qGreen(TQRgb);
int qBlue(TQRgb);
TQRgb qRgb(int,int,int);
int qGray(int,int,int);
int qGray(TQRgb);
int tqRed(TQRgb);
int tqGreen(TQRgb);
int tqBlue(TQRgb);
TQRgb tqRgb(int,int,int);
int tqGray(int,int,int);
int tqGray(TQRgb);
%If (TQt_2_00 -)
int qAlpha(TQRgb);
TQRgb qRgba(int,int,int,int);
int tqAlpha(TQRgb);
TQRgb tqRgba(int,int,int,int);
%End

@ -437,8 +437,8 @@ public:
Py_BEGIN_ALLOW_THREADS
if (cname && qApp)
sipRes = new TQString(qApp -> translate(cname,a0,a1,TQApplication::DefaultCodec));
if (cname && tqApp)
sipRes = new TQString(tqApp -> translate(cname,a0,a1,TQApplication::DefaultCodec));
else
sipRes = new TQString(TQString::fromLatin1(a0));
@ -460,8 +460,8 @@ public:
Py_BEGIN_ALLOW_THREADS
if (cname && qApp)
sipRes = new TQString(qApp -> translate(cname,a0,a1,TQApplication::UnicodeUTF8));
if (cname && tqApp)
sipRes = new TQString(tqApp -> translate(cname,a0,a1,TQApplication::UnicodeUTF8));
else
sipRes = new TQString(TQString::fromUtf8(a0));

@ -42,7 +42,7 @@ WId qt_xrootwin(int);
%End
%If (TQt_3_3_0 -)
const char *qAppClass();
const char *tqAppClass();
%End
%End

Loading…
Cancel
Save