diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-29 01:11:08 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-29 01:11:08 -0600 |
commit | 8a055d66f43592c257cece2eb8cc021808062917 (patch) | |
tree | d0922f201bd5d24b62a33160d1d9baf9e89f9a70 /examples3 | |
parent | b388516ca2691303a076a0764fd40bf7116fe43d (diff) | |
download | pytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip |
Initial TQt conversion
Diffstat (limited to 'examples3')
94 files changed, 2009 insertions, 2009 deletions
diff --git a/examples3/README b/examples3/README index 4a8f9eb..fcebe5f 100644 --- a/examples3/README +++ b/examples3/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 v3.x. +The examples are written for TQt v3.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/. diff --git a/examples3/SQL/README b/examples3/SQL/README index 9dfc5d4..6e28f6e 100644 --- a/examples3/SQL/README +++ b/examples3/SQL/README @@ -1,27 +1,27 @@ -This directory contains some translated sql examples from Qt 3.x. +This directory contains some translated sql examples from TQt 3.x. runform1.py, form1.ui: - A simple designer generated QDataTable. Run "pyuic form1.ui -o form1.py". + A simple designer generated TQDataTable. Run "pyuic form1.ui -o form1.py". runform2.py, form2.ui: - A simple designer generated QDataBrowser. Run "pyuic form2.ui -o form2.py". + A simple designer generated TQDataBrowser. Run "pyuic form2.ui -o form2.py". sqlcustom1.py: - QSqlForm based form with a simple custom editor forcing all input to + TQSqlForm based form with a simple custom editor forcing all input to be uppercase sqltable4.py: - Custom QDataTable with reimplemented paintField method, combined with - a QComboBox based custom field editor (StatusPicker), gathering its + Custom TQDataTable with reimplemented paintField method, combined with + a TQComboBox based custom field editor (StatusPicker), gathering its items from a different table (status) and a calculated column (monsalary). - Note, that QSqlEditorFactory based field editors are somewhat restricted, - because Qt's Q_PROPERTY feature isn't supported, yet. I've circumvented + Note, that TQSqlEditorFactory based field editors are somewhat restricted, + because TQt's Q_PROPERTY feature isn't supported, yet. I've circumvented this limitation by choosing the status table ids corresponding to the - index in the QComboBox. + index in the TQComboBox. sqlsubclass5.py: @@ -34,11 +34,11 @@ sqlsubclass5.py: runsqlex.py, sqlex.ui, sqlex.ui.h, connect.ui, connect.ui.h: - This one is a most advanced example, showing the use of a QSqlCursor - driven by QSqlQuery and iterating through database tables and fields. + This one is a most advanced example, showing the use of a TQSqlCursor + driven by TQSqlQuery and iterating through database tables and fields. Definitely worth a look. -Unfortunately you will have to make sure that these prerequisites are met +Unfortunately you will have to make sure that these preretquisites are met before trying the examples: - Install MySQL or PostgreSQL and any development packages @@ -49,7 +49,7 @@ before trying the examples: - For MySQL, run: mysql -u user -p password < testdb_mysql.sql - For PostgreSQL, run: psql -U user template1 -f testdb_pg.sql - - Build Qt with the mysql and/or psql modules activated. + - Build TQt with the mysql and/or psql modules activated. Now you should be ready for the fun part. You can run dbconnect.py from a command line and try to connect to the database. If all went well, @@ -64,7 +64,7 @@ DB_PASSWORD = "pass" The dbconnect.py script is generated from dbconnect.ui, which was created with qt's designer. You can find it also in Boudewijn Rempt's book -"GUI Programming with Python, using the Qt Toolkit". Although you won't find +"GUI Programming with Python, using the TQt Toolkit". Although you won't find the SQL widgets discussed there, for the simple reason of the book being written before they appeared, it is a valuable source for anybody new in this area. diff --git a/examples3/SQL/connect.ui b/examples3/SQL/connect.ui index cc41920..d33a783 100644 --- a/examples3/SQL/connect.ui +++ b/examples3/SQL/connect.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.0" stdsetdef="1"> <class>ConnectDialog</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>ConnectDialog</cstring> </property> @@ -25,7 +25,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>GroupBox3</cstring> </property> @@ -42,12 +42,12 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLineEdit" row="1" column="1"> + <widget class="TQLineEdit" row="1" column="1"> <property name="name"> <cstring>editDatabase</cstring> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>TextLabel3</cstring> </property> @@ -58,7 +58,7 @@ <cstring>comboDatabase</cstring> </property> </widget> - <widget class="QLineEdit" row="3" column="1"> + <widget class="TQLineEdit" row="3" column="1"> <property name="name"> <cstring>editPassword</cstring> </property> @@ -66,7 +66,7 @@ <enum>Password</enum> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>TextLabel4</cstring> </property> @@ -77,7 +77,7 @@ <cstring>editUsername</cstring> </property> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>TextLabel4_2</cstring> </property> @@ -88,22 +88,22 @@ <cstring>editPassword</cstring> </property> </widget> - <widget class="QComboBox" row="0" column="1"> + <widget class="TQComboBox" row="0" column="1"> <property name="name"> <cstring>comboDriver</cstring> </property> </widget> - <widget class="QLineEdit" row="2" column="1"> + <widget class="TQLineEdit" row="2" column="1"> <property name="name"> <cstring>editUsername</cstring> </property> </widget> - <widget class="QLineEdit" row="4" column="1"> + <widget class="TQLineEdit" row="4" column="1"> <property name="name"> <cstring>editHostname</cstring> </property> </widget> - <widget class="QLabel" row="4" column="0"> + <widget class="TQLabel" row="4" column="0"> <property name="name"> <cstring>TextLabel5</cstring> </property> @@ -114,7 +114,7 @@ <cstring>editHostname</cstring> </property> </widget> - <widget class="QLabel" row="5" column="0"> + <widget class="TQLabel" row="5" column="0"> <property name="name"> <cstring>TextLabel5_2</cstring> </property> @@ -125,7 +125,7 @@ <cstring>portSpinBox</cstring> </property> </widget> - <widget class="QSpinBox" row="5" column="1"> + <widget class="TQSpinBox" row="5" column="1"> <property name="name"> <cstring>portSpinBox</cstring> </property> @@ -142,7 +142,7 @@ <number>-1</number> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>TextLabel2</cstring> </property> @@ -155,7 +155,7 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> <cstring>Layout25</cstring> </property> @@ -180,7 +180,7 @@ <enum>Expanding</enum> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>PushButton1</cstring> </property> @@ -191,7 +191,7 @@ <bool>true</bool> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>PushButton2</cstring> </property> diff --git a/examples3/SQL/connect.ui.h b/examples3/SQL/connect.ui.h index cbeeabd..9d994ff 100644 --- a/examples3/SQL/connect.ui.h +++ b/examples3/SQL/connect.ui.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ui.h extension file, included from the uic-generated form implementation. ** -** If you wish to add, delete or rename slots use Qt Designer which will +** If you wish to add, delete or rename slots use TQt Designer which will ** update this file, preserving your code. Create an init() slot in place of ** a constructor, and a destroy() slot in place of a destructor. *****************************************************************************/ @@ -9,10 +9,10 @@ void ConnectDialog::init() { -from qtsql import QSqlDatabase +from qtsql import TQSqlDatabase #qDebug("ConnectDialog init") self.comboDriver.clear() -self.comboDriver.insertStringList(QSqlDatabase.drivers()) +self.comboDriver.insertStringList(TQSqlDatabase.drivers()) } void ConnectDialog::destroy() diff --git a/examples3/SQL/dbconnect.py b/examples3/SQL/dbconnect.py index fdae7de..6986d08 100755 --- a/examples3/SQL/dbconnect.py +++ b/examples3/SQL/dbconnect.py @@ -12,19 +12,19 @@ FALSE = 0 def createConnection(): driver = DB_DRIVER - # all qt examples use QSqlDatabase::addDatabase, but + # all qt examples use TQSqlDatabase::addDatabase, but # this never returns NULL in my experience - drivers = map(str, QSqlDatabase.drivers()) + drivers = map(str, TQSqlDatabase.drivers()) if driver in drivers: dlg = dbConnect(driver) #TODO: make connection parameters accessible return dlg.exec_loop() else: - QMessageBox.warning(None, "Database Error", + TQMessageBox.warning(None, "Database Error", "<%s> database driver not found!\n\n" "Please make sure, that this database adaptor\n" - "is available in your Qt installation.\n" % - (driver), QMessageBox.Abort | QMessageBox.Escape) + "is available in your TQt installation.\n" % + (driver), TQMessageBox.Abort | TQMessageBox.Escape) return FALSE class dbConnect(frmConnect): @@ -50,7 +50,7 @@ class dbConnect(frmConnect): self.database = self.cmbDatabase.currentText() self.username = self.txtName.text() self.password = self.txtPasswd.text() - db = QSqlDatabase.addDatabase(self.dbdriver) + db = TQSqlDatabase.addDatabase(self.dbdriver) if db: db.setHostName(self.hostname) db.setDatabaseName(self.database) @@ -59,7 +59,7 @@ class dbConnect(frmConnect): if db.open(): frmConnect.accept(self) else: - QMessageBox.warning(self, "Database Error", + TQMessageBox.warning(self, "Database Error", "Cannot open %s database on %s!\n\n%s\n%s\n" % (self.database, self.hostname, db.lastError().driverText(), @@ -67,15 +67,15 @@ class dbConnect(frmConnect): def buttonHelp_clicked(self): - QMessageBox.information(self, "About Connecting", + TQMessageBox.information(self, "About Connecting", "Here you specify userid, password, host and database\n" - "for the PyQt sql examples. If you encounter any problems,\n" + "for the PyTQt sql examples. If you encounter any problems,\n" "please read the README file in this folder before posting.\n\n" "Thanks,\nHans-Peter Jansen <hpj@urpla.net>\n") if __name__ == "__main__": - app = QApplication(sys.argv) + app = TQApplication(sys.argv) if createConnection(): print "ok" else: diff --git a/examples3/SQL/dbpar.py b/examples3/SQL/dbpar.py index 90e9270..19e6d9b 100644 --- a/examples3/SQL/dbpar.py +++ b/examples3/SQL/dbpar.py @@ -3,8 +3,8 @@ # you can create a local_dbpar.py module with definitons # of your own parameters to overrule these defaults -#DB_DRIVER = "QPSQL7" -DB_DRIVER = "QMYSQL3" +#DB_DRIVER = "TQPSQL7" +DB_DRIVER = "TQMYSQL3" # list of servers DB_HOSTNAMES = ["localhost"] # list of databases diff --git a/examples3/SQL/form1.ui b/examples3/SQL/form1.ui index 38b3cb2..118a84e 100644 --- a/examples3/SQL/form1.ui +++ b/examples3/SQL/form1.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.0" stdsetdef="1"> <class>Form1</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>Form1</cstring> </property> @@ -15,7 +15,7 @@ <property name="caption"> <string>Form1</string> </property> - <widget class="QDataTable"> + <widget class="TQDataTable"> <column> <property name="text"> <string>Forename</string> diff --git a/examples3/SQL/form2.ui b/examples3/SQL/form2.ui index ffe2beb..4856e39 100644 --- a/examples3/SQL/form2.ui +++ b/examples3/SQL/form2.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.0" stdsetdef="1"> <class>Form2</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>Form2</cstring> </property> @@ -15,7 +15,7 @@ <property name="caption"> <string>Form2</string> </property> - <widget class="QDataBrowser"> + <widget class="TQDataBrowser"> <property name="name"> <cstring>DataBrowser1</cstring> </property> @@ -49,7 +49,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> <cstring>Layout2</cstring> </property> @@ -63,7 +63,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>labelSurname</cstring> </property> @@ -71,9 +71,9 @@ <string>Surname</string> </property> </widget> - <widget class="QSpinBox" row="1" column="3"> + <widget class="TQSpinBox" row="1" column="3"> <property name="name"> - <cstring>QSpinBoxStatusid</cstring> + <cstring>TQSpinBoxStatusid</cstring> </property> <property name="maxValue"> <number>2147483647</number> @@ -86,9 +86,9 @@ </stringlist> </property> </widget> - <widget class="QLineEdit" row="1" column="1"> + <widget class="TQLineEdit" row="1" column="1"> <property name="name"> - <cstring>QLineEditSurname</cstring> + <cstring>TQLineEditSurname</cstring> </property> <property name="database" stdset="0"> <stringlist> @@ -98,7 +98,7 @@ </stringlist> </property> </widget> - <widget class="QLabel" row="1" column="2"> + <widget class="TQLabel" row="1" column="2"> <property name="name"> <cstring>labelStatusid</cstring> </property> @@ -106,7 +106,7 @@ <string>Statusid</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>labelForename</cstring> </property> @@ -114,9 +114,9 @@ <string>Forename</string> </property> </widget> - <widget class="QLineEdit" row="0" column="3"> + <widget class="TQLineEdit" row="0" column="3"> <property name="name"> - <cstring>QLineEditSalary</cstring> + <cstring>TQLineEditSalary</cstring> </property> <property name="alignment"> <set>AlignRight</set> @@ -129,7 +129,7 @@ </stringlist> </property> </widget> - <widget class="QLabel" row="0" column="2"> + <widget class="TQLabel" row="0" column="2"> <property name="name"> <cstring>labelSalary</cstring> </property> @@ -137,9 +137,9 @@ <string>Salary</string> </property> </widget> - <widget class="QLineEdit" row="0" column="1"> + <widget class="TQLineEdit" row="0" column="1"> <property name="name"> - <cstring>QLineEditForename</cstring> + <cstring>TQLineEditForename</cstring> </property> <property name="database" stdset="0"> <stringlist> @@ -151,7 +151,7 @@ </widget> </grid> </widget> - <widget class="QLayoutWidget" row="1" column="0"> + <widget class="TQLayoutWidget" row="1" column="0"> <property name="name"> <cstring>Layout3</cstring> </property> @@ -165,7 +165,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>PushButtonFirst</cstring> </property> @@ -173,7 +173,7 @@ <string>|< &First</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>PushButtonPrev</cstring> </property> @@ -181,7 +181,7 @@ <string><< &Prev</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>PushButtonNext</cstring> </property> @@ -189,7 +189,7 @@ <string>&Next >></string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>PushButtonLast</cstring> </property> @@ -199,7 +199,7 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget" row="2" column="0"> + <widget class="TQLayoutWidget" row="2" column="0"> <property name="name"> <cstring>Layout4</cstring> </property> @@ -213,7 +213,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>PushButtonInsert</cstring> </property> @@ -221,7 +221,7 @@ <string>&Insert</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>PushButtonUpdate</cstring> </property> @@ -229,7 +229,7 @@ <string>&Update</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>PushButtonDelete</cstring> </property> @@ -311,10 +311,10 @@ </connection> </connections> <tabstops> - <tabstop>QLineEditForename</tabstop> - <tabstop>QLineEditSurname</tabstop> - <tabstop>QLineEditSalary</tabstop> - <tabstop>QSpinBoxStatusid</tabstop> + <tabstop>TQLineEditForename</tabstop> + <tabstop>TQLineEditSurname</tabstop> + <tabstop>TQLineEditSalary</tabstop> + <tabstop>TQSpinBoxStatusid</tabstop> <tabstop>PushButtonFirst</tabstop> <tabstop>PushButtonPrev</tabstop> <tabstop>PushButtonNext</tabstop> diff --git a/examples3/SQL/frmconnect.py b/examples3/SQL/frmconnect.py index 23cd067..92cf3f6 100644 --- a/examples3/SQL/frmconnect.py +++ b/examples3/SQL/frmconnect.py @@ -1,7 +1,7 @@ # Form implementation generated from reading ui file 'frmconnect.ui' # # Created: Sam Jul 6 12:47:10 2002 -# by: The PyQt User Interface Compiler (pyuic) +# by: The PyTQt User Interface Compiler (pyuic) # # WARNING! All changes made in this file will be lost! @@ -9,9 +9,9 @@ from qt import * -class frmConnect(QDialog): +class frmConnect(TQDialog): def __init__(self,parent = None,name = None,modal = 0,fl = 0): - QDialog.__init__(self,parent,name,modal,fl) + TQDialog.__init__(self,parent,name,modal,fl) if name == None: self.setName("frmConnect") @@ -20,85 +20,85 @@ class frmConnect(QDialog): self.setCaption(self.trUtf8("Connecting")) self.setSizeGripEnabled(1) - frmConnectLayout = QGridLayout(self,1,1,11,6,"frmConnectLayout") + frmConnectLayout = TQGridLayout(self,1,1,11,6,"frmConnectLayout") - Layout7 = QVBoxLayout(None,0,6,"Layout7") + Layout7 = TQVBoxLayout(None,0,6,"Layout7") - self.buttonOK = QPushButton(self,"buttonOK") + self.buttonOK = TQPushButton(self,"buttonOK") self.buttonOK.setText(self.trUtf8("&OK")) self.buttonOK.setAutoDefault(1) self.buttonOK.setDefault(1) - QToolTip.add(self.buttonOK,self.trUtf8("Connect to Database")) + TQToolTip.add(self.buttonOK,self.trUtf8("Connect to Database")) Layout7.addWidget(self.buttonOK) - self.buttonCancel = QPushButton(self,"buttonCancel") + self.buttonCancel = TQPushButton(self,"buttonCancel") self.buttonCancel.setText(self.trUtf8("&Cancel")) - QToolTip.add(self.buttonCancel,self.trUtf8("Cancel Connecting")) + TQToolTip.add(self.buttonCancel,self.trUtf8("Cancel Connecting")) Layout7.addWidget(self.buttonCancel) - self.buttonHelp = QPushButton(self,"buttonHelp") + self.buttonHelp = TQPushButton(self,"buttonHelp") self.buttonHelp.setText(self.trUtf8("&Help")) - QToolTip.add(self.buttonHelp,self.trUtf8("About Connecting")) + TQToolTip.add(self.buttonHelp,self.trUtf8("About Connecting")) Layout7.addWidget(self.buttonHelp) - spacer = QSpacerItem(0,0,QSizePolicy.Minimum,QSizePolicy.Expanding) + spacer = TQSpacerItem(0,0,TQSizePolicy.Minimum,TQSizePolicy.Expanding) Layout7.addItem(spacer) frmConnectLayout.addLayout(Layout7,0,1) - self.grpConnection = QGroupBox(self,"grpConnection") + self.grpConnection = TQGroupBox(self,"grpConnection") self.grpConnection.setTitle(self.trUtf8("")) - self.grpConnection.setColumnLayout(0,Qt.Vertical) + self.grpConnection.setColumnLayout(0,TQt.Vertical) self.grpConnection.layout().setSpacing(6) self.grpConnection.layout().setMargin(11) - grpConnectionLayout = QGridLayout(self.grpConnection.layout()) - grpConnectionLayout.setAlignment(Qt.AlignTop) + grpConnectionLayout = TQGridLayout(self.grpConnection.layout()) + grpConnectionLayout.setAlignment(TQt.AlignTop) - self.txtName = QLineEdit(self.grpConnection,"txtName") + self.txtName = TQLineEdit(self.grpConnection,"txtName") self.txtName.setMaxLength(16) - QToolTip.add(self.txtName,self.trUtf8("Database User ID")) + TQToolTip.add(self.txtName,self.trUtf8("Database User ID")) grpConnectionLayout.addWidget(self.txtName,0,1) - self.lblDatabase = QLabel(self.grpConnection,"lblDatabase") + self.lblDatabase = TQLabel(self.grpConnection,"lblDatabase") self.lblDatabase.setText(self.trUtf8("&Database")) grpConnectionLayout.addWidget(self.lblDatabase,3,0) - self.lblServer = QLabel(self.grpConnection,"lblServer") + self.lblServer = TQLabel(self.grpConnection,"lblServer") self.lblServer.setText(self.trUtf8("&Server")) grpConnectionLayout.addWidget(self.lblServer,2,0) - self.lblName = QLabel(self.grpConnection,"lblName") + self.lblName = TQLabel(self.grpConnection,"lblName") self.lblName.setText(self.trUtf8("&Name")) grpConnectionLayout.addWidget(self.lblName,0,0) - self.cmbDatabase = QComboBox(0,self.grpConnection,"cmbDatabase") + self.cmbDatabase = TQComboBox(0,self.grpConnection,"cmbDatabase") self.cmbDatabase.setEditable(1) self.cmbDatabase.setAutoCompletion(1) self.cmbDatabase.setDuplicatesEnabled(0) - QToolTip.add(self.cmbDatabase,self.trUtf8("Database Name")) + TQToolTip.add(self.cmbDatabase,self.trUtf8("Database Name")) grpConnectionLayout.addWidget(self.cmbDatabase,3,1) - self.txtPasswd = QLineEdit(self.grpConnection,"txtPasswd") + self.txtPasswd = TQLineEdit(self.grpConnection,"txtPasswd") self.txtPasswd.setMaxLength(16) - self.txtPasswd.setEchoMode(QLineEdit.Password) - QToolTip.add(self.txtPasswd,self.trUtf8("Database User Password")) + self.txtPasswd.setEchoMode(TQLineEdit.Password) + TQToolTip.add(self.txtPasswd,self.trUtf8("Database User Password")) grpConnectionLayout.addWidget(self.txtPasswd,1,1) - self.lblPasswd = QLabel(self.grpConnection,"lblPasswd") + self.lblPasswd = TQLabel(self.grpConnection,"lblPasswd") self.lblPasswd.setText(self.trUtf8("&Password")) grpConnectionLayout.addWidget(self.lblPasswd,1,0) - self.cmbServer = QComboBox(0,self.grpConnection,"cmbServer") + self.cmbServer = TQComboBox(0,self.grpConnection,"cmbServer") self.cmbServer.setEditable(1) self.cmbServer.setAutoCompletion(1) self.cmbServer.setDuplicatesEnabled(0) - QToolTip.add(self.cmbServer,self.trUtf8("Database Server Address")) + TQToolTip.add(self.cmbServer,self.trUtf8("Database Server Address")) grpConnectionLayout.addWidget(self.cmbServer,2,1) diff --git a/examples3/SQL/frmconnect.ui b/examples3/SQL/frmconnect.ui index a6fc15c..f2017ee 100644 --- a/examples3/SQL/frmconnect.ui +++ b/examples3/SQL/frmconnect.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.0" stdsetdef="1"> <class>frmConnect</class> -<widget class="QDialog"> +<widget class="TQDialog"> <property name="name"> <cstring>frmConnect</cstring> </property> @@ -28,7 +28,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLayoutWidget" row="0" column="1"> + <widget class="TQLayoutWidget" row="0" column="1"> <property name="name"> <cstring>Layout7</cstring> </property> @@ -42,7 +42,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>buttonOK</cstring> </property> @@ -59,7 +59,7 @@ <string>Connect to Database</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>buttonCancel</cstring> </property> @@ -70,7 +70,7 @@ <string>Cancel Connecting</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>buttonHelp</cstring> </property> @@ -94,7 +94,7 @@ </spacer> </vbox> </widget> - <widget class="QGroupBox" row="0" column="0"> + <widget class="TQGroupBox" row="0" column="0"> <property name="name"> <cstring>grpConnection</cstring> </property> @@ -111,7 +111,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLineEdit" row="0" column="1"> + <widget class="TQLineEdit" row="0" column="1"> <property name="name"> <cstring>txtName</cstring> </property> @@ -122,7 +122,7 @@ <string>Database User ID</string> </property> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>lblDatabase</cstring> </property> @@ -133,7 +133,7 @@ <cstring>cmbDatabase</cstring> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>lblServer</cstring> </property> @@ -144,7 +144,7 @@ <cstring>cmbServer</cstring> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>lblName</cstring> </property> @@ -155,7 +155,7 @@ <cstring>txtName</cstring> </property> </widget> - <widget class="QComboBox" row="3" column="1"> + <widget class="TQComboBox" row="3" column="1"> <property name="name"> <cstring>cmbDatabase</cstring> </property> @@ -172,7 +172,7 @@ <string>Database Name</string> </property> </widget> - <widget class="QLineEdit" row="1" column="1"> + <widget class="TQLineEdit" row="1" column="1"> <property name="name"> <cstring>txtPasswd</cstring> </property> @@ -186,7 +186,7 @@ <string>Database User Password</string> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>lblPasswd</cstring> </property> @@ -197,7 +197,7 @@ <cstring>txtPasswd</cstring> </property> </widget> - <widget class="QComboBox" row="2" column="1"> + <widget class="TQComboBox" row="2" column="1"> <property name="name"> <cstring>cmbServer</cstring> </property> diff --git a/examples3/SQL/runform1.py b/examples3/SQL/runform1.py index d5760ce..b2b9951 100755 --- a/examples3/SQL/runform1.py +++ b/examples3/SQL/runform1.py @@ -11,9 +11,9 @@ class mainWindow(Form1): Form1.__init__(self,parent,name,fl) if __name__ == "__main__": - a = QApplication(sys.argv) + a = TQApplication(sys.argv) if createConnection(): - QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()")) + TQObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()")) w = mainWindow() a.setMainWidget(w) w.show() diff --git a/examples3/SQL/runform2.py b/examples3/SQL/runform2.py index ba0ca4a..485eed3 100755 --- a/examples3/SQL/runform2.py +++ b/examples3/SQL/runform2.py @@ -11,9 +11,9 @@ class mainWindow(Form2): Form2.__init__(self,parent,name,fl) if __name__ == "__main__": - a = QApplication(sys.argv) + a = TQApplication(sys.argv) if createConnection(): - QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()")) + TQObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()")) w = mainWindow() a.setMainWidget(w) w.show() diff --git a/examples3/SQL/runsqlex.py b/examples3/SQL/runsqlex.py index 7f2afa7..09f567d 100755 --- a/examples3/SQL/runsqlex.py +++ b/examples3/SQL/runsqlex.py @@ -13,30 +13,30 @@ TRUE = 1 FALSE = 0 def showError(err, parent): - errStr = QString("The database reported an error:\n\n") + errStr = TQString("The database reported an error:\n\n") if not err.databaseText().isEmpty(): errStr.append(err.databaseText()) errStr.append("\n") if not err.driverText().isEmpty(): errStr.append(err.driverText()) errStr.append("\n") - QMessageBox.warning(parent, "Error", errStr) + TQMessageBox.warning(parent, "Error", errStr) -class CustomSqlCursor(QSqlCursor): +class CustomSqlCursor(TQSqlCursor): def __init__(self, query = None, autopopulate = TRUE, db = None): - QSqlCursor.__init__(self, None, autopopulate, db) + TQSqlCursor.__init__(self, None, autopopulate, db) self.execQuery(query) if self.isSelect() and autopopulate: fields = self.driver().recordInfo(self) for f in fields: self.append(f) - self.setMode(QSqlCursor.ReadOnly) + self.setMode(TQSqlCursor.ReadOnly) - def select(self, filter, sort = QSqlIndex()): + def select(self, filter, sort = TQSqlIndex()): return self.execQuery(self.lastQuery()) def primaryIndex(self, prime = TRUE): - return QSqlIndex() + return TQSqlIndex() def insert(self, invalidate = TRUE): return FALSE @@ -68,21 +68,21 @@ class MainWindow(SqlEx): if str(self.conDiag.comboDriver.text(i)) == DB_DRIVER: self.conDiag.comboDriver.setCurrentItem(i) break - if self.conDiag.exec_loop() != QDialog.Accepted: + if self.conDiag.exec_loop() != TQDialog.Accepted: return if self.dt.sqlCursor(): self.dt.setSqlCursor() # close old connection (if any) - if QSqlDatabase.contains("SqlEx"): - oldDb = QSqlDatabase.database("SqlEx") + if TQSqlDatabase.contains("SqlEx"): + oldDb = TQSqlDatabase.database("SqlEx") oldDb.close() - QSqlDatabase.removeDatabase("SqlEx") + TQSqlDatabase.removeDatabase("SqlEx") # open the new connection - db = QSqlDatabase.addDatabase(self.conDiag.comboDriver.currentText(), "SqlEx") + db = TQSqlDatabase.addDatabase(self.conDiag.comboDriver.currentText(), "SqlEx") if not db: - QMessageBox.warning(self, "Error", "Could not open database") + TQMessageBox.warning(self, "Error", "Could not open database") return db.setHostName(self.conDiag.editHostname.text()) @@ -98,15 +98,15 @@ class MainWindow(SqlEx): tables = db.tables() for t in tables: - lvi = QListViewItem(self.lv, t) + lvi = TQListViewItem(self.lv, t) fields = db.recordInfo(t) for f in fields: req = "?" - if f.isRequired() > 0: + if f.isRetquired() > 0: req = "Yes" - elif f.isRequired() == 0: + elif f.isRetquired() == 0: req = "No" - fi = QListViewItem(lvi, f.name(), QVariant.typeToName(f.type()), req) + fi = TQListViewItem(lvi, f.name(), TQVariant.typeToName(f.type()), req) lvi.insertItem(fi) self.lv.insertItem(lvi) @@ -114,11 +114,11 @@ class MainWindow(SqlEx): def execQuery(self): cursor = CustomSqlCursor(self.te.text(), TRUE, - QSqlDatabase.database("SqlEx", TRUE)) + TQSqlDatabase.database("SqlEx", TRUE)) if cursor.isSelect(): self.dt.setSqlCursor(cursor, TRUE, TRUE) self.dt.refresh() - txt = QString("Query OK") + txt = TQString("Query OK") if cursor.size() >= 0: txt.append(", returned rows: %s" % cursor.size()) self.lbl.setText(txt) @@ -134,16 +134,16 @@ class MainWindow(SqlEx): i = item.parent() if not i: i = item - cursor = QSqlCursor(i.text(0), TRUE, QSqlDatabase.database("SqlEx", TRUE)) + cursor = TQSqlCursor(i.text(0), TRUE, TQSqlDatabase.database("SqlEx", TRUE)) self.dt.setSqlCursor(cursor, TRUE, TRUE) self.dt.setSort(cursor.primaryIndex()) - self.dt.refresh(QDataTable.RefreshAll) + self.dt.refresh(TQDataTable.RefreshAll) self.lbl.setText("Displaying table %s" % i.text(0)) if __name__ == "__main__": - a = QApplication(sys.argv) - QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()")) + a = TQApplication(sys.argv) + TQObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()")) w = MainWindow() a.setMainWidget(w) w.show() diff --git a/examples3/SQL/sqlcustom1.py b/examples3/SQL/sqlcustom1.py index cacb010..f708c1e 100755 --- a/examples3/SQL/sqlcustom1.py +++ b/examples3/SQL/sqlcustom1.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. #** #*****************************************************************************/ @@ -19,10 +19,10 @@ from dbconnect import createConnection TRUE = 1 FALSE = 0 -class CustomEdit(QLineEdit): +class CustomEdit(TQLineEdit): def __init__(self, parent = None, name = None): - QLineEdit.__init__(self, parent, name) - QObject.connect(self, SIGNAL("textChanged(const QString &)"), + TQLineEdit.__init__(self, parent, name) + TQObject.connect(self, SIGNAL("textChanged(const TQString &)"), self.changed) def changed(self, line): @@ -33,20 +33,20 @@ class CustomEdit(QLineEdit): self.setText(self.upperLineText) -class FormDialog(QDialog): +class FormDialog(TQDialog): def __init__(self): - QDialog.__init__(self) - forenameLabel = QLabel("Forename:", self) + TQDialog.__init__(self) + forenameLabel = TQLabel("Forename:", self) forenameEdit = CustomEdit(self) - surnameLabel = QLabel("Surname:", self) + surnameLabel = TQLabel("Surname:", self) surnameEdit = CustomEdit(self) - salaryLabel = QLabel("Salary:", self) - salaryEdit = QLineEdit(self) - salaryEdit.setAlignment(Qt.AlignRight) - saveButton = QPushButton("&Save", self) + salaryLabel = TQLabel("Salary:", self) + salaryEdit = TQLineEdit(self) + salaryEdit.setAlignment(TQt.AlignRight) + saveButton = TQPushButton("&Save", self) self.connect(saveButton, SIGNAL("clicked()"), self.save) - grid = QGridLayout(self) + grid = TQGridLayout(self) grid.addWidget(forenameLabel, 0, 0) grid.addWidget(forenameEdit, 0, 1) grid.addWidget(surnameLabel, 1, 0) @@ -56,17 +56,17 @@ class FormDialog(QDialog): grid.addWidget(saveButton, 3, 0) grid.activate() - self.staffCursor = QSqlCursor("staff") + self.staffCursor = TQSqlCursor("staff") self.staffCursor.setTrimmed("forename", TRUE) self.staffCursor.setTrimmed("surname", TRUE) self.idIndex = self.staffCursor.index("id") self.staffCursor.select(self.idIndex) self.staffCursor.first() - self.propMap = QSqlPropertyMap() + self.propMap = TQSqlPropertyMap() self.propMap.insert(forenameEdit.className(), "upperLine") - self.sqlForm = QSqlForm() + self.sqlForm = TQSqlForm() self.sqlForm.setRecord(self.staffCursor.primeUpdate()) self.sqlForm.installPropertyMap(self.propMap) self.sqlForm.insert(forenameEdit, "forename") @@ -82,7 +82,7 @@ class FormDialog(QDialog): if __name__=='__main__': - app = QApplication( sys.argv ) + app = TQApplication( sys.argv ) if createConnection(): formDialog = FormDialog() diff --git a/examples3/SQL/sqlex.ui b/examples3/SQL/sqlex.ui index 022fed9..5b9303d 100644 --- a/examples3/SQL/sqlex.ui +++ b/examples3/SQL/sqlex.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.0" stdsetdef="1"> <class>SqlEx</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>SqlEx</cstring> </property> @@ -25,7 +25,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLayoutWidget" row="1" column="0"> + <widget class="TQLayoutWidget" row="1" column="0"> <property name="name"> <cstring>Layout23</cstring> </property> @@ -39,7 +39,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>lbl</cstring> </property> @@ -47,7 +47,7 @@ <string>Press "Connect" to open a database</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>conBtn</cstring> </property> @@ -71,21 +71,21 @@ </widget> </hbox> </widget> - <widget class="QSplitter" row="0" column="0"> + <widget class="TQSplitter" row="0" column="0"> <property name="name"> <cstring>vsplit</cstring> </property> <property name="orientation"> <enum>Vertical</enum> </property> - <widget class="QSplitter"> + <widget class="TQSplitter"> <property name="name"> <cstring>hsplit</cstring> </property> <property name="orientation"> <enum>Horizontal</enum> </property> - <widget class="QListView"> + <widget class="TQListView"> <column> <property name="text"> <string>Tables</string> @@ -110,7 +110,7 @@ </column> <column> <property name="text"> - <string>Required</string> + <string>Retquired</string> </property> <property name="clickable"> <bool>true</bool> @@ -135,7 +135,7 @@ <enum>LastColumn</enum> </property> </widget> - <widget class="QDataTable"> + <widget class="TQDataTable"> <property name="name"> <cstring>dt</cstring> </property> @@ -144,7 +144,7 @@ </property> </widget> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>gb</cstring> </property> @@ -161,7 +161,7 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> <cstring>Layout22</cstring> </property> @@ -175,12 +175,12 @@ <property name="spacing"> <number>6</number> </property> - <widget class="QTextEdit"> + <widget class="TQTextEdit"> <property name="name"> <cstring>te</cstring> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> <cstring>Layout21</cstring> </property> @@ -205,7 +205,7 @@ <enum>Expanding</enum> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>submitBtn</cstring> </property> @@ -227,7 +227,7 @@ <string>&Submit</string> </property> </widget> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>clearBtn</cstring> </property> @@ -273,15 +273,15 @@ </connection> <connection> <sender>lv</sender> - <signal>returnPressed(QListViewItem*)</signal> + <signal>returnPressed(TQListViewItem*)</signal> <receiver>SqlEx</receiver> - <slot>showTable(QListViewItem*)</slot> + <slot>showTable(TQListViewItem*)</slot> </connection> <connection> <sender>lv</sender> - <signal>doubleClicked(QListViewItem*)</signal> + <signal>doubleClicked(TQListViewItem*)</signal> <receiver>SqlEx</receiver> - <slot>showTable(QListViewItem*)</slot> + <slot>showTable(TQListViewItem*)</slot> </connection> <connection> <sender>submitBtn</sender> @@ -296,7 +296,7 @@ <slots> <slot>init()</slot> <slot>dbConnect()</slot> - <slot>showTable( QListViewItem * )</slot> + <slot>showTable( TQListViewItem * )</slot> <slot>execQuery()</slot> </slots> <layoutdefaults spacing="6" margin="11"/> diff --git a/examples3/SQL/sqlex.ui.h b/examples3/SQL/sqlex.ui.h index 1acdc5d..07edcd0 100644 --- a/examples3/SQL/sqlex.ui.h +++ b/examples3/SQL/sqlex.ui.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ui.h extension file, included from the uic-generated form implementation. ** -** If you wish to add, delete or rename slots use Qt Designer which will +** If you wish to add, delete or rename slots use TQt Designer which will ** update this file, preserving your code. Create an init() slot in place of ** a constructor, and a destroy() slot in place of a destructor. *****************************************************************************/ @@ -10,8 +10,8 @@ void SqlEx::init() { self.hsplit.setSizes([250]) -self.hsplit.setResizeMode(self.lv, QSplitter.KeepSize) -self.vsplit.setResizeMode(self.gb, QSplitter.KeepSize) +self.hsplit.setResizeMode(self.lv, TQSplitter.KeepSize) +self.vsplit.setResizeMode(self.gb, TQSplitter.KeepSize) self.submitBtn.setEnabled(0) } @@ -22,7 +22,7 @@ void SqlEx::dbConnect() } -void SqlEx::showTable( QListViewItem * ) +void SqlEx::showTable( TQListViewItem * ) { } diff --git a/examples3/SQL/sqlsubclass5.py b/examples3/SQL/sqlsubclass5.py index 137ff93..07cc90a 100755 --- a/examples3/SQL/sqlsubclass5.py +++ b/examples3/SQL/sqlsubclass5.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. #** #*****************************************************************************/ @@ -19,16 +19,16 @@ from dbconnect import createConnection TRUE = 1 FALSE = 0 -class CustomTable(QDataTable): +class CustomTable(TQDataTable): def __init__(self, cursor, autoPopulate = FALSE, parent = None, name = None): - QDataTable.__init__(self, cursor, autoPopulate, parent, name) + TQDataTable.__init__(self, cursor, autoPopulate, parent, name) def paintField(self, p, field, cr, b): if not field: return fn = str(field.name()) if fn == "pricesid": - query = QSqlQuery("SELECT name FROM prices WHERE id=%s" % + query = TQSqlQuery("SELECT name FROM prices WHERE id=%s" % field.value().toString()) value = "" if query.next(): @@ -37,78 +37,78 @@ class CustomTable(QDataTable): self.fieldAlignment(field), value) elif fn == "quantity": p.drawText(2, 2, cr.width()-6, cr.height()-4, - Qt.AlignRight|Qt.AlignVCenter, field.value().toString()) + TQt.AlignRight|TQt.AlignVCenter, field.value().toString()) elif fn in ("price", "cost"): v = field.value().toDouble() if v < 0: - p.setPen(QColor("red")) - value = QString(u"%.2f \u20ac" % v) + p.setPen(TQColor("red")) + value = TQString(u"%.2f \u20ac" % v) p.drawText(2, 2, cr.width()-6, cr.height()-4, - Qt.AlignRight|Qt.AlignVCenter, value) + TQt.AlignRight|TQt.AlignVCenter, value) elif fn == "paiddate": if field.value().toDate().isNull(): - v = QString("not yet") - p.setPen(QColor("red")) + v = TQString("not yet") + p.setPen(TQColor("red")) else: - v = field.value().toDate().toString(Qt.LocalDate) + v = field.value().toDate().toString(TQt.LocalDate) p.drawText(2, 2, cr.width()-4, cr.height()-4, - Qt.AlignHCenter|Qt.AlignVCenter, v) + TQt.AlignHCenter|TQt.AlignVCenter, v) else: - QDataTable.paintField(self, p, field, cr, b) + TQDataTable.paintField(self, p, field, cr, b) -class InvoiceItemCursor(QSqlCursor): +class InvoiceItemCursor(TQSqlCursor): def __init__(self): - QSqlCursor.__init__(self, "invoiceitem") + TQSqlCursor.__init__(self, "invoiceitem") - productPrice = QSqlFieldInfo("price", QVariant.Double) + productPrice = TQSqlFieldInfo("price", TQVariant.Double) self.append(productPrice) self.setCalculated(productPrice.name(), TRUE) - productCost = QSqlFieldInfo("cost", QVariant.Double) + productCost = TQSqlFieldInfo("cost", TQVariant.Double) self.append(productCost) self.setCalculated(productCost.name(), TRUE) def calculateField(self, name): fn = str(name) if fn == "productname": - query = QSqlQuery("SELECT name FROM prices WHERE id=%d;" % + query = TQSqlQuery("SELECT name FROM prices WHERE id=%d;" % (self.field("pricesid").value().toInt())) if query.next(): return query.value(0) elif fn == "price": - query = QSqlQuery("SELECT price FROM prices WHERE id=%d;" % + query = TQSqlQuery("SELECT price FROM prices WHERE id=%d;" % (self.field("pricesid").value().toInt())) if query.next(): return query.value(0) elif fn == "cost": - query = QSqlQuery("SELECT price FROM prices WHERE id=%d;" % + query = TQSqlQuery("SELECT price FROM prices WHERE id=%d;" % (self.field("pricesid").value().toInt())) if query.next(): - return QVariant(query.value(0).toDouble() * + return TQVariant(query.value(0).toDouble() * self.value("quantity").toDouble()) - return QVariant(QString.null) + return TQVariant(TQString.null) def primeInsert(self): buffer = self.editBuffer() - buffer.setValue("id", QVariant(0)) - buffer.setValue("paiddate", QVariant(QDate.currentDate())) - buffer.setValue("quantity", QVariant(1)) + buffer.setValue("id", TQVariant(0)) + buffer.setValue("paiddate", TQVariant(TQDate.currentDate())) + buffer.setValue("quantity", TQVariant(1)) return buffer -class ProductPicker(QComboBox): +class ProductPicker(TQComboBox): def __init__(self, parent = None, name = None): - QComboBox.__init__(self, parent, name) - cur = QSqlCursor("prices") + TQComboBox.__init__(self, parent, name) + cur = TQSqlCursor("prices") cur.select(cur.index("id")) while cur.next(): self.insertItem(cur.value("name").toString(), cur.value("id").toInt()) -class CustomSqlEditorFactory(QSqlEditorFactory): +class CustomSqlEditorFactory(TQSqlEditorFactory): def __init__(self): - QSqlEditorFactory.__init__(self) + TQSqlEditorFactory.__init__(self) def createEditor(self, parent, field): try: @@ -116,13 +116,13 @@ class CustomSqlEditorFactory(QSqlEditorFactory): return ProductPicker(parent) except AttributeError: pass - return QSqlEditorFactory.createEditor(self, parent, field) + return TQSqlEditorFactory.createEditor(self, parent, field) class Table(CustomTable): def __init__(self): self.invoiceItemCursor = InvoiceItemCursor() - QDataTable.__init__(self, self.invoiceItemCursor) - self.propMap = QSqlPropertyMap() + TQDataTable.__init__(self, self.invoiceItemCursor) + self.propMap = TQSqlPropertyMap() self.editorFactory = CustomSqlEditorFactory() self.propMap.insert("ProductPicker", "pricesid") self.installPropertyMap(self.propMap) @@ -141,7 +141,7 @@ class Table(CustomTable): if __name__=='__main__': - app = QApplication(sys.argv) + app = TQApplication(sys.argv) if createConnection(): t = Table() app.setMainWidget(t) diff --git a/examples3/SQL/sqltable4.py b/examples3/SQL/sqltable4.py index 8f488d3..001e897 100755 --- a/examples3/SQL/sqltable4.py +++ b/examples3/SQL/sqltable4.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. #** #*****************************************************************************/ @@ -19,9 +19,9 @@ from dbconnect import createConnection TRUE = 1 FALSE = 0 -class CustomTable(QDataTable): +class CustomTable(TQDataTable): def __init__(self, cursor, autoPopulate = FALSE, parent = None, name = None): - QDataTable.__init__(self, cursor, autoPopulate, parent, name) + TQDataTable.__init__(self, cursor, autoPopulate, parent, name) def paintField(self, p, field, cr, b): if not field: @@ -30,13 +30,13 @@ class CustomTable(QDataTable): if fn in ("salary", "monsalary"): v = field.value().toDouble() if v < 0: - p.setPen(QColor("red")) - value = QString(u"%.2f \u20ac" % v) + p.setPen(TQColor("red")) + value = TQString(u"%.2f \u20ac" % v) #print unicode(value).encode("iso-8859-15") p.drawText(2, 2, cr.width()-6, cr.height()-4, - Qt.AlignRight|Qt.AlignVCenter, value) + TQt.AlignRight|TQt.AlignVCenter, value) elif fn == "statusid": - query = QSqlQuery("SELECT name FROM status WHERE id=%s" % + query = TQSqlQuery("SELECT name FROM status WHERE id=%s" % field.value().toString()) value = "" if query.next(): @@ -44,21 +44,21 @@ class CustomTable(QDataTable): p.drawText(2, 2, cr.width()-4, cr.height()-4, self.fieldAlignment(field), value) else: - QDataTable.paintField(self, p, field, cr, b) + TQDataTable.paintField(self, p, field, cr, b) -class StatusPicker(QComboBox): +class StatusPicker(TQComboBox): def __init__(self, parent = None, name = None): - QComboBox.__init__(self, parent, name) - cur = QSqlCursor("status") + TQComboBox.__init__(self, parent, name) + cur = TQSqlCursor("status") cur.select(cur.index("id")) while cur.next(): self.insertItem(cur.value("name").toString(), cur.value("id").toInt()) -class CustomSqlEditorFactory(QSqlEditorFactory): +class CustomSqlEditorFactory(TQSqlEditorFactory): def __init__(self): - QSqlEditorFactory.__init__(self) + TQSqlEditorFactory.__init__(self) def createEditor(self, parent, field): try: @@ -66,28 +66,28 @@ class CustomSqlEditorFactory(QSqlEditorFactory): return StatusPicker(parent) except AttributeError: pass - return QSqlEditorFactory.createEditor(self, parent, field) + return TQSqlEditorFactory.createEditor(self, parent, field) -class StaffCursor(QSqlCursor): +class StaffCursor(TQSqlCursor): def __init__(self): - QSqlCursor.__init__(self, "staff") - monSalary = QSqlFieldInfo("monsalary", QVariant.Double) + TQSqlCursor.__init__(self, "staff") + monSalary = TQSqlFieldInfo("monsalary", TQVariant.Double) self.append(monSalary) self.setCalculated(monSalary.name(), TRUE) def calculateField(self, name): if str(name) == "monsalary": - return QVariant(self.value("salary").toDouble() / 12) - return QVariant(QString.null) + return TQVariant(self.value("salary").toDouble() / 12) + return TQVariant(TQString.null) class Table(CustomTable): def __init__(self): - #self.staffCursor = QSqlCursor("staff") + #self.staffCursor = TQSqlCursor("staff") self.staffCursor = StaffCursor() - QDataTable.__init__(self, self.staffCursor) - self.propMap = QSqlPropertyMap() + TQDataTable.__init__(self, self.staffCursor) + self.propMap = TQSqlPropertyMap() self.editorFactory = CustomSqlEditorFactory() self.propMap.insert("StatusPicker", "statusid") self.installPropertyMap(self.propMap) @@ -98,15 +98,15 @@ class Table(CustomTable): ("monsalary","Monthly Salary"), ("statusid", "Status")): self.addColumn(cn, ch) - self.order = QStringList("surname") + self.order = TQStringList("surname") self.order.append("forename") self.setSort(self.order) self.refresh() if __name__=='__main__': - app = QApplication(sys.argv) - #app.setFont(QFont("Verdana", 11)) + app = TQApplication(sys.argv) + #app.setFont(TQFont("Verdana", 11)) if createConnection(): t = Table() diff --git a/examples3/SQL/testdb_pg.sql b/examples3/SQL/testdb_pg.sql index 73a4270..ef0479f 100644 --- a/examples3/SQL/testdb_pg.sql +++ b/examples3/SQL/testdb_pg.sql @@ -93,34 +93,34 @@ CREATE TABLE "invoiceitem" ( -- -- TOC Entry ID 2 (OID 17351) -- --- Name: people_id_seq Type: SEQUENCE Owner: postgres +-- Name: people_id_seq Type: SETQUENCE Owner: postgres -- -CREATE SEQUENCE "people_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; +CREATE SETQUENCE "people_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; -- -- TOC Entry ID 4 (OID 17353) -- --- Name: staff_id_seq Type: SEQUENCE Owner: postgres +-- Name: staff_id_seq Type: SETQUENCE Owner: postgres -- -CREATE SEQUENCE "staff_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; +CREATE SETQUENCE "staff_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; -- -- TOC Entry ID 6 (OID 17355) -- --- Name: creditors_id_seq Type: SEQUENCE Owner: postgres +-- Name: creditors_id_seq Type: SETQUENCE Owner: postgres -- -CREATE SEQUENCE "creditors_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; +CREATE SETQUENCE "creditors_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; -- -- TOC Entry ID 8 (OID 17357) -- --- Name: invoice_id_seq Type: SEQUENCE Owner: postgres +-- Name: invoice_id_seq Type: SETQUENCE Owner: postgres -- -CREATE SEQUENCE "invoice_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; +CREATE SETQUENCE "invoice_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; -- -- Data for TOC Entry ID 28 (OID 17332) @@ -201,7 +201,7 @@ COPY "invoiceitem" FROM stdin; -- -- TOC Entry ID 3 (OID 17351) -- --- Name: people_id_seq Type: SEQUENCE SET Owner: postgres +-- Name: people_id_seq Type: SETQUENCE SET Owner: postgres -- SELECT setval ('"people_id_seq"', 1, false); @@ -209,7 +209,7 @@ SELECT setval ('"people_id_seq"', 1, false); -- -- TOC Entry ID 5 (OID 17353) -- --- Name: staff_id_seq Type: SEQUENCE SET Owner: postgres +-- Name: staff_id_seq Type: SETQUENCE SET Owner: postgres -- SELECT setval ('"staff_id_seq"', 8, true); @@ -217,7 +217,7 @@ SELECT setval ('"staff_id_seq"', 8, true); -- -- TOC Entry ID 7 (OID 17355) -- --- Name: creditors_id_seq Type: SEQUENCE SET Owner: postgres +-- Name: creditors_id_seq Type: SETQUENCE SET Owner: postgres -- SELECT setval ('"creditors_id_seq"', 1, false); @@ -225,7 +225,7 @@ SELECT setval ('"creditors_id_seq"', 1, false); -- -- TOC Entry ID 9 (OID 17357) -- --- Name: invoice_id_seq Type: SEQUENCE SET Owner: postgres +-- Name: invoice_id_seq Type: SETQUENCE SET Owner: postgres -- SELECT setval ('"invoice_id_seq"', 1, false); diff --git a/examples3/aclock.py b/examples3/aclock.py index 38ed36c..9fc773b 100755 --- a/examples3/aclock.py +++ b/examples3/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/examples3/addressbook.py b/examples3/addressbook.py index d7316e3..e151996 100755 --- a/examples3/addressbook.py +++ b/examples3/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/examples3/application.py b/examples3/application.py index f5c027d..c0224f3 100755 --- a/examples3/application.py +++ b/examples3/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(QIconSet(openIcon),'Open File',QString.null,self.load,self.fileTools,'open file') + openIcon = TQPixmap(fileopen) + self.fileOpen = TQToolButton(TQIconSet(openIcon),'Open File',TQString.null,self.load,self.fileTools,'open file') - saveIcon = QPixmap(filesave) - self.fileSave = QToolButton(QIconSet(saveIcon),'Save File',QString.null,self.save,self.fileTools,'save file') + saveIcon = TQPixmap(filesave) + self.fileSave = TQToolButton(TQIconSet(saveIcon),'Save File',TQString.null,self.save,self.fileTools,'save file') - printIcon = QPixmap(fileprint) - self.filePrint = QToolButton(QIconSet(printIcon),'Print File',QString.null,self.printDoc,self.fileTools,'print file') + printIcon = TQPixmap(fileprint) + self.filePrint = TQToolButton(TQIconSet(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/examples3/biff.py b/examples3/biff.py index ee5bfe3..1758a7e 100755 --- a/examples3/biff.py +++ b/examples3/biff.py @@ -5,7 +5,7 @@ from qt import * if QT_VERSION < 0x030100: - print "This example requires Qt v3.1.0 or later." + print "This example retquires TQt v3.1.0 or later." sys.exit(1) @@ -122,12 +122,12 @@ nomail_bmp_data = [ "++++++++++++++++++++++++++++++++++++++++++++++++" ] -class Biff(QWidget): +class Biff(TQWidget): def __init__(self): - QWidget.__init__(self, None, "Biff - example application") + TQWidget.__init__(self, None, "Biff - example application") mail = os.getenv("MAIL") - fi = QFileInfo(mail); + fi = TQFileInfo(mail); if not fi.exists(): s = "/var/spool/mail/"+os.getenv("USER") fi.setFile(s) @@ -140,14 +140,14 @@ class Biff(QWidget): self.setMaximumSize(48, 48) self.resize(48, 48) - self.hasNewMail = QPixmap(hasmail_bmp_data) - self.noNewMail = QPixmap(nomail_bmp_data) + self.hasNewMail = TQPixmap(hasmail_bmp_data) + self.noNewMail = TQPixmap(nomail_bmp_data) self.gotMail = FALSE self.lastModified = fi.lastModified() def timerEvent(self, te): - fi = QFileInfo(self.mailbox) + fi = TQFileInfo(self.mailbox) newState = ( fi.lastModified().toTime_t() != self.lastModified.toTime_t() and fi.lastModified().toTime_t() > fi.lastRead().toTime_t()) if newState != self.gotMail: if self.gotMail == TRUE: @@ -162,11 +162,11 @@ class Biff(QWidget): bitBlt(self, 0, 0, self.noNewMail) def mousePressEvent(self, me): - fi = QFileInfo(self.mailbox) + fi = TQFileInfo(self.mailbox) lastModified = fi.lastModified() -a = QApplication(sys.argv) +a = TQApplication(sys.argv) b = Biff() a.setMainWidget(b) b.show() diff --git a/examples3/bigtable.py b/examples3/bigtable.py index da17619..61fcb71 100755 --- a/examples3/bigtable.py +++ b/examples3/bigtable.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. #** #*****************************************************************************/ @@ -21,9 +21,9 @@ FALSE = 0 numRows = 1000000 numCols = 1000000 -class MyTable(QTable): +class MyTable(TQTable): def __init__(self, r, c): - QTable.__init__(self, r, c) + TQTable.__init__(self, r, c) self.items = {} self.widgets = {} self.setCaption("This is a big table with 1.000.000x1.000.000 cells...") @@ -64,7 +64,7 @@ class MyTable(QTable): if __name__ == '__main__': - app = QApplication(sys.argv) + app = TQApplication(sys.argv) table = MyTable(numRows, numCols) app.setMainWidget(table) diff --git a/examples3/buttongroups.py b/examples3/buttongroups.py index c998a88..65b8a96 100755 --- a/examples3/buttongroups.py +++ b/examples3/buttongroups.py @@ -4,7 +4,7 @@ #** #** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. #** -#** This file is part of an example program for Qt. This example +#** This file is part of an example program for TQt. This example #** program may be used, distributed and modified without limitation. #** #*****************************************************************************/ @@ -19,58 +19,58 @@ FALSE = 0 # Creates all child widgets of the ButtonGroups window ## -class ButtonsGroups( QWidget ): +class ButtonsGroups( TQWidget ): def __init__( self, *args ): - apply( QWidget.__init__, (self,) + args ) + apply( TQWidget.__init__, (self,) + args ) # Create Widgets which allow easy layouting - self.vbox = QVBoxLayout( self, 11, 6 ) - self.box1 = QHBoxLayout( self.vbox ) - self.box2 = QHBoxLayout( self.vbox ) + self.vbox = TQVBoxLayout( self, 11, 6 ) + self.box1 = TQHBoxLayout( self.vbox ) + self.box2 = TQHBoxLayout( self.vbox ) # ------- first group # Create an exclusive button group - self.grp1 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 1 (exclusive)", self ) + self.grp1 = TQButtonGroup( 1, TQGroupBox.Horizontal, "Button Group 1 (exclusive)", self ) self.box1.addWidget( self.grp1 ) self.grp1.setExclusive( TRUE ) # insert 3 radiobuttons - self.rb11 = QRadioButton( "&Radiobutton 1", self.grp1 ) + self.rb11 = TQRadioButton( "&Radiobutton 1", self.grp1 ) self.rb11.setChecked( TRUE ) - QRadioButton( "R&adiobutton 2", self.grp1 ) - QRadioButton( "Ra&diobutton 3", self.grp1 ) + TQRadioButton( "R&adiobutton 2", self.grp1 ) + TQRadioButton( "Ra&diobutton 3", self.grp1 ) # ------- second group # Create a non-exclusive buttongroup - self.grp2 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 2 (non-exclusive)", self ) + self.grp2 = TQButtonGroup( 1, TQGroupBox.Horizontal, "Button Group 2 (non-exclusive)", self ) self.box1.addWidget( self.grp2 ) self.grp2.setExclusive( FALSE ) # insert 3 checkboxes - QCheckBox( "&Checkbox 1", self.grp2 ) - self.cb12 = QCheckBox( "C&heckbox 2", self.grp2 ) + TQCheckBox( "&Checkbox 1", self.grp2 ) + self.cb12 = TQCheckBox( "C&heckbox 2", self.grp2 ) self.cb12.setChecked( TRUE ) - self.cb13 = QCheckBox( "Triple &State Button", self.grp2 ) + self.cb13 = TQCheckBox( "Triple &State Button", self.grp2 ) self.cb13.setTristate( TRUE ) self.cb13.setChecked( TRUE ) # ------------ third group # create a buttongroup which is exclusive for radiobuttons and non-exclusive for all other buttons - self.grp3 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 3 (Radiobutton-exclusive)", self ) + self.grp3 = TQButtonGroup( 1, TQGroupBox.Horizontal, "Button Group 3 (Radiobutton-exclusive)", self ) self.box2.addWidget( self.grp3 ) self.grp3.setRadioButtonExclusive( TRUE ) # insert three radiobuttons - self.rb21 = QRadioButton( "Rad&iobutton 1", self.grp3 ) - self.rb22 = QRadioButton( "Radi&obutton 2", self.grp3 ) - self.rb23 = QRadioButton( "Radio&button 3", self.grp3 ) + self.rb21 = TQRadioButton( "Rad&iobutton 1", self.grp3 ) + self.rb22 = TQRadioButton( "Radi&obutton 2", self.grp3 ) + self.rb23 = TQRadioButton( "Radio&button 3", self.grp3 ) self.rb23.setChecked( TRUE ) # insert a checkbox... - self.state = QCheckBox( "E&nable Radiobuttons", self.grp3 ) + self.state = TQCheckBox( "E&nable Radiobuttons", self.grp3 ) self.state.setChecked( TRUE ) # ...and connect its SIGNAL clicked() with the SLOT slotChangeGrp3State() self.connect( self.state, SIGNAL( "clicked()" ), self.slotChangeGrp3State ) @@ -78,24 +78,24 @@ class ButtonsGroups( QWidget ): # ------------ fourth group # create a groupbox which layouts its childs in a columns - self.grp4 = QButtonGroup( 1, QGroupBox.Horizontal, "Groupbox with normal buttons", self ) + self.grp4 = TQButtonGroup( 1, TQGroupBox.Horizontal, "Groupbox with normal buttons", self ) self.box2.addWidget( self.grp4 ) # insert two pushbuttons... - QPushButton( "&Push Button", self.grp4 ) - self.tb2 = QPushButton( "&Toggle Button", self.grp4 ) + TQPushButton( "&Push Button", self.grp4 ) + self.tb2 = TQPushButton( "&Toggle Button", self.grp4 ) # ... and make the second one a toggle button self.tb2.setToggleButton( TRUE ) self.tb2.setOn( TRUE ) # ... and make the third one a flat button - self.tb3 = QPushButton( "&Flat Button", self.grp4 ) + self.tb3 = TQPushButton( "&Flat Button", self.grp4 ) self.tb3.setFlat( TRUE ) # .. and the fourth a button with a menu - self.tb4 = QPushButton( "Popup Button", self.grp4 ) - menu = QPopupMenu(self.tb4) + self.tb4 = TQPushButton( "Popup Button", self.grp4 ) + menu = TQPopupMenu(self.tb4) menu.insertItem("Item1", 0) menu.insertItem("Item2", 0) menu.insertItem("Item3", 0) @@ -114,7 +114,7 @@ class ButtonsGroups( QWidget ): ## main program -a = QApplication( sys.argv ) +a = TQApplication( sys.argv ) buttonsgroups = ButtonsGroups() buttonsgroups.resize( 500, 250 ) diff --git a/examples3/canvas/butterfly.png b/examples3/canvas/butterfly.png Binary files differindex d8912d2..5d82201 100644 --- a/examples3/canvas/butterfly.png +++ b/examples3/canvas/butterfly.png diff --git a/examples3/canvas/canvas.py b/examples3/canvas/canvas.py index 178a6e6..7d36592 100755 --- a/examples3/canvas/canvas.py +++ b/examples3/canvas/canvas.py @@ -8,22 +8,22 @@ import random True = 1 False = 0 -butterfly_fn = QString.null +butterfly_fn = TQString.null butterflyimg = [] -logo_fn = QString.null +logo_fn = TQString.null logoimg = [] bouncy_logo = None views = [] -class ImageItem(QCanvasRectangle): +class ImageItem(TQCanvasRectangle): def __init__(self,img,canvas): - QCanvasRectangle.__init__(self,canvas) + TQCanvasRectangle.__init__(self,canvas) self.imageRTTI=984376 self.image=img - self.pixmap=QPixmap() + self.pixmap=TQPixmap() self.setSize(self.image.width(), self.image.height()) - self.pixmap.convertFromImage(self.image, Qt.OrderedAlphaDither); + self.pixmap.convertFromImage(self.image, TQt.OrderedAlphaDither); def rtti(self): return self.imageRTTI @@ -40,13 +40,13 @@ class ImageItem(QCanvasRectangle): p.drawPixmap( self.x(), self.y(), self.pixmap ) -class NodeItem(QCanvasEllipse): +class NodeItem(TQCanvasEllipse): def __init__(self,canvas): - QCanvasEllipse.__init__(self,6,6,canvas) + TQCanvasEllipse.__init__(self,6,6,canvas) self.__inList=[] self.__outList=[] - self.setPen(QPen(Qt.black)) - self.setBrush(QBrush(Qt.red)) + self.setPen(TQPen(TQt.black)) + self.setBrush(TQBrush(TQt.red)) self.setZ(128) def addInEdge(self,edge): @@ -56,19 +56,19 @@ class NodeItem(QCanvasEllipse): self.__outList.append(edge) def moveBy(self,dx,dy): - QCanvasEllipse.moveBy(self,dx,dy) + TQCanvasEllipse.moveBy(self,dx,dy) for each_edge in self.__inList: each_edge.setToPoint( int(self.x()), int(self.y()) ) for each_edge in self.__outList: each_edge.setFromPoint( int(self.x()), int(self.y()) ) -class EdgeItem(QCanvasLine): +class EdgeItem(TQCanvasLine): __c=0 def __init__(self,fromNode, toNode,canvas): - QCanvasLine.__init__(self,canvas) + TQCanvasLine.__init__(self,canvas) self.__c=self.__c+1 - self.setPen(QPen(Qt.black)) - self.setBrush(QBrush(Qt.red)) + self.setPen(TQPen(TQt.black)) + self.setBrush(TQBrush(TQt.red)) fromNode.addOutEdge(self) toNode.addInEdge(self) self.setPoints(int(fromNode.x()),int(fromNode.y()), int(toNode.x()), int(toNode.y())) @@ -87,15 +87,15 @@ class EdgeItem(QCanvasLine): pass -class FigureEditor(QCanvasView): +class FigureEditor(TQCanvasView): def __init__(self,c,parent,name,f): - QCanvasView.__init__(self,c,parent,name,f) + TQCanvasView.__init__(self,c,parent,name,f) self.__moving=0 self.__moving_start= 0 - def contentsMousePressEvent(self,e): # QMouseEvent e + def contentsMousePressEvent(self,e): # TQMouseEvent e point = self.inverseWorldMatrix().map(e.pos()) - ilist = self.canvas().collisions(point) #QCanvasItemList ilist + ilist = self.canvas().collisions(point) #TQCanvasItemList ilist for each_item in ilist: if each_item.rtti()==984376: if not each_item.hit(point): @@ -121,14 +121,14 @@ class FigureEditor(QCanvasView): self.canvas().update() -class BouncyLogo(QCanvasSprite): +class BouncyLogo(TQCanvasSprite): def __init__(self,canvas): # Make sure the logo exists. global bouncy_logo if bouncy_logo is None: - bouncy_logo=QCanvasPixmapArray("qt-trans.xpm") + bouncy_logo=TQCanvasPixmapArray("qt-trans.xpm") - QCanvasSprite.__init__(self,None,canvas) + TQCanvasSprite.__init__(self,None,canvas) self.setSequence(bouncy_logo) self.setAnimated(True) self.initPos() @@ -194,65 +194,65 @@ class BouncyLogo(QCanvasSprite): self.setVelocity(vx,vy) elif stage==1: - QCanvasItem.advance(self,stage) + TQCanvasItem.advance(self,stage) -class Main (QMainWindow): +class Main (TQMainWindow): def __init__(self,c,parent,name,f=0): - QMainWindow.__init__(self,parent,name,f) + TQMainWindow.__init__(self,parent,name,f) self.editor=FigureEditor(c,self,name,f) - self.printer=QPrinter() + self.printer=TQPrinter() self.dbf_id=0 self.canvas=c self.mainCount=0 - file=QPopupMenu(self.menuBar()) - file.insertItem("&Fill canvas", self.init, Qt.CTRL+Qt.Key_F) - file.insertItem("&Erase canvas", self.clear, Qt.CTRL+Qt.Key_E) - file.insertItem("&New view", self.newView, Qt.CTRL+Qt.Key_N) + file=TQPopupMenu(self.menuBar()) + file.insertItem("&Fill canvas", self.init, TQt.CTRL+TQt.Key_F) + file.insertItem("&Erase canvas", self.clear, TQt.CTRL+TQt.Key_E) + file.insertItem("&New view", self.newView, TQt.CTRL+TQt.Key_N) file.insertSeparator(); - file.insertItem("&Print", self._print, Qt.CTRL+Qt.Key_P) + file.insertItem("&Print", self._print, TQt.CTRL+TQt.Key_P) file.insertSeparator() - file.insertItem("E&xit", qApp, SLOT("quit()"), Qt.CTRL+Qt.Key_Q) + file.insertItem("E&xit", qApp, SLOT("quit()"), TQt.CTRL+TQt.Key_Q) self.menuBar().insertItem("&File", file) - edit = QPopupMenu(self.menuBar() ) - edit.insertItem("Add &Circle", self.addCircle, Qt.ALT+Qt.Key_C) - edit.insertItem("Add &Hexagon", self.addHexagon, Qt.ALT+Qt.Key_H) - edit.insertItem("Add &Polygon", self.addPolygon, Qt.ALT+Qt.Key_P) - edit.insertItem("Add Spl&ine", self.addSpline, Qt.ALT+Qt.Key_I) - edit.insertItem("Add &Text", self.addText, Qt.ALT+Qt.Key_T) - edit.insertItem("Add &Line", self.addLine, Qt.ALT+Qt.Key_L) - edit.insertItem("Add &Rectangle", self.addRectangle, Qt.ALT+Qt.Key_R) - edit.insertItem("Add &Sprite", self.addSprite, Qt.ALT+Qt.Key_S) - edit.insertItem("Create &Mesh", self.addMesh, Qt.ALT+Qt.Key_M ) - edit.insertItem("Add &Alpha-blended image", self.addButterfly, Qt.ALT+Qt.Key_A) + edit = TQPopupMenu(self.menuBar() ) + edit.insertItem("Add &Circle", self.addCircle, TQt.ALT+TQt.Key_C) + edit.insertItem("Add &Hexagon", self.addHexagon, TQt.ALT+TQt.Key_H) + edit.insertItem("Add &Polygon", self.addPolygon, TQt.ALT+TQt.Key_P) + edit.insertItem("Add Spl&ine", self.addSpline, TQt.ALT+TQt.Key_I) + edit.insertItem("Add &Text", self.addText, TQt.ALT+TQt.Key_T) + edit.insertItem("Add &Line", self.addLine, TQt.ALT+TQt.Key_L) + edit.insertItem("Add &Rectangle", self.addRectangle, TQt.ALT+TQt.Key_R) + edit.insertItem("Add &Sprite", self.addSprite, TQt.ALT+TQt.Key_S) + edit.insertItem("Create &Mesh", self.addMesh, TQt.ALT+TQt.Key_M ) + edit.insertItem("Add &Alpha-blended image", self.addButterfly, TQt.ALT+TQt.Key_A) self.menuBar().insertItem("&Edit", edit) - view = QPopupMenu(self.menuBar() ); - view.insertItem("&Enlarge", self.enlarge, Qt.SHIFT+Qt.CTRL+Qt.Key_Plus); - view.insertItem("Shr&ink", self.shrink, Qt.SHIFT+Qt.CTRL+Qt.Key_Minus); + view = TQPopupMenu(self.menuBar() ); + view.insertItem("&Enlarge", self.enlarge, TQt.SHIFT+TQt.CTRL+TQt.Key_Plus); + view.insertItem("Shr&ink", self.shrink, TQt.SHIFT+TQt.CTRL+TQt.Key_Minus); view.insertSeparator(); - view.insertItem("&Rotate clockwise", self.rotateClockwise, Qt.CTRL+Qt.Key_PageDown); - view.insertItem("Rotate &counterclockwise", self.rotateCounterClockwise, Qt.CTRL+Qt.Key_PageUp); - view.insertItem("&Zoom in", self.zoomIn, Qt.CTRL+Qt.Key_Plus); - view.insertItem("Zoom &out", self.zoomOut, Qt.CTRL+Qt.Key_Minus); - view.insertItem("Translate left", self.moveL, Qt.CTRL+Qt.Key_Left); - view.insertItem("Translate right", self.moveR, Qt.CTRL+Qt.Key_Right); - view.insertItem("Translate up", self.moveU, Qt.CTRL+Qt.Key_Up); - view.insertItem("Translate down", self.moveD, Qt.CTRL+Qt.Key_Down); - view.insertItem("&Mirror", self.mirror, Qt.CTRL+Qt.Key_Home); + view.insertItem("&Rotate clockwise", self.rotateClockwise, TQt.CTRL+TQt.Key_PageDown); + view.insertItem("Rotate &counterclockwise", self.rotateCounterClockwise, TQt.CTRL+TQt.Key_PageUp); + view.insertItem("&Zoom in", self.zoomIn, TQt.CTRL+TQt.Key_Plus); + view.insertItem("Zoom &out", self.zoomOut, TQt.CTRL+TQt.Key_Minus); + view.insertItem("Translate left", self.moveL, TQt.CTRL+TQt.Key_Left); + view.insertItem("Translate right", self.moveR, TQt.CTRL+TQt.Key_Right); + view.insertItem("Translate up", self.moveU, TQt.CTRL+TQt.Key_Up); + view.insertItem("Translate down", self.moveD, TQt.CTRL+TQt.Key_Down); + view.insertItem("&Mirror", self.mirror, TQt.CTRL+TQt.Key_Home); self.menuBar().insertItem("&View", view) - self.options = QPopupMenu( self.menuBar() ); + self.options = TQPopupMenu( self.menuBar() ); self.dbf_id = self.options.insertItem("Double buffer", self.toggleDoubleBuffer) self.options.setItemChecked(self.dbf_id, True) self.menuBar().insertItem("&Options",self.options) self.menuBar().insertSeparator(); - help = QPopupMenu( self.menuBar() ) - help.insertItem("&About", self.help, Qt.Key_F1) - help.insertItem("&About Qt", self.aboutQt, Qt.Key_F2) + help = TQPopupMenu( self.menuBar() ) + help.insertItem("&About", self.help, TQt.Key_F1) + help.insertItem("&About TQt", self.aboutTQt, TQt.Key_F2) help.setItemChecked(self.dbf_id, True) self.menuBar().insertItem("&Help",help) @@ -279,7 +279,7 @@ class Main (QMainWindow): self.addLogo() def newView(self): - m=Main(self.canvas,None,"new windiw",Qt.WDestructiveClose) + m=Main(self.canvas,None,"new windiw",TQt.WDestructiveClose) qApp.setMainWidget(m) m.show() qApp.setMainWidget(None) @@ -289,10 +289,10 @@ class Main (QMainWindow): self.editor.clear() def help(self): - QMessageBox.information(None, "PyQt Canvas Example", - "<h3>The PyQt QCanvas classes example</h3><hr>" - "<p>This is the PyQt implementation of " - "Qt canvas example.</p> by Sadi Kose " + TQMessageBox.information(None, "PyTQt Canvas Example", + "<h3>The PyTQt TQCanvas classes example</h3><hr>" + "<p>This is the PyTQt implementation of " + "TQt canvas example.</p> by Sadi Kose " "<i>(kose@nuvox.net)</i><hr>" "<ul>" "<li> Press ALT-S for some sprites." @@ -302,8 +302,8 @@ class Main (QMainWindow): "<li> Read the code!" "</ul>","Dismiss") - def aboutQt(self): - QMessageBox.aboutQt(self,"PyQt Canvas Example") + def aboutTQt(self): + TQMessageBox.aboutTQt(self,"PyTQt Canvas Example") def toggleDoubleBuffer(self): s = not self.options.isItemChecked(self.dbf_id) @@ -363,10 +363,10 @@ class Main (QMainWindow): def _print(self): if not self.printer: - self.printer = QPrinter() + self.printer = TQPrinter() if self.printer.setup(self) : - pp=QPainter(self.printer) - self.canvas.drawArea(QRect(0,0,self.canvas.width(),self.canvas.height()),pp,False) + pp=TQPainter(self.printer) + self.canvas.drawArea(TQRect(0,0,self.canvas.width(),self.canvas.height()),pp,False) def addSprite(self): i = BouncyLogo(self.canvas) @@ -377,15 +377,15 @@ class Main (QMainWindow): if butterfly_fn.isEmpty(): return if not butterflyimg: - butterflyimg.append(QImage()) + butterflyimg.append(TQImage()) butterflyimg[0].load(butterfly_fn) - butterflyimg.append(QImage()) + butterflyimg.append(TQImage()) butterflyimg[1] = butterflyimg[0].smoothScale( int(butterflyimg[0].width()*0.75), int(butterflyimg[0].height()*0.75) ) - butterflyimg.append(QImage()) + butterflyimg.append(TQImage()) butterflyimg[2] = butterflyimg[0].smoothScale( int(butterflyimg[0].width()*0.5), int(butterflyimg[0].height()*0.5) ) - butterflyimg.append(QImage()) + butterflyimg.append(TQImage()) butterflyimg[3] = butterflyimg[0].smoothScale( int(butterflyimg[0].width()*0.25), int(butterflyimg[0].height()*0.25) ) @@ -399,15 +399,15 @@ class Main (QMainWindow): if logo_fn.isEmpty(): return; if not logoimg: - logoimg.append(QImage()) + logoimg.append(TQImage()) logoimg[0].load( logo_fn ) - logoimg.append(QImage()) + logoimg.append(TQImage()) logoimg[1] = logoimg[0].smoothScale( int(logoimg[0].width()*0.75), int(logoimg[0].height()*0.75) ) - logoimg.append(QImage()) + logoimg.append(TQImage()) logoimg[2] = logoimg[0].smoothScale( int(logoimg[0].width()*0.5), int(logoimg[0].height()*0.5) ) - logoimg.append(QImage()) + logoimg.append(TQImage()) logoimg[3] = logoimg[0].smoothScale( int(logoimg[0].width()*0.25), int(logoimg[0].height()*0.25) ); @@ -418,79 +418,79 @@ class Main (QMainWindow): i.show() def addCircle(self): - i = QCanvasEllipse(50,50,self.canvas) - i.setBrush( QBrush(QColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8) )) + i = TQCanvasEllipse(50,50,self.canvas) + i.setBrush( TQBrush(TQColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8) )) i.move(self.canvas.width()*random.random()%self.canvas.width(),self.canvas.width()*random.random()%self.canvas.height()) i.setZ(256*random.random()%256) i.show() def addHexagon(self): - i = QCanvasPolygon(self.canvas) + i = TQCanvasPolygon(self.canvas) size = canvas.width() / 25 - pa=QPointArray(6) - pa.setPoint(0,QPoint(2*size,0)) - pa.setPoint(1,QPoint(size,-size*173/100)) - pa.setPoint(2,QPoint(-size,-size*173/100)) - pa.setPoint(3,QPoint(-2*size,0)) - pa.setPoint(4,QPoint(-size,size*173/100)) - pa.setPoint(5,QPoint(size,size*173/100)) + pa=TQPointArray(6) + pa.setPoint(0,TQPoint(2*size,0)) + pa.setPoint(1,TQPoint(size,-size*173/100)) + pa.setPoint(2,TQPoint(-size,-size*173/100)) + pa.setPoint(3,TQPoint(-2*size,0)) + pa.setPoint(4,TQPoint(-size,size*173/100)) + pa.setPoint(5,TQPoint(size,size*173/100)) i.setPoints(pa) - i.setBrush( QBrush(QColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8) )) + i.setBrush( TQBrush(TQColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8) )) i.move(self.canvas.width()*random.random()%self.canvas.width(),self.canvas.width()*random.random()%self.canvas.height()) i.setZ(256*random.random()%256) i.show() def addPolygon(self): - i = QCanvasPolygon(self.canvas) + i = TQCanvasPolygon(self.canvas) size = self.canvas.width()/2 - pa=QPointArray(6) - pa.setPoint(0, QPoint(0,0)) - pa.setPoint(1, QPoint(size,size/5)) - pa.setPoint(2, QPoint(size*4/5,size)) - pa.setPoint(3, QPoint(size/6,size*5/4)) - pa.setPoint(4, QPoint(size*3/4,size*3/4)) - pa.setPoint(5, QPoint(size*3/4,size/4)) + pa=TQPointArray(6) + pa.setPoint(0, TQPoint(0,0)) + pa.setPoint(1, TQPoint(size,size/5)) + pa.setPoint(2, TQPoint(size*4/5,size)) + pa.setPoint(3, TQPoint(size/6,size*5/4)) + pa.setPoint(4, TQPoint(size*3/4,size*3/4)) + pa.setPoint(5, TQPoint(size*3/4,size/4)) i.setPoints(pa) - i.setBrush(QBrush( QColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8)) ) + i.setBrush(TQBrush( TQColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8)) ) i.move(self.canvas.width()*random.random()%self.canvas.width(),self.canvas.width()*random.random()%self.canvas.height()) i.setZ(256*random.random()%256) i.show() def addSpline(self): - i = QCanvasSpline(self.canvas) + i = TQCanvasSpline(self.canvas) size = canvas.width()/6 - pa=QPointArray(12) - pa.setPoint(0,QPoint(0,0)) - pa.setPoint(1,QPoint(size/2,0)) - pa.setPoint(2,QPoint(size,size/2)) - pa.setPoint(3,QPoint(size,size)) - pa.setPoint(4,QPoint(size,size*3/2)) - pa.setPoint(5,QPoint(size/2,size*2)) - pa.setPoint(6,QPoint(0,size*2)) - pa.setPoint(7,QPoint(-size/2,size*2)) - pa.setPoint(8,QPoint(size/4,size*3/2)) - pa.setPoint(9,QPoint(0,size)) - pa.setPoint(10,QPoint(-size/4,size/2)) - pa.setPoint(11,QPoint(-size/2,0)) + pa=TQPointArray(12) + pa.setPoint(0,TQPoint(0,0)) + pa.setPoint(1,TQPoint(size/2,0)) + pa.setPoint(2,TQPoint(size,size/2)) + pa.setPoint(3,TQPoint(size,size)) + pa.setPoint(4,TQPoint(size,size*3/2)) + pa.setPoint(5,TQPoint(size/2,size*2)) + pa.setPoint(6,TQPoint(0,size*2)) + pa.setPoint(7,TQPoint(-size/2,size*2)) + pa.setPoint(8,TQPoint(size/4,size*3/2)) + pa.setPoint(9,TQPoint(0,size)) + pa.setPoint(10,TQPoint(-size/4,size/2)) + pa.setPoint(11,TQPoint(-size/2,0)) i.setControlPoints(pa) - i.setBrush( QBrush(QColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8) )) + i.setBrush( TQBrush(TQColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8) )) i.move(self.canvas.width()*random.random()%self.canvas.width(),self.canvas.width()*random.random()%self.canvas.height()) i.setZ(256*random.random()%256) i.show() def addText(self): - i = QCanvasText(self.canvas) - i.setText("QCanvasText") + i = TQCanvasText(self.canvas) + i.setText("TQCanvasText") i.move(self.canvas.width()*random.random()%self.canvas.width(),self.canvas.width()*random.random()%self.canvas.height()) i.setZ(256*random.random()%256) i.show() def addLine(self): - i = QCanvasLine(self.canvas); + i = TQCanvasLine(self.canvas); i.setPoints( self.canvas.width()*random.random()%self.canvas.width(), self.canvas.width()*random.random()%self.canvas.height(), self.canvas.width()*random.random()%self.canvas.width(), self.canvas.width()*random.random()%self.canvas.height() ) - i.setPen( QPen(QColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8), 6) ) + i.setPen( TQPen(TQColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8), 6) ) i.setZ(256*random.random()%256) i.show() @@ -505,9 +505,9 @@ class Main (QMainWindow): y0 = 0; if not self.tb: - self.tb = QBrush( Qt.red ) + self.tb = TQBrush( TQt.red ) if not self.tp: - self.tp = QPen( Qt.black ) + self.tp = TQPen( TQt.black ) nodecount = 0; @@ -519,7 +519,7 @@ class Main (QMainWindow): cols = w / dist #ifndef QT_NO_PROGRESSDIALOG - #progress=QProgressDialog( "Creating mesh...", "Abort", rows, + #progress=TQProgressDialog( "Creating mesh...", "Abort", rows, # self, "progress", True ); #endif @@ -566,12 +566,12 @@ class Main (QMainWindow): #// qDebug( "%d nodes, %d edges", nodecount, EdgeItem::count() ); def addRectangle(self): - i = QCanvasRectangle( self.canvas.width()*random.random()%self.canvas.width(), + i = TQCanvasRectangle( self.canvas.width()*random.random()%self.canvas.width(), self.canvas.width()*random.random()%self.canvas.height(), self.canvas.width()/5,self.canvas.width()/5,self.canvas) z = 256*random.random()%256 - i.setBrush( QBrush(QColor(z,z,z) )) - i.setPen( QPen(QColor(self.canvas.width()*random.random()%32*8, + i.setBrush( TQBrush(TQColor(z,z,z) )) + i.setPen( TQPen(TQColor(self.canvas.width()*random.random()%32*8, self.canvas.width()*random.random()%32*8, self.canvas.width()*random.random()%32*8), 6) ) i.setZ(z) @@ -579,26 +579,26 @@ class Main (QMainWindow): if __name__=='__main__': - app=QApplication(sys.argv) + app=TQApplication(sys.argv) if len(sys.argv) > 1: - butterfly_fn=QString(sys.argv[1]) + butterfly_fn=TQString(sys.argv[1]) else: - butterfly_fn=QString("butterfly.png") + butterfly_fn=TQString("butterfly.png") if len(sys.argv) > 2: - logo_fn = QString(sys.argv[2]) + logo_fn = TQString(sys.argv[2]) else: - logo_fn=QString("qtlogo.png") + logo_fn=TQString("qtlogo.png") - canvas=QCanvas(800,600) + canvas=TQCanvas(800,600) canvas.setAdvancePeriod(30) m=Main(canvas,None,"pyqt canvas example") m.resize(m.sizeHint()) qApp.setMainWidget(m) - m.setCaption("Qt Canvas Example ported to PyQt") - if QApplication.desktop().width() > m.width() + 10 and QApplication.desktop().height() > m.height() + 30: + m.setCaption("TQt Canvas Example ported to PyTQt") + if TQApplication.desktop().width() > m.width() + 10 and TQApplication.desktop().height() > m.height() + 30: m.show() else: m.showMaximized() @@ -607,7 +607,7 @@ if __name__=='__main__': #// m.help(); qApp.setMainWidget(None); - QObject.connect( qApp, SIGNAL("lastWindowClosed()"), qApp, SLOT("quit()") ) + TQObject.connect( qApp, SIGNAL("lastWindowClosed()"), qApp, SLOT("quit()") ) app.exec_loop() diff --git a/examples3/canvas/qtlogo.png b/examples3/canvas/qtlogo.png Binary files differindex a48b1a1..5961457 100644 --- a/examples3/canvas/qtlogo.png +++ b/examples3/canvas/qtlogo.png diff --git a/examples3/checklists.py b/examples3/checklists.py index 12a3cdb..d6378e6 100755 --- a/examples3/checklists.py +++ b/examples3/checklists.py @@ -9,21 +9,21 @@ from qt import * TRUE = 1 FALSE = 0 -class CheckLists(QWidget): +class CheckLists(TQWidget): def __init__(self, *args): - apply( QWidget.__init__, (self, ) + args ) + apply( TQWidget.__init__, (self, ) + args ) - lay = QHBoxLayout(self) + lay = TQHBoxLayout(self) lay.setMargin(5) - vbox1 = QVBoxLayout(lay) + vbox1 = TQVBoxLayout(lay) vbox1.setMargin(5) # First child: a Label - vbox1.addWidget(QLabel("Check some items!", self)) + vbox1.addWidget(TQLabel("Check some items!", self)) # Second child: the ListView - self.lv1 = QListView(self) + self.lv1 = TQListView(self) vbox1.addWidget(self.lv1) self.lv1.addColumn("Items") self.lv1.setRootIsDecorated(TRUE) @@ -32,10 +32,10 @@ class CheckLists(QWidget): parentList = [] - parentList.append( QListViewItem( self.lv1, "Parent Item 1" ) ) - parentList.append( QListViewItem( self.lv1, "Parent Item 2" ) ) - parentList.append( QListViewItem( self.lv1, "Parent Item 3" ) ) - parentList.append( QListViewItem( self.lv1, "Parent Item 4" ) ) + parentList.append( TQListViewItem( self.lv1, "Parent Item 1" ) ) + parentList.append( TQListViewItem( self.lv1, "Parent Item 2" ) ) + parentList.append( TQListViewItem( self.lv1, "Parent Item 3" ) ) + parentList.append( TQListViewItem( self.lv1, "Parent Item 4" ) ) num = 0 @@ -47,49 +47,49 @@ class CheckLists(QWidget): # ...and create 5 checkable child ListViewItems for each parent item for j in range(5): - ci = QCheckListItem( it, QString("%1. Child of Parent %2").arg( j ).arg( i ), QCheckListItem.CheckBox ) + ci = TQCheckListItem( it, TQString("%1. Child of Parent %2").arg( j ).arg( i ), TQCheckListItem.CheckBox ) self.childList1.append(ci) # Create another widget for layouting - tmp1 = QVBoxLayout( lay ) + tmp1 = TQVBoxLayout( lay ) tmp1.setMargin( 5 ) # create a pushbutton - copy1 = QPushButton( " -> ", self ) + copy1 = TQPushButton( " -> ", self ) tmp1.addWidget( copy1 ) copy1.setMaximumWidth( copy1.sizeHint().width() ); # connect the SIGNAL clicked() of the pushbutton with the SLOT copy1to2() self.connect( copy1, SIGNAL('clicked()'), self.copy1to2 ) # another widget for layouting - vbox2 = QVBoxLayout( lay ) + vbox2 = TQVBoxLayout( lay ) vbox2.setMargin( 5 ) # and another label - vbox2.addWidget( QLabel( "Check one item!", self ) ) + vbox2.addWidget( TQLabel( "Check one item!", self ) ) # create the second listview - self.lv2 = QListView( self ) + self.lv2 = TQListView( self ) vbox2.addWidget( self.lv2 ) self.lv2.addColumn( "Items" ) self.lv2.setRootIsDecorated( TRUE ) # another widget needed for layouting only - tmp2 = QVBoxLayout( lay ) + tmp2 = TQVBoxLayout( lay ) tmp2.setMargin( 5 ) # create another pushbutton... - copy2 = QPushButton( " -> ", self ) + copy2 = TQPushButton( " -> ", self ) lay.addWidget( copy2 ) copy2.setMaximumWidth( copy2.sizeHint().width() ) # ...and connect its clicked() SIGNAL to the copy2to3() SLOT self.connect( copy2, SIGNAL('clicked()'), self.copy2to3 ) - tmp3 = QVBoxLayout( lay ) + tmp3 = TQVBoxLayout( lay ) tmp3.setMargin( 5 ) # and create a label which will be at the right of the window - self.label = QLabel( "No Item yet...", self ) + self.label = TQLabel( "No Item yet...", self ) tmp3.addWidget( self.label ) def copy1to2(self): @@ -97,7 +97,7 @@ class CheckLists(QWidget): # Insert first a controller Item into the second ListView. Always if Radio-ListViewItems # are inserted into a Listview, the parent item of these MUST be a controller Item! - item = QCheckListItem( self.lv2, "Controller", QCheckListItem.Controller ) + item = TQCheckListItem( self.lv2, "Controller", TQCheckListItem.Controller ) item.setOpen( TRUE ) self.listChild2 = [] @@ -107,7 +107,7 @@ class CheckLists(QWidget): # ...if the item is checked... if it.isOn(): # ...insert a Radio-ListViewItem with the same text into the second ListView - ri = QCheckListItem(item , it.text(0), QCheckListItem.RadioButton) + ri = TQCheckListItem(item , it.text(0), TQCheckListItem.RadioButton) self.listChild2.append(ri) if item.firstChild() != None: @@ -125,11 +125,11 @@ class CheckLists(QWidget): # ...set the text of the item to the label self.label.setText( it.text( 0 ) ) -a = QApplication(sys.argv) +a = TQApplication(sys.argv) checkLists = CheckLists() checkLists.resize(700, 400) -checkLists.setCaption("PyQt example - CheckLists") +checkLists.setCaption("PyTQt example - CheckLists") a.setMainWidget(checkLists) checkLists.show() diff --git a/examples3/cursor.py b/examples3/cursor.py index d5bbbe1..c9f42bc 100755 --- a/examples3/cursor.py +++ b/examples3/cursor.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. ** ***************************************************************************""" @@ -47,9 +47,9 @@ cm_bits = "\x00\x00\x00\x00\x00\xf8\x1f\x00\x00\xfe\x3f\x00" \ "\x00\xfe\x3f\x00\x00\xf8\x0f\x00" # The CursorView contains many labels with different cursors. -class CursorView( QWidget ): # cursor view +class CursorView( TQWidget ): # cursor view def __init__( self ): - QWidget.__init__( self ) + TQWidget.__init__( self ) # Constructs a cursor view. #enum CursorShape { ArrowCursor, UpArrowCursor, CrossCursor, WaitCursor, IbeamCursor, SizeVerCursor, SizeHorCursor, SizeBDiagCursor, SizeFDiagCursor, SizeAllCursor, BlankCursor, SplitVCursor, SplitHCursor, PointingHandCursor, ForbiddenCursor, WhatsThisCursor, LastCursor = WhatsThisCursor, BitmapCursor = 24 } @@ -74,37 +74,37 @@ class CursorView( QWidget ): # cursor view self.setCaption( "CursorView" ) # set window caption - grid = QGridLayout( self, 5, 4, 20 ) + grid = TQGridLayout( self, 5, 4, 20 ) i=0 for y in range( 0, 4, 1 ) : # create the small labels for x in range( 0, 4, 1 ) : - label = QLabel( self ) - label.setCursor( QCursor(i) ) + label = TQLabel( self ) + label.setCursor( TQCursor(i) ) label.setText( shape[i] ); label.setAlignment( self.AlignCenter ) - label.setFrameStyle( QFrame.Box | QFrame.Raised ) + label.setFrameStyle( TQFrame.Box | TQFrame.Raised ) grid.addWidget( label, x, y ) - QToolTip.add( label, name[i] ) + TQToolTip.add( label, name[i] ) i += 1 - cb = QBitmap( cb_width, cb_height, cb_bits, True ) - cm = QBitmap( cm_width, cm_height, cm_bits, True ) - custom = QCursor( cb, cm ) # create bitmap cursor + cb = TQBitmap( cb_width, cb_height, cb_bits, True ) + cm = TQBitmap( cm_width, cm_height, cm_bits, True ) + custom = TQCursor( cb, cm ) # create bitmap cursor - label = QLabel( self ) # create the big label + label = TQLabel( self ) # create the big label label.setCursor( custom ) label.setText( "Custom bitmap cursor" ) - QToolTip.add( label, "custom bitmap cursor" ) + TQToolTip.add( label, "custom bitmap cursor" ) label.setAlignment( self.AlignCenter ) - label.setFrameStyle( QFrame.Box | QFrame.Sunken ) + label.setFrameStyle( TQFrame.Box | TQFrame.Sunken ) grid.addMultiCellWidget( label, 4, 4, 0, 3 ) # Create and display a CursorView. def main( args ): - a = QApplication(sys.argv) # application object + a = TQApplication(sys.argv) # application object v = CursorView() # cursor view - v.setCaption( "Qt Example - Cursors" ) + v.setCaption( "TQt Example - Cursors" ) a.setMainWidget( v ) v.show() diff --git a/examples3/dclock.py b/examples3/dclock.py index 5382d4f..d129681 100755 --- a/examples3/dclock.py +++ b/examples3/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/examples3/desktop.py b/examples3/desktop.py index 7036248..46c41dc 100755 --- a/examples3/desktop.py +++ b/examples3/desktop.py @@ -26,13 +26,13 @@ maxpoints = 5 maxcurves = 8 def poly(): - d = QApplication.desktop() - d.setEraseColor(Qt.white) + d = TQApplication.desktop() + d.setEraseColor(TQt.white) xvel = [ 0 ] * maxpoints yvel = [ 0 ] * maxpoints head = 0 tail = -maxcurves + 2 - a = [ QPointArray() ] * maxcurves + a = [ TQPointArray() ] * maxcurves r = d.rect() for i in range(maxcurves): a[i].resize(maxpoints) @@ -43,11 +43,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: @@ -82,31 +82,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.setOptimization(QPixmap.BestOptim) + pm.setOptimization(TQPixmap.BestOptim) - 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.setErasePixmap(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()): @@ -130,9 +130,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, Qt.WType_Desktop | Qt.WPaintDesktop) + TQWidget.__init__(self, parent, name, TQt.WType_Desktop | TQt.WPaintDesktop) self.text = s self.pm = None @@ -141,16 +141,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.setErasePixmap(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() @@ -168,8 +168,8 @@ def desktopText(s='Trolltech'): 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() @@ -189,10 +189,10 @@ def desktopText(s='Trolltech'): qApp.desktop().setErasePixmap(pm) -a = QApplication(sys.argv) +a = TQApplication(sys.argv) if len(sys.argv) > 1: - f = QFont('charter', 96, QFont.Black) - f.setStyleHint(QFont.Times) + f = TQFont('charter', 96, TQFont.Black) + f.setStyleHint(TQFont.Times) a.setFont(f) validOptions = 0 diff --git a/examples3/dirview.py b/examples3/dirview.py index eb5393e..1783d51 100755 --- a/examples3/dirview.py +++ b/examples3/dirview.py @@ -6,7 +6,7 @@ ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** Some corrections by M. Biermaier (http://www.office-m.at) ** -** 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. ** ***************************************************************************""" @@ -136,9 +136,9 @@ folderClosed = None folderOpened = None fileNormal = None -class FileItem( QListViewItem ) : - def __init__( self, parent=None, s1=QString.null, s2=QString.null ): - QListViewItem.__init__( self, parent, s1, s2 ) +class FileItem( TQListViewItem ) : + def __init__( self, parent=None, s1=TQString.null, s2=TQString.null ): + TQListViewItem.__init__( self, parent, s1, s2 ) self.pix = None def setPixmap( self, p ) : @@ -153,22 +153,22 @@ class FileItem( QListViewItem ) : else : return self.pix; # Class Directory -class Directory( QListViewItem ) : - def __init__( self, parent=None, filename=QString.null, col2=QString.null ): - QListViewItem.__init__( self, parent, filename, col2 ) +class Directory( TQListViewItem ) : + def __init__( self, parent=None, filename=TQString.null, col2=TQString.null ): + TQListViewItem.__init__( self, parent, filename, col2 ) self.pix = None global folderLocked, folderClosed, folderOpened, fileNormal self.showDirsOnly = False - if isinstance(parent, QListView): + if isinstance(parent, TQListView): self.p = None self.showDirsOnly = parent.showDirsOnly() - self.f = QFile( QString('/') ) + self.f = TQFile( TQString('/') ) else: self.p = parent self.showDirsOnly = parent.showDirsOnly - self.f = QFile( QString(filename) ) + self.f = TQFile( TQString(filename) ) - self.readable = QDir( self.fullName() ).isReadable() + self.readable = TQDir( self.fullName() ).isReadable() if not self.readable : self.setPixmap( folderLocked ) else : self.setPixmap( folderClosed ) @@ -188,8 +188,8 @@ class Directory( QListViewItem ) : else : self.setPixmap( folderClosed ) if o and not self.childCount() : - s = QString( self.fullName() ) - thisDir = QDir( s ) + s = TQString( self.fullName() ) + thisDir = TQDir( s ) if not thisDir.isReadable() : self.readable = False self.setExpandable( False ) @@ -198,7 +198,7 @@ class Directory( QListViewItem ) : self.listView().setUpdatesEnabled( False ) files = thisDir.entryInfoList() if files : - fi = QFileInfo() + fi = TQFileInfo() for it in files: fi = it if str(fi.fileName()) == "." or str(fi.fileName()) == ".." : @@ -214,14 +214,14 @@ class Directory( QListViewItem ) : item.setPixmap( fileNormal ) self.listView().setUpdatesEnabled( True ) - QListViewItem.setOpen( self, o ) + TQListViewItem.setOpen( self, o ) def setup( self ): self.setExpandable( True ) - QListViewItem.setup( self ) + TQListViewItem.setup( self ) def fullName( self ): - s = QString() + s = TQString() if self.p : s = self.p.fullName() s.append( self.f.name() ) @@ -237,27 +237,27 @@ class Directory( QListViewItem ) : # Class DirectoryView -class DirectoryView( QListView ): +class DirectoryView( TQListView ): def __init__( self, parent=None, name=None, sdo=False ): - QListView.__init__( self, parent, name ) + TQListView.__init__( self, parent, name ) self.dirsOnly = sdo self.oldCurrent = 0 self.dropItem = 0 - self.presspos = QPoint(0,0) + self.presspos = TQPoint(0,0) self.mousePressed = False - global folderLocked, folderClosed, folderOpened, fileNormal #= QPixmap() + global folderLocked, folderClosed, folderOpened, fileNormal #= TQPixmap() self.autoopenTime = 750 - self.autoopen_timer = QTimer( self ) + self.autoopen_timer = TQTimer( self ) if not folderLocked : - folderLocked = QPixmap( folder_locked ) - folderClosed = QPixmap( folder_closed_xpm ) - folderOpened = QPixmap( folder_open_xpm ) - fileNormal = QPixmap( pix_file ) + folderLocked = TQPixmap( folder_locked ) + folderClosed = TQPixmap( folder_closed_xpm ) + folderOpened = TQPixmap( folder_open_xpm ) + fileNormal = TQPixmap( pix_file ) - self.connect( self, SIGNAL("doubleClicked(QListViewItem *)"), + self.connect( self, SIGNAL("doubleClicked(TQListViewItem *)"), self.slotFolderSelected ) - self.connect( self, SIGNAL("returnPressed(QListViewItem *)"), + self.connect( self, SIGNAL("returnPressed(TQListViewItem *)"), self.slotFolderSelected ) self.setAcceptDrops( True ) @@ -272,7 +272,7 @@ class DirectoryView( QListView ): if not i or not self.showDirsOnly(): return dir = i - self.emit( PYSIGNAL("folderSelected(const QString &)"), (dir.fullName(), ) ) + self.emit( PYSIGNAL("folderSelected(const TQString &)"), (dir.fullName(), ) ) def openFolder( self ): self.autoopen_timer.stop() @@ -281,7 +281,7 @@ class DirectoryView( QListView ): self.dropItem.repaint() def contentsDragEnterEvent( self, e ): - if not QUriDrag.canDecode(e) : + if not TQUriDrag.canDecode(e) : e.ignore() return self.oldCurrent = self.currentItem() @@ -291,7 +291,7 @@ class DirectoryView( QListView ): self.autoopen_timer.start( self.autoopenTime ) def contentsDragMoveEvent( self, e ) : - if not QUriDrag.canDecode(e) : + if not TQUriDrag.canDecode(e) : e.ignore() return vp = self.contentsToViewport( e.pos() ) @@ -304,11 +304,11 @@ class DirectoryView( QListView ): self.dropItem = i self.autoopen_timer.start( self.autoopenTime ) - if e.action() == QDropEvent.Copy: + if e.action() == TQDropEvent.Copy: pass - elif e.action() == QDropEvent.Move: + elif e.action() == TQDropEvent.Move: e.acceptAction() - elif e.action() == QDropEvent.Link: + elif e.action() == TQDropEvent.Link: e.acceptAction() else: pass @@ -317,7 +317,7 @@ class DirectoryView( QListView ): self.autoopen_timer.stop() self.dropItem = 0 - def contentsDragLeaveEvent( self, QDragLeaveEvent ) : + def contentsDragLeaveEvent( self, TQDragLeaveEvent ) : self.autoopen_timer.stop() self.dropItem = 0 @@ -326,23 +326,23 @@ class DirectoryView( QListView ): def contentsDropEvent( self, e ): self.autoopen_timer.stop() - if not QUriDrag.canDecode(e) : + if not TQUriDrag.canDecode(e) : e.ignore() return item = self.itemAt( self.contentsToViewport(e.pos()) ) if item : - lst = QStringList() - QUriDrag.decodeLocalFiles( e, lst ) - if e.action() == QDropEvent.Copy: - s = QString("Copy") - elif e.action() == QDropEvent.Move: - s = QString("Move") + lst = TQStringList() + TQUriDrag.decodeLocalFiles( e, lst ) + if e.action() == TQDropEvent.Copy: + s = TQString("Copy") + elif e.action() == TQDropEvent.Move: + s = TQString("Move") e.acceptAction() - elif e.action() == QDropEvent.Link: - s = QString("Link") + elif e.action() == TQDropEvent.Link: + s = TQString("Link") e.acceptAction() else: - s = QString("Unknown") + s = TQString("Unknown") s += "\n\n" e.accept() @@ -353,12 +353,12 @@ class DirectoryView( QListView ): s += "\nTo\n\n " s += self.fullPath(item) - QMessageBox.information( self, "Drop target", s, "Not implemented" ) + TQMessageBox.information( self, "Drop target", s, "Not implemented" ) else : e.ignore() def fullPath( self, item ): - fullpath = QString( item.text(0) ) + fullpath = TQString( item.text(0) ) item = item.parent() while item: newpath = item.text(0) @@ -373,8 +373,8 @@ class DirectoryView( QListView ): return fullpath def contentsMousePressEvent( self, e ) : - QListView.contentsMousePressEvent( self, e ) - p = QPoint( self.contentsToViewport( e.pos() ) ) + TQListView.contentsMousePressEvent( self, e ) + p = TQPoint( self.contentsToViewport( e.pos() ) ) i = self.itemAt( p ) if i : # if the user clicked into the root decoration of the item, don't try to start a drag! @@ -387,30 +387,30 @@ class DirectoryView( QListView ): self.mousePressed = True def contentsMouseMoveEvent( self, e ): - offset = QPoint( self.presspos.x() - e.pos().x(), + offset = TQPoint( self.presspos.x() - e.pos().x(), self.presspos.y() - e.pos().y() ) - if self.mousePressed and (offset).manhattanLength() > QApplication.startDragDistance() : + if self.mousePressed and (offset).manhattanLength() > TQApplication.startDragDistance() : self.mousePressed = False item = self.itemAt( self.contentsToViewport(self.presspos) ) if item : source = self.fullPath(item) - if QFile.exists(source) : - ud = QUriDrag(self.viewport()) - ud.setFileNames( QStringList (source) ) + if TQFile.exists(source) : + ud = TQUriDrag(self.viewport()) + ud.setFileNames( TQStringList (source) ) if ud.drag() : - QMessageBox.information( self, "Drag source", - QString("Delete ")+source, "Not implemented" ) + TQMessageBox.information( self, "Drag source", + TQString("Delete ")+source, "Not implemented" ) - def contentsMouseReleaseEvent( self, QMouseEvent ): + def contentsMouseReleaseEvent( self, TQMouseEvent ): self.mousePressed = False def setDir( self, s ): - it = QListViewItem( self ) + it = TQListViewItem( self ) it.setOpen(False) - thisDir = QDir( s ) - it = QListViewItem( self ) + thisDir = TQDir( s ) + it = TQListViewItem( self ) it.setOpen(False) - lst = QStringList( QStringList.split( "/", s ) ) + lst = TQStringList( TQStringList.split( "/", s ) ) listview2 = [] listview2.extend( lst ) @@ -425,14 +425,14 @@ class DirectoryView( QListView ): self.setCurrentItem( item ) def main( args ): - a = QApplication( args ) + a = TQApplication( args ) mw = DirectoryView() mw.addColumn( "Name" ) mw.addColumn( "Type" ) mw.setTreeStepSize( 20 ) - roots = QDir.drives() + roots = TQDir.drives() if roots : for it in roots: fi = it @@ -441,7 +441,7 @@ def main( args ): root.setOpen( True ) # be interesting mw.resize( 400, 400 ) - mw.setCaption( "Qt Example - Directory Browser" ) + mw.setCaption( "TQt Example - Directory Browser" ) mw.setAllColumnsShowFocus( True ) a.setMainWidget( mw ) mw.show() diff --git a/examples3/dragdrop.py b/examples3/dragdrop.py index 4cc8c73..5ea9171 100755 --- a/examples3/dragdrop.py +++ b/examples3/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/examples3/drawlines.py b/examples3/drawlines.py index 3e21db7..bdbe814 100755 --- a/examples3/drawlines.py +++ b/examples3/drawlines.py @@ -13,10 +13,10 @@ MAXCOLORS = 40; # ConnectWidget - draws connected lines # -class ConnectWidget(QWidget): +class ConnectWidget(TQWidget): def __init__(self): - QWidget.__init__(self) - self.setEraseColor( Qt.white ) # white background + TQWidget.__init__(self) + self.setEraseColor( TQt.white ) # white background self.count = 0; self.down = FALSE @@ -24,15 +24,15 @@ class ConnectWidget(QWidget): self.colors = [] for i in range(MAXPOINTS): # init arrays - self.points.append(QPoint()) + self.points.append(TQPoint()) for i in range(MAXCOLORS): - self.colors.append(QColor( random.randint(0,255), random.randint(0,255), random.randint(0,255) )) + self.colors.append(TQColor( random.randint(0,255), random.randint(0,255), random.randint(0,255) )) # # Handles paint events for the connect widget. # def paintEvent(self, pe): - paint = QPainter( self ) + paint = TQPainter( self ) for i in range(self.count-1): # connect all points for j in range(i+1, self.count): paint.setPen( self.colors[random.randint(0,MAXCOLORS-1)] ) # set random pen color @@ -58,17 +58,17 @@ class ConnectWidget(QWidget): # def mouseMoveEvent(self, me): if self.down and self.count < MAXPOINTS: - paint = QPainter( self ) - self.points[self.count] = QPoint(me.pos()) # add point + paint = TQPainter( self ) + self.points[self.count] = TQPoint(me.pos()) # add point paint.drawPoint( me.pos() ) # plot point self.count = self.count+1 # # Create and display a ConnectWidget. # -a = QApplication( sys.argv ) +a = TQApplication( sys.argv ) connect = ConnectWidget() -connect.setCaption( "PyQt Example - Draw lines") +connect.setCaption( "PyTQt Example - Draw lines") a.setMainWidget( connect ) connect.show() a.exec_loop() diff --git a/examples3/dropsite.py b/examples3/dropsite.py index 11d9707..523f7d0 100644 --- a/examples3/dropsite.py +++ b/examples3/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.setEraseColor(Qt.white) + self.emit(PYSIGNAL('message(TQString &)'), (TQString(t),)) + self.setEraseColor(TQt.white) - def dragLeaveEvent( self, QDragLeaveEvent ): + def dragLeaveEvent( self, TQDragLeaveEvent ): # Give the user some feedback... - self.emit(PYSIGNAL('message(QString &)'), (QString(''),)) - self.setEraseColor(Qt.lightGray) + self.emit(PYSIGNAL('message(TQString &)'), (TQString(''),)) + self.setEraseColor(TQt.lightGray) def dropEvent( self, e ): - self.setEraseColor(Qt.lightGray) + self.setEraseColor(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/examples3/fontdisplayer.py b/examples3/fontdisplayer.py index f6015df..b11e520 100755 --- a/examples3/fontdisplayer.py +++ b/examples3/fontdisplayer.py @@ -5,7 +5,7 @@ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** ***************************************************************************""" @@ -13,35 +13,35 @@ import sys from qt import * -class FontRowTable( QFrame ): +class FontRowTable( TQFrame ): def __init__( self, parent=None, name=None ): - QFrame.__init__( self, parent, name ) + TQFrame.__init__( self, parent, name ) self.setBackgroundMode(self.PaletteBase) self.setFrameStyle(self.Panel|self.Sunken) self.setMargin(8) self.setRow(0) self.row = 0 - self.tablefont = QFont( QApplication.font() ) + self.tablefont = TQFont( TQApplication.font() ) def sizeHint( self ) : - width = 16*self.cellSize().width()+QSize(2,2).width()*(self.margin()+self.frameWidth()) - height = 16*self.cellSize().height()+QSize(2,2).height()*(self.margin()+self.frameWidth()) - return QSize(width,height) + width = 16*self.cellSize().width()+TQSize(2,2).width()*(self.margin()+self.frameWidth()) + height = 16*self.cellSize().height()+TQSize(2,2).height()*(self.margin()+self.frameWidth()) + return TQSize(width,height) def cellSize( self ) : fm = self.fontMetrics() - return QSize( fm.maxWidth(), fm.lineSpacing() + 1 ) + return TQSize( fm.maxWidth(), fm.lineSpacing() + 1 ) def paintEvent( self, e ): - QFrame.paintEvent(self, e) - p = QPainter(self) + TQFrame.paintEvent(self, e) + p = TQPainter(self) p.setClipRegion(e.region()) - r = QRect(e.rect()) + r = TQRect(e.rect()) fm = self.fontMetrics() ml = self.frameWidth() + self.margin() + 1 + max(0,-fm.minLeftBearing()) mt = self.frameWidth() + self.margin() - cell = QSize((self.width()-15-ml)/16,(self.height()-15-mt)/16) + cell = TQSize((self.width()-15-ml)/16,(self.height()-15-mt)/16) if not cell.width() or not cell.height() : return @@ -53,11 +53,11 @@ class FontRowTable( QFrame ): h = fm.height() - body = QColor(255,255,192); - negative = QColor(255,192,192); - positive = QColor(192,192,255); - rnegative = QColor(255,128,128); - rpositive = QColor(128,128,255); + body = TQColor(255,255,192); + negative = TQColor(255,192,192); + positive = TQColor(192,192,255); + rnegative = TQColor(255,128,128); + rpositive = TQColor(128,128,255); for j in range(minj, maxj+1, 1) : for i in range(mini, maxi+1, 1) : @@ -65,7 +65,7 @@ class FontRowTable( QFrame ): x = i*cell.width() y = j*cell.height() - ch = QChar(j*16+i) #,self.row) # just accept one argument!!! + ch = TQChar(j*16+i) #,self.row) # just accept one argument!!! if fm.inFont(ch) : w = fm.width(ch) @@ -75,7 +75,7 @@ class FontRowTable( QFrame ): x += ml y += mt+h - p.fillRect(x,y,w,-h,QBrush(body)) + p.fillRect(x,y,w,-h,TQBrush(body)) if w : if l : @@ -83,15 +83,15 @@ class FontRowTable( QFrame ): else: sign = positive if l > 0: lsign = 0 else: lsign = 1 - p.fillRect(x+lsign, y-h/2, abs(l),-h/2, QBrush(sign)) + p.fillRect(x+lsign, y-h/2, abs(l),-h/2, TQBrush(sign)) if r : if r < 0: sign = rnegative else: sign = rpositive if r > 0: rsign = r else: rsign = 0 - p.fillRect(x+w-rsign,y+2, abs(r),-h/2, QBrush(sign)) - s = QString( ch ) - p.setPen(QPen(Qt.black)) + p.fillRect(x+w-rsign,y+2, abs(r),-h/2, TQBrush(sign)) + s = TQString( ch ) + p.setPen(TQPen(TQt.black)) p.drawText(x,y,s) def setRow( self, r ) : @@ -99,47 +99,47 @@ class FontRowTable( QFrame ): fm = self.fontMetrics() str = " minLB=%d minRB=%d maxW=%d" % (fm.minLeftBearing(), fm.minRightBearing(), fm.maxWidth()) - self.emit( PYSIGNAL("fontInformation"), ( QString(str), ) ) + self.emit( PYSIGNAL("fontInformation"), ( TQString(str), ) ) self.update() def chooseFont( self ) : ok = 0 - oldfont = QFont( self.tablefont ) - self.tablefont, ok = QFontDialog.getFont(oldfont, self) + oldfont = TQFont( self.tablefont ) + self.tablefont, ok = TQFontDialog.getFont(oldfont, self) if ok: self.setFont(self.tablefont) else: self.tablefont = oldfont -class FontDisplayer( QMainWindow ) : +class FontDisplayer( TQMainWindow ) : def __init__( self, parent=None, name=None ): - QMainWindow.__init__( self, parent, name ) + TQMainWindow.__init__( self, parent, name ) table = FontRowTable(self) - controls = QToolBar(self) + controls = TQToolBar(self) - QLabel(self.tr("Row:"), controls) - self.row = QSpinBox(0,255,1,controls) + TQLabel(self.tr("Row:"), controls) + self.row = TQSpinBox(0,255,1,controls) controls.addSeparator() - fontbutton = QPushButton(self.tr("Font..."), controls) - status = QStatusBar(self) + fontbutton = TQPushButton(self.tr("Font..."), controls) + status = TQStatusBar(self) self.connect( self.row, SIGNAL("valueChanged(int)"), table.setRow ) self.connect( fontbutton, SIGNAL("clicked()"), table.chooseFont ) self.connect( table, PYSIGNAL("fontInformation"), - status, SLOT("message(const QString&)") ) + status, SLOT("message(const TQString&)") ) table.setRow(0) self.setCentralWidget(table) def main( args ): # Use an interesting font - QApplication.setFont(QFont("unifont",16)) - app = QApplication(sys.argv) + TQApplication.setFont(TQFont("unifont",16)) + app = TQApplication(sys.argv) m = FontDisplayer() - sh = QSize( m.centralWidget().sizeHint() ) + sh = TQSize( m.centralWidget().sizeHint() ) m.resize(sh.width(), sh.height() + 3 * m.statusBar().height()) app.setMainWidget(m); - m.setCaption("Qt Example - QFD"); + m.setCaption("TQt Example - TQFD"); m.show() app.exec_loop() diff --git a/examples3/fonts.py b/examples3/fonts.py index d3166ce..84dffb4 100755 --- a/examples3/fonts.py +++ b/examples3/fonts.py @@ -5,7 +5,7 @@ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** ***************************************************************************""" @@ -13,46 +13,46 @@ import sys from qt import * -class Viewer( QWidget ): +class Viewer( TQWidget ): def __init__( self ): - QWidget.__init__( self ) + TQWidget.__init__( self ) self.setFontSubstitutions() - #greeting_heb = QString.fromUtf8( "\327\251\327\234\327\225\327\235" ) + #greeting_heb = TQString.fromUtf8( "\327\251\327\234\327\225\327\235" ) greeting_heb = unicode( '\327\251\327\234\327\225\327\235','utf8' ) - #greeting_ru = QString.fromUtf8( "\320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\271\321\202\320\265" ) + #greeting_ru = TQString.fromUtf8( "\320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\271\321\202\320\265" ) greeting_ru = unicode('\320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\271\321\202\320\265','utf8' ) greeting_en = "Hello" - self.greetings = QTextView( self, "textview" ) + self.greetings = TQTextView( self, "textview" ) self.greetings.setText( greeting_en + "\n" + greeting_ru + "\n" + greeting_heb ) - self.fontInfo = QTextView( self, "fontinfo" ) + self.fontInfo = TQTextView( self, "fontinfo" ) self.setDefault() - self.defaultButton = QPushButton( "Default", self, "pushbutton1" ) - self.defaultButton.setFont( QFont( "times" ) ) + self.defaultButton = TQPushButton( "Default", self, "pushbutton1" ) + self.defaultButton.setFont( TQFont( "times" ) ) self.connect( self.defaultButton, SIGNAL("clicked()"), self.setDefault ) - self.sansSerifButton = QPushButton( "Sans Serif", self, "pushbutton2" ) - self.sansSerifButton.setFont( QFont( "Helvetica", 12 ) ) + self.sansSerifButton = TQPushButton( "Sans Serif", self, "pushbutton2" ) + self.sansSerifButton.setFont( TQFont( "Helvetica", 12 ) ) self.connect( self.sansSerifButton, SIGNAL("clicked()"), self.setSansSerif ) - self.italicsButton = QPushButton( "Italics", self, "pushbutton3" ) - self.italicsButton.setFont( QFont( "lucida", 12, QFont.Bold, True ) ) + self.italicsButton = TQPushButton( "Italics", self, "pushbutton3" ) + self.italicsButton.setFont( TQFont( "lucida", 12, TQFont.Bold, True ) ) self.connect( self.italicsButton, SIGNAL("clicked()"), self.setItalics ) self.layout() def setDefault( self ): - font = QFont( "Bavaria" ) + font = TQFont( "Bavaria" ) font.setPointSize( 24 ) - font.setWeight( QFont.Bold ) + font.setWeight( TQFont.Bold ) font.setUnderline( True ) self.greetings.setFont( font ) @@ -60,17 +60,17 @@ class Viewer( QWidget ): self.showFontInfo( font ) def setSansSerif( self ): - font = QFont( "Newyork", 18 ) - font.setStyleHint( QFont.SansSerif ) + font = TQFont( "Newyork", 18 ) + font.setStyleHint( TQFont.SansSerif ) self.greetings.setFont( font ) self.showFontInfo( font ) def setItalics( self ): - font = QFont( "Tokyo" ) + font = TQFont( "Tokyo" ) font.setPointSize( 32 ) - font.setWeight( QFont.Bold ) + font.setWeight( TQFont.Bold ) font.setItalic( True ) self.greetings.setFont( font ) @@ -78,12 +78,12 @@ class Viewer( QWidget ): self.showFontInfo( font ) def showFontInfo( self, font ): - info = QFontInfo( font ) + info = TQFontInfo( font ) messageText = "Font requested: \"" + str(font.family()) + "\" " \ - + str(QString.number( font.pointSize() )) + "pt<BR>" \ + + str(TQString.number( font.pointSize() )) + "pt<BR>" \ + "Font used: \"" + str(info.family()) + "\" " \ - + str(QString.number( info.pointSize() )) + "pt<P>" + + str(TQString.number( info.pointSize() )) + "pt<P>" if not self.substitutes.isEmpty() : messageText += "The following substitutions exist for " + \ @@ -98,24 +98,24 @@ class Viewer( QWidget ): self.fontInfo.setText( messageText ) def setFontSubstitutions( self ): - self.substitutes = QStringList() + self.substitutes = TQStringList() self.substitutes.append( "Times" ) self.substitutes.append( "Mincho" ) self.substitutes.append( "Arabic Newspaper" ) self.substitutes.append( "crox" ) - #QFont.insertSubstitutions( "Bavaria", self.substitutes ) - QFont.insertSubstitution( "Bavaria", "Times" ) - QFont.insertSubstitution( "Tokyo", "Lucida" ) + #TQFont.insertSubstitutions( "Bavaria", self.substitutes ) + TQFont.insertSubstitution( "Bavaria", "Times" ) + TQFont.insertSubstitution( "Tokyo", "Lucida" ) - # For those who prefer to use Qt Designer for creating GUIs + # For those who prefer to use TQt Designer for creating GUIs # the following function might not be of particular interest: # all it does is creating the widget layout. def layout( self ): - textViewContainer = QHBoxLayout() + textViewContainer = TQHBoxLayout() textViewContainer.addWidget( self.greetings ) textViewContainer.addWidget( self.fontInfo ) - buttonContainer = QHBoxLayout() + buttonContainer = TQHBoxLayout() buttonContainer.addWidget( self.defaultButton ) buttonContainer.addWidget( self.sansSerifButton ) buttonContainer.addWidget( self.italicsButton ) @@ -131,17 +131,17 @@ class Viewer( QWidget ): self.sansSerifButton.setFixedHeight( maxButtonHeight ) self.italicsButton.setFixedHeight( maxButtonHeight ) - container = QVBoxLayout( self ) + container = TQVBoxLayout( self ) container.addLayout( textViewContainer ) container.addLayout( buttonContainer ) self.resize( 700, 250 ) def main( args ): - app = QApplication(sys.argv) # application object + app = TQApplication(sys.argv) # application object textViewer = Viewer() - textViewer.setCaption( "Qt Example - Simple QFont Demo" ) + textViewer.setCaption( "TQt Example - Simple TQFont Demo" ) app.setMainWidget( textViewer ) textViewer.show() diff --git a/examples3/gears.py b/examples3/gears.py index c89a7a2..a9f6bba 100755 --- a/examples3/gears.py +++ b/examples3/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/examples3/i18n/i18n.py b/examples3/i18n/i18n.py index 06cc97f..8595d0b 100755 --- a/examples3/i18n/i18n.py +++ b/examples3/i18n/i18n.py @@ -9,16 +9,16 @@ from qt import * from mywidget import MyWidget -class QVDialog(QDialog): +class TQVDialog(TQDialog): def __init__(self, parent=None, name=None, modal=0, flags=0): - QDialog.__init__(self, parent, name, modal, flags) + TQDialog.__init__(self, parent, name, modal, flags) - self.vb = QVBoxLayout(self, 8) + self.vb = TQVBoxLayout(self, 8) self.vb.setAutoAdd(1) self.hb = None self.map = {} - #self.sm = QSignalMapper(self) + #self.sm = TQSignalMapper(self) self.connect(self, PYSIGNAL('mapped(int)'), self.done) def addButtons(self, cancel=None, ok=None, mid1=None, mid2=None, mid3=None): @@ -43,8 +43,8 @@ class QVDialog(QDialog): def addButton(self, text, result): if self.hb is None: - self.hb = QHBox(self) - c = QPushButton(text, self.hb) + self.hb = TQHBox(self) + c = TQPushButton(text, self.hb) self.setMapping(c, result) self.connect(c, SIGNAL('clicked()'), self.mapit) @@ -61,13 +61,13 @@ wlist = [] # keep reference to widgets def showLang(lang): global translator - qApp.setPalette(QPalette(QColor(220-randint(0,64),220-randint(0,64),220-randint(0,64)))) + qApp.setPalette(TQPalette(TQColor(220-randint(0,64),220-randint(0,64),220-randint(0,64)))) language = "mywidget_"+lang+".qm" - fi = QFileInfo(language) + fi = TQFileInfo(language) if not fi.exists(): - QMessageBox.warning(None, "File error", + TQMessageBox.warning(None, "File error", "Cannot find translation for language: "+lang+\ "\n(try eg. 'de' or 'en')") return None @@ -76,16 +76,16 @@ def showLang(lang): qApp.removeTranslator(translator) translator = None - translator = QTranslator(None) + translator = TQTranslator(None) translator.load(language,".") qApp.installTranslator(translator) m = MyWidget() - m.setCaption("PyQt Example - i18n - " + unicode(m.caption())) + m.setCaption("PyTQt Example - i18n - " + unicode(m.caption())) wlist.append(m) return m def main(argv): - app = QApplication(argv) + app = TQApplication(argv) qm = ["cs", "de", "el", "en", "eo", "fr", "it", "jp", "ko", "no", "ru", "zh"] @@ -94,16 +94,16 @@ def main(argv): lang = argv[1] if (len(argv) != 2) or (lang == "all"): - dlg = QVDialog(None, None, 1) + dlg = TQVDialog(None, None, 1) qmb = [] r = 0 if lang == "all": r=2 else: - bg = QButtonGroup(4, Qt.Vertical, "Choose Locales", dlg) - loc = QTextCodec.locale() + bg = TQButtonGroup(4, TQt.Vertical, "Choose Locales", dlg) + loc = TQTextCodec.locale() for i in range(0,len(qm)): - qmb.append(QCheckBox(qm[i], bg)) + qmb.append(TQCheckBox(qm[i], bg)) qmb[i].setChecked(str(loc) == qm[i]) dlg.addButtons("Cancel","OK","All") r = dlg.exec_loop() @@ -138,7 +138,7 @@ def main(argv): lang = argv[1] m = showLang(lang) app.setMainWidget(m) - m.setCaption("PyQt Example - i18n") + m.setCaption("PyTQt Example - i18n") m.show() return app.exec_loop() diff --git a/examples3/i18n/mywidget.py b/examples3/i18n/mywidget.py index 60e267a..f69cebf 100644 --- a/examples3/i18n/mywidget.py +++ b/examples3/i18n/mywidget.py @@ -2,32 +2,32 @@ from qt import * -class MyWidget(QMainWindow): +class MyWidget(TQMainWindow): def __init__(self, parent=None, name=None): - QMainWindow.__init__(self, parent, name) + TQMainWindow.__init__(self, parent, name) - self.central = QVBox(self) + self.central = TQVBox(self) self.central.setMargin(5) self.central.setSpacing(5) self.setCentralWidget(self.central) self.setCaption(self.trUtf8("""Internationalization Example""")) - self.file = QPopupMenu(self) + self.file = TQPopupMenu(self) self.file.insertItem(self.trUtf8("E&xit"), qApp, SLOT("quit()"), - QKeySequence(self.trUtf8("Ctrl+Q","File|Quit"))) + TQKeySequence(self.trUtf8("Ctrl+Q","File|Quit"))) self.menuBar().insertItem(self.trUtf8("&File"), self.file) self.statusBar().message(self.trUtf8('''Language: English''')) - self.label = QLabel(self.trUtf8("The Main Window"), self.central) + self.label = TQLabel(self.trUtf8("The Main Window"), self.central) - self.gbox = QButtonGroup(1, QGroupBox.Horizontal, + self.gbox = TQButtonGroup(1, TQGroupBox.Horizontal, self.trUtf8("View"), self.central) - rb = QRadioButton(qApp.translate('MyWidget','Perspective'), self.gbox) - rb = QRadioButton(qApp.translate('MyWidget','Isometric'), self.gbox) - rb = QRadioButton(qApp.translate('MyWidget','Oblique'), self.gbox) + rb = TQRadioButton(qApp.translate('MyWidget','Perspective'), self.gbox) + rb = TQRadioButton(qApp.translate('MyWidget','Isometric'), self.gbox) + rb = TQRadioButton(qApp.translate('MyWidget','Oblique'), self.gbox) self.initChoices(self.central) @@ -38,10 +38,10 @@ class MyWidget(QMainWindow): ] def initChoices(self, parent): - self.lb = QListBox(parent) + self.lb = TQListBox(parent) for ch in self.choices: self.lb.insertItem(self.trUtf8(ch)) def closeEvent(self, e): - QWidget.closeEvent(self, e) + TQWidget.closeEvent(self, e) self.emit(PYSIGNAL('closed'), ()) diff --git a/examples3/i18n/mywidget_cs.ts b/examples3/i18n/mywidget_cs.ts index 4cf61f1..2b82f04 100644 --- a/examples3/i18n/mywidget_cs.ts +++ b/examples3/i18n/mywidget_cs.ts @@ -55,14 +55,14 @@ </message> </context> <context encoding="UTF-8"> - <name>QAccel</name> + <name>TQAccel</name> <message encoding="UTF-8"> <source>Ctrl</source> <translation type="obsolete">Ctrl</translation> </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/i18n/mywidget_de.ts b/examples3/i18n/mywidget_de.ts index d114b8b..0a60c2b 100644 --- a/examples3/i18n/mywidget_de.ts +++ b/examples3/i18n/mywidget_de.ts @@ -56,7 +56,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation>OK</translation> diff --git a/examples3/i18n/mywidget_el.ts b/examples3/i18n/mywidget_el.ts index 59fb228..0d7a5dc 100644 --- a/examples3/i18n/mywidget_el.ts +++ b/examples3/i18n/mywidget_el.ts @@ -55,7 +55,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/i18n/mywidget_en.ts b/examples3/i18n/mywidget_en.ts index f231669..30a6e66 100644 --- a/examples3/i18n/mywidget_en.ts +++ b/examples3/i18n/mywidget_en.ts @@ -56,7 +56,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/i18n/mywidget_eo.ts b/examples3/i18n/mywidget_eo.ts index 381870d..f4eaef4 100644 --- a/examples3/i18n/mywidget_eo.ts +++ b/examples3/i18n/mywidget_eo.ts @@ -59,7 +59,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/i18n/mywidget_fr.ts b/examples3/i18n/mywidget_fr.ts index a029084..3fa0191 100644 --- a/examples3/i18n/mywidget_fr.ts +++ b/examples3/i18n/mywidget_fr.ts @@ -55,7 +55,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/i18n/mywidget_it.ts b/examples3/i18n/mywidget_it.ts index a450deb..4fa708c 100644 --- a/examples3/i18n/mywidget_it.ts +++ b/examples3/i18n/mywidget_it.ts @@ -59,7 +59,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/i18n/mywidget_jp.ts b/examples3/i18n/mywidget_jp.ts index 2a7345f..029dd0e 100644 --- a/examples3/i18n/mywidget_jp.ts +++ b/examples3/i18n/mywidget_jp.ts @@ -55,7 +55,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/i18n/mywidget_ko.ts b/examples3/i18n/mywidget_ko.ts index acc8f9b..632f8a7 100644 --- a/examples3/i18n/mywidget_ko.ts +++ b/examples3/i18n/mywidget_ko.ts @@ -55,7 +55,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/i18n/mywidget_no.ts b/examples3/i18n/mywidget_no.ts index 341c664..b91293c 100644 --- a/examples3/i18n/mywidget_no.ts +++ b/examples3/i18n/mywidget_no.ts @@ -55,7 +55,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/i18n/mywidget_ru.ts b/examples3/i18n/mywidget_ru.ts index 07070b0..d279ed1 100644 --- a/examples3/i18n/mywidget_ru.ts +++ b/examples3/i18n/mywidget_ru.ts @@ -55,7 +55,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/i18n/mywidget_zh.ts b/examples3/i18n/mywidget_zh.ts index 8b015d6..0dcb2df 100644 --- a/examples3/i18n/mywidget_zh.ts +++ b/examples3/i18n/mywidget_zh.ts @@ -55,7 +55,7 @@ </message> </context> <context> - <name>QVDialog</name> + <name>TQVDialog</name> <message> <source>OK</source> <translation type="unfinished"></translation> diff --git a/examples3/lineedits.py b/examples3/lineedits.py index 7d1a37a..5ff9538 100755 --- a/examples3/lineedits.py +++ b/examples3/lineedits.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. #** #*****************************************************************************/ @@ -16,37 +16,37 @@ from qt import * TRUE = 1 FALSE = 0 -class LineEdits(QGroupBox): +class LineEdits(TQGroupBox): def __init__(self, parent = None, name = None): - QGroupBox.__init__(self, 0, Qt.Horizontal, "Line Edits", parent, name) + TQGroupBox.__init__(self, 0, TQt.Horizontal, "Line Edits", parent, name) self.setMargin(10) - box = QVBoxLayout(self.layout()) + box = TQVBoxLayout(self.layout()) - row1 = QHBoxLayout(box) + row1 = TQHBoxLayout(box) row1.setMargin(5) - label = QLabel("Echo Mode: ", self) + label = TQLabel("Echo Mode: ", self) row1.addWidget(label) - combo1 = QComboBox(FALSE, self) + combo1 = TQComboBox(FALSE, self) row1.addWidget(combo1) combo1.insertItem("Normal", -1) combo1.insertItem("Password", -1) combo1.insertItem("No Echo", -1) self.connect(combo1, SIGNAL("activated(int)"), self.slotEchoChanged) - self.lined1 = QLineEdit(self) + self.lined1 = TQLineEdit(self) box.addWidget(self.lined1) - row2 = QHBoxLayout(box) + row2 = TQHBoxLayout(box) row2.setMargin(5) - label = QLabel("Validator: ", self) + label = TQLabel("Validator: ", self) row2.addWidget(label) - combo2 = QComboBox(FALSE, self) + combo2 = TQComboBox(FALSE, self) row2.addWidget(combo2) combo2.insertItem("No Validator", -1) combo2.insertItem("Integer Validator", -1) @@ -54,49 +54,49 @@ class LineEdits(QGroupBox): self.connect(combo2, SIGNAL("activated(int)"), self.slotValidatorChanged) - self.lined2 = QLineEdit(self) + self.lined2 = TQLineEdit(self) box.addWidget(self.lined2) - row3 = QHBoxLayout(box) + row3 = TQHBoxLayout(box) row3.setMargin(5) - label = QLabel("Alignment: ", self) + label = TQLabel("Alignment: ", self) row3.addWidget(label) - combo3 = QComboBox(FALSE, self) + combo3 = TQComboBox(FALSE, self) row3.addWidget(combo3) combo3.insertItem("Left", -1) combo3.insertItem("Centered", -1) combo3.insertItem("Right", -1) self.connect(combo3, SIGNAL("activated(int)"), self.slotAlignmentChanged) - self.lined3 = QLineEdit(self) + self.lined3 = TQLineEdit(self) box.addWidget(self.lined3) - row4 = QHBox(self) + row4 = TQHBox(self) box.addWidget(row4) row4.setMargin(5) - QLabel("Read-Only: ", row4) + TQLabel("Read-Only: ", row4) - combo4 = QComboBox(FALSE, row4) + combo4 = TQComboBox(FALSE, row4) combo4.insertItem("False", -1) combo4.insertItem("True", -1) self.connect(combo4, SIGNAL("activated(int)"), self.slotReadOnlyChanged) - self.lined4 = QLineEdit(self) + self.lined4 = TQLineEdit(self) box.addWidget(self.lined4) self.lined1.setFocus() def slotEchoChanged(self, i): if i == 0: - self.lined1.setEchoMode(QLineEdit.Normal) + self.lined1.setEchoMode(TQLineEdit.Normal) elif i == 1: - self.lined1.setEchoMode(QLineEdit.Password) + self.lined1.setEchoMode(TQLineEdit.Password) elif i == 2: - self.lined1.setEchoMode(QLineEdit.NoEcho) + self.lined1.setEchoMode(TQLineEdit.NoEcho) self.lined1.setFocus() @@ -104,20 +104,20 @@ class LineEdits(QGroupBox): if i == 0: self.lined2.setValidator(None) elif i == 1: - self.lined2.setValidator(QIntValidator(self.lined2)) + self.lined2.setValidator(TQIntValidator(self.lined2)) elif i == 2: - self.lined2.setValidator(QDoubleValidator(-999.0, 999.0, 2, self.lined2)) + self.lined2.setValidator(TQDoubleValidator(-999.0, 999.0, 2, self.lined2)) self.lined2.setText("") self.lined2.setFocus() def slotAlignmentChanged(self, i): if i == 0: - self.lined3.setAlignment(QLineEdit.AlignLeft) + self.lined3.setAlignment(TQLineEdit.AlignLeft) elif i == 1: - self.lined3.setAlignment(QLineEdit.AlignCenter) + self.lined3.setAlignment(TQLineEdit.AlignCenter) elif i == 2: - self.lined3.setAlignment(QLineEdit.AlignRight) + self.lined3.setAlignment(TQLineEdit.AlignRight) self.lined3.setFocus() @@ -131,10 +131,10 @@ class LineEdits(QGroupBox): if __name__=='__main__': - app = QApplication( sys.argv ) + app = TQApplication( sys.argv ) lineedits = LineEdits() - lineedits.setCaption("Lineedits - PyQt Example") + lineedits.setCaption("Lineedits - PyTQt Example") lineedits.show() app.setMainWidget(lineedits) app.exec_loop() diff --git a/examples3/listbox.py b/examples3/listbox.py index 624935d..c83add0 100755 --- a/examples3/listbox.py +++ b/examples3/listbox.py @@ -5,7 +5,7 @@ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** ***************************************************************************""" @@ -16,42 +16,42 @@ from qt import * FALSE = 0 TRUE = 1 -class ListBoxDemo( QWidget ): +class ListBoxDemo( TQWidget ): def __init__( self, parent=None, name=None ): - QWidget.__init__( self, parent, name ) + TQWidget.__init__( self, parent, name ) b = FALSE - g = QGridLayout( self, 2, 2, 6 ) + g = TQGridLayout( self, 2, 2, 6 ) - g.addWidget( QLabel( "<b>Configuration:</b>", self ), 0, 0 ) - g.addWidget( QLabel( "<b>Result:</b>", self ), 0, 1 ) + g.addWidget( TQLabel( "<b>Configuration:</b>", self ), 0, 0 ) + g.addWidget( TQLabel( "<b>Result:</b>", self ), 0, 1 ) - self.l = QListBox( self ) + self.l = TQListBox( self ) g.addWidget( self.l, 1, 1 ) - self.l.setFocusPolicy( QWidget.StrongFocus ) + self.l.setFocusPolicy( TQWidget.StrongFocus ) - v = QVBoxLayout( ) + v = TQVBoxLayout( ) g.addLayout( v, 1, 0 ) - bg = QButtonGroup( self, None ) + bg = TQButtonGroup( self, None ) - b = QRadioButton( "Fixed number of columns,\n" + b = TQRadioButton( "Fixed number of columns,\n" "as many rows as needed.", self ) bg.insert( b ) v.addWidget( b ) b.setChecked( TRUE ) self.connect( b, SIGNAL("clicked()"), self.setNumCols ) - h = QHBoxLayout() + h = TQHBoxLayout() v.addLayout( h ) h.addSpacing( 30 ) h.addSpacing( 100 ) - h.addWidget( QLabel( "Columns:", self ) ) - self.columns = QSpinBox( self ) + h.addWidget( TQLabel( "Columns:", self ) ) + self.columns = TQSpinBox( self ) h.addWidget( self.columns ) v.addSpacing( 12 ) - b = QRadioButton( "As many columns as fit on-screen,\n" + b = TQRadioButton( "As many columns as fit on-screen,\n" "as many rows as needed.", self ) bg.insert( b ) @@ -60,24 +60,24 @@ class ListBoxDemo( QWidget ): v.addSpacing( 12 ) - b = QRadioButton( "Fixed number of rows,\n" + b = TQRadioButton( "Fixed number of rows,\n" "as many columns as needed.", self ) bg.insert( b ) v.addWidget( b ) self.connect( b, SIGNAL("clicked()"), self.setNumRows ) - h = QHBoxLayout() + h = TQHBoxLayout() v.addLayout( h ) h.addSpacing( 30 ) h.addSpacing( 100 ) - h.addWidget( QLabel( "Rows:", self ) ) - self.rows = QSpinBox( self ) + h.addWidget( TQLabel( "Rows:", self ) ) + self.rows = TQSpinBox( self ) self.rows.setEnabled( FALSE ) h.addWidget( self.rows ) v.addSpacing( 12 ) - b = QRadioButton( "As many rows as fit on-screen,\n" + b = TQRadioButton( "As many rows as fit on-screen,\n" "as many columns as needed.", self ) bg.insert( b ) @@ -86,25 +86,25 @@ class ListBoxDemo( QWidget ): v.addSpacing( 12 ) - cb = QCheckBox( "Variable-height rows", self ) + cb = TQCheckBox( "Variable-height rows", self ) cb.setChecked( TRUE ) self.connect( cb, SIGNAL("toggled(bool)"), self.setVariableHeight ) v.addWidget( cb ) v.addSpacing( 6 ) - cb = QCheckBox( "Variable-width columns", self ) + cb = TQCheckBox( "Variable-width columns", self ) self.connect( cb, SIGNAL("toggled(bool)"), self.setVariableWidth ) v.addWidget( cb ) - cb = QCheckBox( "Extended-Selection", self ) + cb = TQCheckBox( "Extended-Selection", self ) self.connect( cb, SIGNAL("toggled(bool)"), self.setMultiSelection ) v.addWidget( cb ) - pb = QPushButton( "Sort ascending", self ) + pb = TQPushButton( "Sort ascending", self ) self.connect( pb, SIGNAL("clicked()"), self.sortAscending ) v.addWidget( pb ) - pb = QPushButton( "Sort descending", self ) + pb = TQPushButton( "Sort descending", self ) self.connect( pb, SIGNAL("clicked()"), self.sortDescending ) v.addWidget( pb ) @@ -113,7 +113,7 @@ class ListBoxDemo( QWidget ): i = 0 while i <= 2560: i+=1 - self.l.insertItem( str(QString.fromLatin1( "Item " )) + str(QString.number( i )), i ) + self.l.insertItem( str(TQString.fromLatin1( "Item " )) + str(TQString.number( i )), i ) self.columns.setRange( 1, 256 ) self.columns.setValue( 1 ) self.rows.setRange( 1, 256 ) @@ -136,12 +136,12 @@ class ListBoxDemo( QWidget ): def setRowsByHeight( self ): self.columns.setEnabled( FALSE ) self.rows.setEnabled( FALSE ) - self.l.setRowMode( QListBox.FitToHeight ) + self.l.setRowMode( TQListBox.FitToHeight ) def setColsByWidth( self ): self.columns.setEnabled( FALSE ) self.rows.setEnabled( FALSE ) - self.l.setColumnMode( QListBox.FitToWidth ) + self.l.setColumnMode( TQListBox.FitToWidth ) def setVariableWidth( self, b ): self.l.setVariableWidth( b ) @@ -152,9 +152,9 @@ class ListBoxDemo( QWidget ): def setMultiSelection( self, b ): self.l.clearSelection() if b : - self.l.setSelectionMode( QListBox.Extended ) + self.l.setSelectionMode( TQListBox.Extended ) else: - self.l.setSelectionMode( QListBox.Single ) + self.l.setSelectionMode( TQListBox.Single ) def sortAscending( self ): self.l.sort( TRUE ) @@ -164,9 +164,9 @@ class ListBoxDemo( QWidget ): def main( args ): - a = QApplication( args ) + a = TQApplication( args ) t = ListBoxDemo() - t.setCaption( "Qt Example - Listbox" ) + t.setCaption( "TQt Example - Listbox" ) a.setMainWidget( t ) t.show() diff --git a/examples3/listboxcombo.py b/examples3/listboxcombo.py index 6958089..1a39310 100755 --- a/examples3/listboxcombo.py +++ b/examples3/listboxcombo.py @@ -5,7 +5,7 @@ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** ***************************************************************************""" @@ -16,84 +16,84 @@ from qt import * FALSE = 0 TRUE = 1 -class ListBoxCombo( QVBox ): +class ListBoxCombo( TQVBox ): # Constructor # Creates child widgets of the ListBoxCombo widget def __init__( self, parent=None, name=None ): - QVBox.__init__( self, parent, name ) + TQVBox.__init__( self, parent, name ) self.setMargin( 5 ) self.setSpacing( 5 ) i = 0 - row1 = QHBox( self ) + row1 = TQHBox( self ) row1.setSpacing( 5 ) # Create a multi-selection ListBox... - self.lb1 = QListBox( row1 ) - self.lb1.setSelectionMode( QListBox.Multi ) + self.lb1 = TQListBox( row1 ) + self.lb1.setSelectionMode( TQListBox.Multi ) # ...insert a pixmap item... - xpm = QPixmap( "qtlogo.png" ) - txt = QString() - QListBoxPixmap( self.lb1, xpm, txt ) + xpm = TQPixmap( "qtlogo.png" ) + txt = TQString() + TQListBoxPixmap( self.lb1, xpm, txt ) # ...and 100 text items for i in range(0, 100, 1) : - xpm = QPixmap() - txt = QString( "Listbox Item %1" ).arg( i ) + xpm = TQPixmap() + txt = TQString( "Listbox Item %1" ).arg( i ) if not i % 4 : - xpm = QPixmap( "fileopen.xpm" ) - QListBoxPixmap( self.lb1, xpm, txt ) + xpm = TQPixmap( "fileopen.xpm" ) + TQListBoxPixmap( self.lb1, xpm, txt ) # Create a pushbutton... - arrow1 = QPushButton( " -> ", row1 ) + arrow1 = TQPushButton( " -> ", row1 ) # ...and connect the clicked SIGNAL with the SLOT slotLeft2Right self.connect( arrow1, SIGNAL("clicked()"), self.slotLeft2Right ) # create an empty single-selection ListBox - self.lb2 = QListBox( row1 ) + self.lb2 = TQListBox( row1 ) - row2 = QHBox( self ) + row2 = TQHBox( self ) row2.setSpacing( 5 ) - box1 = QVBox( row2 ) + box1 = TQVBox( row2 ) box1.setSpacing( 5 ) # Create a non-editable Combobox and a label below... - cb1 = QComboBox( FALSE, box1 ) - self.label1 = QLabel( "Current Item: Combobox Item 0", box1 ) + cb1 = TQComboBox( FALSE, box1 ) + self.label1 = TQLabel( "Current Item: Combobox Item 0", box1 ) self.label1.setMaximumHeight( self.label1.sizeHint().height() * 2 ) - self.label1.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + self.label1.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) #...and insert 50 items into the Combobox for i in range( 0, 50, 1 ) : - txt = str( QString( "Combobox Item %1" ).arg( i ) ) + txt = str( TQString( "Combobox Item %1" ).arg( i ) ) if i % 9 : cb1.insertItem( txt ) else : cb1.listBox().insertItem( MyListBoxItem() ) - box2 = QVBox( row2 ) + box2 = TQVBox( row2 ) box2.setSpacing( 5 ) # Create an editable Combobox and a label below... - cb2 = QComboBox( TRUE, box2 ) - self.label2 = QLabel( "Current Item: Combobox Item 0", box2 ) + cb2 = TQComboBox( TRUE, box2 ) + self.label2 = TQLabel( "Current Item: Combobox Item 0", box2 ) self.label2.setMaximumHeight( self.label2.sizeHint().height() * 2 ) - self.label2.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + self.label2.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) # ... and insert 50 items into the Combobox for i in range(0, 50, 1 ) : - txt = str(QString( "Combobox Item %1" ).arg( i )) + txt = str(TQString( "Combobox Item %1" ).arg( i )) if not i % 4 : - cb2.insertItem( QPixmap( "fileopen.xpm" ), txt ) + cb2.insertItem( TQPixmap( "fileopen.xpm" ), txt ) else : cb2.insertItem( txt ) # Connect the activated SIGNALs of the Comboboxes with SLOTs - self.connect( cb1, SIGNAL("activated( const QString & )"), self.slotCombo1Activated ) - self.connect( cb2, SIGNAL("activated( const QString & )"), self.slotCombo2Activated ) + self.connect( cb1, SIGNAL("activated( const TQString & )"), self.slotCombo1Activated ) + self.connect( cb2, SIGNAL("activated( const TQString & )"), self.slotCombo2Activated ) """ SLOT slotLeft2Right * Copies all selected items of the first ListBox into the second ListBox @@ -112,24 +112,24 @@ class ListBoxCombo( QVBox ): elif item.text().isEmpty() : self.lb2.insertItem( item.pixmap() ) - """ SLOT slotCombo1Activated( const QString &s ) + """ SLOT slotCombo1Activated( const TQString &s ) * Sets the text of the item which the user just selected in the * first Combobox (and is now the value of s) to the first Label. """ def slotCombo1Activated( self, s ) : - self.label1.setText( str(QString( "Current Item: %1" ).arg( s ) ) ) + self.label1.setText( str(TQString( "Current Item: %1" ).arg( s ) ) ) - """ SLOT slotCombo2Activated( const QString &s ) + """ SLOT slotCombo2Activated( const TQString &s ) * Sets the text of the item which the user just selected in the * second Combobox (and is now the value of s) to the second Label. """ def slotCombo2Activated( self, s ) : - self.label2.setText( str(QString( "Current Item: %1" ).arg( s ) ) ) + self.label2.setText( str(TQString( "Current Item: %1" ).arg( s ) ) ) -class MyListBoxItem( QListBoxItem ): +class MyListBoxItem( TQListBoxItem ): def __init__( self, parent=None, name=None ): - QListBoxItem.__init__( self, parent, name ) + TQListBoxItem.__init__( self, parent, name ) self.setCustomHighlighting( TRUE ) def paint( self, painter ): @@ -137,27 +137,27 @@ class MyListBoxItem( QListBoxItem ): in_list_box = 0 if self.listBox() and self.listBox().viewport() == painter.device(): in_list_box = 1 - r = QRect( 0, 0, self.width( self.listBox() ), self.height( self.listBox() ) ) - brush = QBrush( Qt.red, Qt.SolidPattern ) + r = TQRect( 0, 0, self.width( self.listBox() ), self.height( self.listBox() ) ) + brush = TQBrush( TQt.red, TQt.SolidPattern ) if in_list_box and isSelected(): painter.eraseRect( r ) painter.fillRect( 5, 5, self.width( self.listBox() ) - 10, self.height( self.listBox() ) - 10, brush ) if in_list_box and isCurrent(): - self.listBox().style().drawPrimitive( QStyle.PE_FocusRect, painter, r, self.listBox().colorGroup() ) + self.listBox().style().drawPrimitive( TQStyle.PE_FocusRect, painter, r, self.listBox().colorGroup() ) - def width( self, QListBox ): + def width( self, TQListBox ): return 100 - def height( self, QListBox ): + def height( self, TQListBox ): return 16 def main( args ): - a = QApplication( args ) + a = TQApplication( args ) listboxcombo = ListBoxCombo() listboxcombo.resize( 400, 270 ) - listboxcombo.setCaption( "Qt Example - Listboxes and Comboboxes" ) + listboxcombo.setCaption( "TQt Example - Listboxes and Comboboxes" ) a.setMainWidget( listboxcombo ) listboxcombo.show(); diff --git a/examples3/marble.png b/examples3/marble.png Binary files differindex 49ea309..c81145c 100644 --- a/examples3/marble.png +++ b/examples3/marble.png diff --git a/examples3/mdi.py b/examples3/mdi.py index 2c1d121..3ff7e2e 100755 --- a/examples3/mdi.py +++ b/examples3/mdi.py @@ -118,39 +118,39 @@ You can also select the <b>Print</b> command from the <b>File</b> menu.''' True=1 False=0 -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(QIconSet(openIcon),'Open File',QString.null,self.load,self.fileTools,'open file') + openIcon = TQPixmap(fileopen) + self.fileOpen = TQToolButton(TQIconSet(openIcon),'Open File',TQString.null,self.load,self.fileTools,'open file') - saveIcon = QPixmap(filesave) - self.fileSave = QToolButton(QIconSet(saveIcon),'Save File',QString.null,self.save,self.fileTools,'save file') - printIcon = QPixmap(fileprint) - self.filePrint = QToolButton(QIconSet(printIcon),'Print File',QString.null,self.printDoc,self.fileTools,'print file') + saveIcon = TQPixmap(filesave) + self.fileSave = TQToolButton(TQIconSet(saveIcon),'Save File',TQString.null,self.save,self.fileTools,'save file') + printIcon = TQPixmap(fileprint) + self.filePrint = TQToolButton(TQIconSet(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) @@ -158,35 +158,35 @@ 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.menuBar().insertSeparator() - self.windows = QPopupMenu( self ) + self.windows = TQPopupMenu( self ) self.windows.setCheckable( True ) self.connect( self.windows, SIGNAL( "aboutToShow()" ), self.windowsMenuAboutToShow ) self.menuBar().insertItem( "&Windows", self.windows ) - 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.help.insertSeparator() - self.help.insertItem( "What's &This", self, SLOT("whatsThis()"), Qt.SHIFT+Qt.Key_F1) + self.help.insertItem( "What's &This", self, SLOT("whatsThis()"), TQt.SHIFT+TQt.Key_F1) self.menuBar().insertSeparator() - self.vb = QVBox( self ) - self.vb.setFrameStyle( QFrame.StyledPanel | QFrame.Sunken ) - self.ws = QWorkspace( self.vb ) + self.vb = TQVBox( self ) + self.vb.setFrameStyle( TQFrame.StyledPanel | TQFrame.Sunken ) + self.ws = TQWorkspace( self.vb ) self.ws.setScrollBarsEnabled( True ) self.setCentralWidget( self.vb ) @@ -194,10 +194,10 @@ class ApplicationWindow(QMainWindow): #self.resize(450,600) def newDoc(self): - w = MDIWindow( self.ws, "", Qt.WDestructiveClose ) - self.connect( w, PYSIGNAL( "message" ), self.statusBar(), SLOT( "message(const QString&, int )") ) + w = MDIWindow( self.ws, "", TQt.WDestructiveClose ) + self.connect( w, PYSIGNAL( "message" ), self.statusBar(), SLOT( "message(const TQString&, int )") ) w.setCaption("unnamed document") - w.setIcon( QPixmap(document) ) + w.setIcon( TQPixmap(document) ) # show the very first window in maximized mode if len(self.ws.windowList())==0: w.showMaximized() @@ -206,7 +206,7 @@ class ApplicationWindow(QMainWindow): return w def load(self): - fn = QFileDialog.getOpenFileName( QString.null, QString.null, self ) + fn = TQFileDialog.getOpenFileName( TQString.null, TQString.null, self ) if not fn.isEmpty(): w = self.newDoc() w.load( fn ) @@ -234,12 +234,12 @@ class ApplicationWindow(QMainWindow): m.close() def about(self): - QMessageBox.about( self, "Qt Application Example", + TQMessageBox.about( self, "TQt Application Example", "This example demonstrates simple use of\n " - "Qt's Multiple Document Interface (MDI).") + "TQt's Multiple Document Interface (MDI).") - def aboutQt(self): - QMessageBox.aboutQt( self, "Qt Application Example" ) + def aboutTQt(self): + TQMessageBox.aboutTQt( self, "TQt Application Example" ) def windowsMenuAboutToShow(self): self.windows.clear() @@ -264,42 +264,42 @@ class ApplicationWindow(QMainWindow): w.setFocus() -class MDIWindow( QMainWindow): +class MDIWindow( TQMainWindow): def __init__(self,parent, name, wflags ): - QMainWindow.__init__(self,parent, name, wflags ) + TQMainWindow.__init__(self,parent, name, wflags ) self.mmovie = 0 - self.medit = QMultiLineEdit( self ) + self.medit = TQMultiLineEdit( self ) self.setFocusProxy( self.medit ) self.setCentralWidget( self.medit ); def load(self, fn ): self.filename = fn - self.f=QFile( self.filename ) + self.f=TQFile( self.filename ) if not self.f.open( IO_ReadOnly ): return if fn.contains(".gif"): - tmp=QWidget(self) + tmp=TQWidget(self) self.setFocusProxy(tmp) self.setCentralWidget(tmp) self.medit.hide() del self.medit - qm=QMovie(fn) + qm=TQMovie(fn) #ifdef Q_WS_QWS // temporary speed-test hack #qm->setDisplayWidget(tmp); #endif - tmp.setBackgroundMode(QWidget.NoBackground) + tmp.setBackgroundMode(TQWidget.NoBackground) tmp.show() self.mmovie=qm else : self.mmovie = 0 - t=QTextStream(self.f) + t=TQTextStream(self.f) s = t.read() self.medit.setText( s ) self.f.close() self.setCaption( self.filename ) - self.emit(PYSIGNAL( "message"),(QString("Loaded document %1").arg(self.filename),2000 )) + self.emit(PYSIGNAL( "message"),(TQString("Loaded document %1").arg(self.filename),2000 )) def save(self): if self.filename.isEmpty(): @@ -308,53 +308,53 @@ class MDIWindow( QMainWindow): text = self.medit.text() output=open(str(self.filename),'w') output.write(str(text)) - #emit message( QString("Could not write to %1").arg(filename), 2000 ); + #emit message( TQString("Could not write to %1").arg(filename), 2000 ); #return output.close() self.setCaption(self.filename) - self.emit(PYSIGNAL( "message"),(QString("File %1 saved").arg(self.filename),2000 )) + self.emit(PYSIGNAL( "message"),(TQString("File %1 saved").arg(self.filename),2000 )) def saveAs(self): - fn = QFileDialog.getSaveFileName( self.filename, QString.null, self ) + fn = TQFileDialog.getSaveFileName( self.filename, TQString.null, self ) if not fn.isEmpty(): self.filename = fn self.save() else : - self.emit(PYSIGNAL( "message"),(QString("Saving aborted"),2000 )) + self.emit(PYSIGNAL( "message"),(TQString("Saving aborted"),2000 )) def printDoc(self,printer): Margin = 10 pageNo = 1 if printer.setup(self): - self.emit(PYSIGNAL( "message"),(QString("Printing..."),2000 )) - p = QPainter() + self.emit(PYSIGNAL( "message"),(TQString("Printing..."),2000 )) + p = TQPainter() p.begin(printer) p.setFont(self.medit.font()) yPos = 0 fm = p.fontMetrics() - metrics = QPaintDeviceMetrics(printer) + metrics = TQPaintDeviceMetrics(printer) for i in range(self.medit.numLines()): if Margin + yPos > metrics.height() - Margin: pageNo = pageNo + 1 - self.emit(PYSIGNAL( "message"),(QString("Printing (page %1) ...").arg(pageNo),2000 )) + self.emit(PYSIGNAL( "message"),(TQString("Printing (page %1) ...").arg(pageNo),2000 )) printer.newPage() yPos = 0 - p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip,self.medit.textLine(i)) + p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),TQt.ExpandTabs | TQt.DontClip,self.medit.textLine(i)) yPos = yPos + fm.lineSpacing() p.end() - self.emit(PYSIGNAL( "message"),(QString("Printing completed"),2000 )) + self.emit(PYSIGNAL( "message"),(TQString("Printing completed"),2000 )) else: - self.emit(PYSIGNAL( "message"),(QString("Printing aborted"),2000 )) + self.emit(PYSIGNAL( "message"),(TQString("Printing aborted"),2000 )) if __name__=='__main__': - a = QApplication(sys.argv) + a = TQApplication(sys.argv) mw = ApplicationWindow() - mw.setCaption("PyQt Example - Multiple Documents Interface (MDI)") + mw.setCaption("PyTQt Example - Multiple Documents Interface (MDI)") mw.show() a.connect(a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()')) a.exec_loop() diff --git a/examples3/menu.py b/examples3/menu.py index baab2a6..bb3f998 100755 --- a/examples3/menu.py +++ b/examples3/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. #** #*****************************************************************************/ @@ -92,30 +92,30 @@ p3_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, f ): - QCustomMenuItem.__init__( self ) + TQCustomMenuItem.__init__( self ) self.string = s self.font = f def paint( self, p, cg, act, enabled, x, y, w, h ) : p.setFont ( self.font ) - p.drawText( x, y, w, h, Qt.AlignLeft | Qt.AlignVCenter | Qt.ShowPrefix | Qt.DontClip, self.string ) + p.drawText( x, y, w, h, TQt.AlignLeft | TQt.AlignVCenter | TQt.ShowPrefix | TQt.DontClip, self.string ) def sizeHint( self ): - return QFontMetrics( self.font ).size( Qt.AlignLeft | Qt.AlignVCenter | Qt.ShowPrefix | Qt.DontClip, self.string ) + return TQFontMetrics( self.font ).size( TQt.AlignLeft | TQt.AlignVCenter | TQt.ShowPrefix | TQt.DontClip, self.string ) # Implementation of MenuExample class -class MenuExample( QWidget ): +class MenuExample( TQWidget ): def __init__( self, parent=None, name=None ): - QWidget.__init__( self, parent, name ) - self.p1 = QIconSet( QPixmap ( p1_xpm ) ) - self.p2 = QIconSet( QPixmap ( p2_xpm ) ) - self.p3 = QIconSet( QPixmap ( p3_xpm ) ) + TQWidget.__init__( self, parent, name ) + self.p1 = TQIconSet( TQPixmap ( p1_xpm ) ) + self.p2 = TQIconSet( TQPixmap ( p2_xpm ) ) + self.p3 = TQIconSet( TQPixmap ( p3_xpm ) ) - self.printer = QPopupMenu( self ) + self.printer = TQPopupMenu( self ) self.printer.insertTearOffHandle() self.printer.insertItem( "&Print to printer", self.printDoc ) self.printer.insertItem( "Print to &file", self.printFile ) @@ -123,23 +123,23 @@ class MenuExample( QWidget ): self.printer.insertSeparator() self.printer.insertItem( "Printer &Setup", self.printerSetup ) - self.file = QPopupMenu( self ) - 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 = TQPopupMenu( self ) + 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( "&Print", self.printer, Qt.CTRL+Qt.Key_P ) + self.file.insertItem( "&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 ) undoID = self.edit.insertItem( "&Undo", self.undo ) redoID = self.edit.insertItem( "&Redo", self.redo ) self.edit.setItemEnabled( undoID, FALSE ) self.edit.setItemEnabled( redoID, FALSE ) - self.options = QPopupMenu( self ) + self.options = TQPopupMenu( self ) self.options.insertTearOffHandle() self.options.setCaption( "Options" ) self.options.insertItem( "&Normal Font", self.normal ) @@ -149,63 +149,63 @@ class MenuExample( QWidget ): f = self.options.font() f.setBold( TRUE ) self.boldID = self.options.insertItem( MyMenuItem( "Bold", f ) ) - 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 ) f = self.options.font() f.setUnderline( TRUE ) self.underlineID = self.options.insertItem( MyMenuItem( "Underline", f ) ) - 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.help = QPopupMenu( self ) - self.help.insertItem( "&About", self.about, Qt.CTRL+Qt.Key_H ) - self.help.insertItem( "About &Qt", self.aboutQt ) + self.help = TQPopupMenu( self ) + 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 ) 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 ) - msg = QLabel( self ) + msg = TQLabel( self ) msg.setText( "A context menu is available.\n" "Invoke it by right-clicking or by" " pressing the 'context' button." ) msg.setGeometry( 0, self.height() - 60, self.width(), 60 ) - msg.setAlignment( Qt.AlignCenter ) + msg.setAlignment( TQt.AlignCenter ) - self.label = QLabel( self ) + self.label = TQLabel( self ) 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.connect( self, PYSIGNAL( "explain" ), self.label, SLOT( "setText(const QString &" ) ) + self.connect( self, PYSIGNAL( "explain" ), self.label, SLOT( "setText(const TQString &" ) ) self.setMinimumSize( 100, 80 ) - self.setFocusPolicy( QWidget.ClickFocus ) + self.setFocusPolicy( TQWidget.ClickFocus ) def contextMenuEvent(self, cmev): - contextMenu = QPopupMenu( self ) - caption = QLabel( "<font color=darkblue><u><b>Context Menu</b></u></font>", self ) - caption.setAlignment( Qt.AlignCenter ) + contextMenu = TQPopupMenu( self ) + caption = TQLabel( "<font color=darkblue><u><b>Context Menu</b></u></font>", self ) + caption.setAlignment( TQt.AlignCenter ) contextMenu.insertItem( caption ) - contextMenu.insertItem( "&New", self.news, Qt.CTRL+Qt.Key_N ) - contextMenu.insertItem( "&Open...", self.open, Qt.CTRL+Qt.Key_O ) - contextMenu.insertItem( "&Save", self.save, Qt.CTRL+Qt.Key_S ) - submenu = QPopupMenu( self ) + contextMenu.insertItem( "&New", self.news, TQt.CTRL+TQt.Key_N ) + contextMenu.insertItem( "&Open...", self.open, TQt.CTRL+TQt.Key_O ) + contextMenu.insertItem( "&Save", self.save, TQt.CTRL+TQt.Key_S ) + submenu = TQPopupMenu( self ) submenu.insertItem( "&Print to printer", self.printDoc ) submenu.insertItem( "Print to &file", self.printFile ) submenu.insertItem( "Print to fa&x", self.fax ) contextMenu.insertItem( "&Print", submenu ) - contextMenu.exec_loop( QCursor.pos() ) + contextMenu.exec_loop( TQCursor.pos() ) def open( self ): self.emit( PYSIGNAL( "explain" ), ( "File/Open selected", ) ) @@ -228,7 +228,7 @@ class MenuExample( QWidget ): def normal( self ): self.isBold = FALSE self.isUnderline = FALSE - font = QFont() + font = TQFont() self.label.setFont( font ) self.options.setItemChecked( self.boldID, self.isBold ) self.options.setItemChecked( self.underlineID, self.isUnderline ) @@ -236,7 +236,7 @@ class MenuExample( QWidget ): def bold( self ): self.isBold = not self.isBold - font = QFont() + font = TQFont() font.setBold( self.isBold ) font.setUnderline( self.isUnderline ) self.label.setFont( font ) @@ -245,7 +245,7 @@ class MenuExample( QWidget ): def underline( self ): self.isUnderline = not self.isUnderline - font = QFont() + font = TQFont() font.setBold( self.isBold ) font.setUnderline( self.isUnderline ) self.label.setFont( font ) @@ -253,13 +253,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", ) ) @@ -277,10 +277,10 @@ class MenuExample( QWidget ): self.label.setGeometry( 20, self.rect().center().y()-20, self.width()-40, 40 ) -a = QApplication( sys.argv ) +a = TQApplication( sys.argv ) m = MenuExample() -m.setCaption( "Qt Examples - Menus" ) +m.setCaption( "TQt Examples - Menus" ) a.setMainWidget( m ) m.show() a.exec_loop() diff --git a/examples3/progress.py b/examples3/progress.py index 001be45..cb852b9 100755 --- a/examples3/progress.py +++ b/examples3/progress.py @@ -5,10 +5,10 @@ #** #** Copyright (C) 1992-2005 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. #** -#** Converted to PyQt3 by Hans-Peter Jansen <hpj@urpla.net> +#** Converted to PyTQt3 by Hans-Peter Jansen <hpj@urpla.net> #** #*****************************************************************************/ @@ -16,11 +16,11 @@ import sys from qt import * from random import randint -class AnimatedThingy(QLabel): +class AnimatedThingy(TQLabel): def __init__(self, parent, s): - QLabel.__init__(self, parent) - self.label = QString(s) - self.setEraseColor(Qt.white) + TQLabel.__init__(self, parent) + self.label = TQString(s) + self.setEraseColor(TQt.white) self.label.append("\n... and wasting CPU\nwith this animation!\n") self.step = 0 self.nqix = 10 @@ -41,14 +41,14 @@ class AnimatedThingy(QLabel): def show(self): if not self.isVisible(): self.startTimer(self.tdelay) - QWidget.show(self) + TQWidget.show(self) def hide(self): - QWidget.hide(self) + TQWidget.hide(self) self.killTimers() def sizeHint(self): - return QSize(120, 100) + return TQSize(120, 100) def timerEvent(self, e): p, pn = self._painter() @@ -77,24 +77,24 @@ class AnimatedThingy(QLabel): self._drawtxt(p) def _painter(self): - p = QPainter(self) - # we need to create a new pen from p.pen() with QPen() in order + p = TQPainter(self) + # we need to create a new pen from p.pen() with TQPen() in order # to make it fully functional (changes are discarded otherwise) - pn = QPen(p.pen()) + pn = TQPen(p.pen()) pn.setWidth(self.lwidth) p.setPen(pn) return p, pn def _drawqix(self, p, pn, step): # rainbow effect - pn.setColor(QColor((step * 255)/self.nqix, 255, 255, QColor.Hsv)) + pn.setColor(TQColor((step * 255)/self.nqix, 255, 255, TQColor.Hsv)) p.setPen(pn) p.drawLine(self.ox[step][0], self.oy[step][0], self.ox[step][1], self.oy[step][1]) def _drawtxt(self, p): p.setPen(self.colorGroup().text()) - p.drawText(self.rect(), Qt.AlignCenter, self.label) + p.drawText(self.rect(), TQt.AlignCenter, self.label) def _inc(self, x, dx, b): x += dx @@ -107,9 +107,9 @@ class AnimatedThingy(QLabel): return x, dx -class CPUWaster(QWidget): +class CPUWaster(TQWidget): def __init__(self): - QWidget.__init__(self) + TQWidget.__init__(self) self.first_draw_item = 1000 self.last_draw_item = 1006 self.rects = 0 @@ -117,38 +117,38 @@ class CPUWaster(QWidget): self.default_label = 0 self.got_stop = False self.pb = None # non modal progress dialog - self.menubar = menubar = QMenuBar(self, "menu") - self.file_ = file_ = QPopupMenu() + self.menubar = menubar = TQMenuBar(self, "menu") + self.file_ = file_ = TQPopupMenu() menubar.insertItem("&File", file_) for i in range(self.first_draw_item, self.last_draw_item + 1): file_.insertItem(self.drawItemText(i), i) - file_.setAccel(QKeySequence( + file_.setAccel(TQKeySequence( "Ctrl+%s" % (i - self.first_draw_item)), i) self.connect(menubar, SIGNAL("activated(int)"), self.doMenuItem) file_.insertSeparator() - file_.insertItem("Quit", qApp, SLOT("quit()"), QKeySequence("Ctrl+Q")) - self.options = options = QPopupMenu() + file_.insertItem("Quit", qApp, SLOT("quit()"), TQKeySequence("Ctrl+Q")) + self.options = options = TQPopupMenu() menubar.insertItem("&Options", options) self.ld_id = options.insertItem("Loop driven", self.loopDriven, - QKeySequence("Alt+L")) + TQKeySequence("Alt+L")) self.td_id = options.insertItem("Timer driven", self.timerDriven, - QKeySequence("Alt+T")) + TQKeySequence("Alt+T")) options.insertSeparator() self.dl_id = options.insertItem("Default label", self.defaultLabel, - QKeySequence("Alt+D")) + TQKeySequence("Alt+D")) self.cl_id = options.insertItem("Custom label", self.customLabel, - QKeySequence("Alt+C")) + TQKeySequence("Alt+C")) options.insertSeparator() self.md_id = options.insertItem("No minimum duration", self.toggleMinimumDuration, - QKeySequence("Alt+M")) + TQKeySequence("Alt+M")) options.setCheckable(True) # default option settings self.timerDriven() self.customLabel() self.toggleMinimumDuration() self.resize(400, 300) - self.setEraseColor(Qt.black) + self.setEraseColor(TQt.black) def drawItemRects(self, id_): r = 100 @@ -160,7 +160,7 @@ class CPUWaster(QWidget): return r def drawItemText(self, id_): - return QString("%d Rectangles" % self.drawItemRects(id_)) + return TQString("%d Rectangles" % self.drawItemRects(id_)) def enableDrawingItems(self, yes): for i in range(self.first_draw_item, self.last_draw_item + 1): @@ -199,7 +199,7 @@ class CPUWaster(QWidget): self.got_stop = True def newProgressDialog(self, label, steps, modal): - d = QProgressDialog(label, "Cancel", steps, self, "progress", modal) + d = TQProgressDialog(label, "Cancel", steps, self, "progress", modal) if self.options.isItemChecked(self.md_id): d.setMinimumDuration(0) if not self.default_label: @@ -223,7 +223,7 @@ class CPUWaster(QWidget): else: # loop driven with modal progress dialog lpb = self.newProgressDialog("Drawing rectangles.\n" "Using loop.", n, True) - p = QPainter(self) + p = TQPainter(self) for i in range(n): lpb.setProgress(i) if lpb.wasCancelled(): @@ -237,7 +237,7 @@ class CPUWaster(QWidget): if not self.got_stop: self.pb.setProgress(self.pb.totalSteps() - self.rects) self.rects -= 1 - p = QPainter(self) + p = TQPainter(self) self._draw(p) if not self.rects or self.got_stop: @@ -254,19 +254,19 @@ class CPUWaster(QWidget): ww = self.width() wh = self.height() if ww > 8 and wh > 8: - c = QColor(randint(0, 255), randint(0, 255), randint(0, 255)) + c = TQColor(randint(0, 255), randint(0, 255), randint(0, 255)) x = randint(0, ww - 8) y = randint(0, wh - 8) w = randint(0, ww - x) h = randint(0, wh - y) - p.fillRect(x, y, w, h, QBrush(c)) + p.fillRect(x, y, w, h, TQBrush(c)) def _clear(self, p): - p.fillRect(0, 0, self.width(), self.height(), QBrush(self.eraseColor())) + p.fillRect(0, 0, self.width(), self.height(), TQBrush(self.eraseColor())) if __name__ == "__main__": - app = QApplication(sys.argv) + app = TQApplication(sys.argv) try: n = int(sys.argv[1]) except: diff --git a/examples3/progressbar.py b/examples3/progressbar.py index beca2b6..9887a97 100755 --- a/examples3/progressbar.py +++ b/examples3/progressbar.py @@ -5,7 +5,7 @@ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** **************************************************************************""" @@ -17,43 +17,43 @@ from qt import * FALSE = 0 TRUE = 1 -class ProgressBar( QButtonGroup ): +class ProgressBar( TQButtonGroup ): # Constructor # Creates child widgets of the ProgressBar widget def __init__( self, parent=None, name=None ): - QButtonGroup.__init__( self, 0, Qt.Horizontal, "Progress Bar", parent, name ) + TQButtonGroup.__init__( self, 0, TQt.Horizontal, "Progress Bar", parent, name ) - self.timer = QTimer() + self.timer = TQTimer() self.setMargin( 10 ) - toplayout = QGridLayout( self.layout(), 2, 2, 5) + toplayout = TQGridLayout( self.layout(), 2, 2, 5) self.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", self ) - self.normal = QRadioButton( "&Normal", self ) - self.fast = QRadioButton( "&Fast", self ) - vb1 = QVBoxLayout( ) + self.slow = TQRadioButton( "&Slow", self ) + self.normal = TQRadioButton( "&Normal", self ) + self.fast = TQRadioButton( "&Fast", self ) + vb1 = TQVBoxLayout( ) toplayout.addLayout( vb1, 0, 0 ) vb1.addWidget( self.slow ) vb1.addWidget( self.normal ) vb1.addWidget( self.fast ) # two push buttons, one for start, for for reset. - self.start = QPushButton( "&Start", self ) - self.reset = QPushButton( "&Reset", self ) + self.start = TQPushButton( "&Start", self ) + self.reset = TQPushButton( "&Reset", self ) - vb2 = QVBoxLayout() + vb2 = TQVBoxLayout() toplayout.addLayout( vb2, 0, 1 ) vb2.addWidget( self.start ) vb2.addWidget( self.reset ) # Create the progressbar - self.progress = QProgressBar( 100, self ) - #self.progress.setStyle( QMotifStyle() ) + self.progress = TQProgressBar( 100, self ) + #self.progress.setStyle( TQMotifStyle() ) toplayout.addMultiCellWidget( self.progress, 1, 1, 0, 1 ) # connect the clicked() SIGNALs of the pushbuttons to SLOTs @@ -139,13 +139,13 @@ class ProgressBar( QButtonGroup ): self.progress.setProgress( p ) - #QPushButton *start, *pause, *reset; + #TQPushButton *start, *pause, *reset; def main( args ): - a = QApplication( args ) + a = TQApplication( args ) progressbar = ProgressBar() - progressbar.setCaption("Qt Example - ProgressBar") + progressbar.setCaption("TQt Example - ProgressBar") a.setMainWidget(progressbar) progressbar.show() diff --git a/examples3/qdir.py b/examples3/qdir.py index 0da10eb..03cc5c9 100755 --- a/examples3/qdir.py +++ b/examples3/qdir.py @@ -57,9 +57,9 @@ home = [ ] -class PixmapView(QScrollView): +class PixmapView(TQScrollView): def __init__(self, parent): - QScrollView.__init__(self, parent) + TQScrollView.__init__(self, parent) self.pixmap = None self.viewport().setBackgroundMode(self.PaletteBase) @@ -69,36 +69,36 @@ class PixmapView(QScrollView): self.viewport().repaint(False) def drawContents(self, p, cx, cy, cw, ch): - p.fillRect(cx, cy, cw, ch, self.colorGroup().brush(QColorGroup.Base)) + p.fillRect(cx, cy, cw, ch, self.colorGroup().brush(TQColorGroup.Base)) p.drawPixmap(0, 0, self.pixmap) -class Preview(QWidgetStack): +class Preview(TQWidgetStack): def __init__(self, parent): - QWidgetStack.__init__(self, parent) - self.normalText = QMultiLineEdit(self) + TQWidgetStack.__init__(self, parent) + self.normalText = TQMultiLineEdit(self) self.normalText.setReadOnly(True) - self.html = QTextView(self) + self.html = TQTextView(self) self.pixmap = PixmapView(self) self.raiseWidget(self.normalText) def showPreview(self, url, size): if url.isLocalFile(): path = url.path() - fi = QFileInfo(path) + fi = TQFileInfo(path) if fi.isFile() and fi.size() > size * 1000: self.normalText.setText( "The File\n%s\nis too large, so I don't show it!" % path) self.raiseWidget(self.normalText) return - pix = QPixmap(path) + pix = TQPixmap(path) if pix.isNull(): if fi.isFile(): err = False try: text = open(path.latin1(), "r").read() except IOError, msg: - text = QString(str(msg)) + text = TQString(str(msg)) err = True if not err and fi.extension().lower().contains("htm"): url = self.html.mimeSourceFactory().makeAbsolute( @@ -121,28 +121,28 @@ class Preview(QWidgetStack): self.raiseWidget(self.normalText) -# We can't instantiate QFilePreview directly because it is abstract. Note that +# We can't instantiate TQFilePreview directly because it is abstract. Note that # the previewUrl() abstract is patched in later to work around the fact that # you can't multiply inherit from more than one wrapped class. -class FilePreview(QFilePreview): +class FilePreview(TQFilePreview): pass -class PreviewWidget(QVBox): +class PreviewWidget(TQVBox): def __init__(self, parent): - QVBox.__init__(self, parent) + TQVBox.__init__(self, parent) self.setSpacing( 5 ) self.setMargin( 5 ) - row = QHBox(self) + row = TQHBox(self) row.setSpacing(5) - QLabel("Only show files smaller than: ", row) - self.sizeSpinBox = QSpinBox(1, 10000, 1, row) + TQLabel("Only show files smaller than: ", row) + self.sizeSpinBox = TQSpinBox(1, 10000, 1, row) self.sizeSpinBox.setSuffix(" KB") self.sizeSpinBox.setValue(128) row.setFixedHeight(10 + self.sizeSpinBox.sizeHint().height()) self.__preview = Preview(self) # workaround sip inability of multiple inheritance - # create a local QFilePreview instance and redirect + # create a local TQFilePreview instance and redirect # the method, which is called on preview, to us self.preview = FilePreview() self.preview.previewUrl = self.previewUrl @@ -151,9 +151,9 @@ class PreviewWidget(QVBox): self.__preview.showPreview(url, self.sizeSpinBox.value()) -class CustomFileDialog(QFileDialog): +class CustomFileDialog(TQFileDialog): def __init__(self, preview = False): - QFileDialog.__init__(self, None, None, True) + TQFileDialog.__init__(self, None, None, True) self.bookmarkFile = ".pybookmarks" self.bookmarkList = [] if os.path.exists(self.bookmarkFile): @@ -169,10 +169,10 @@ class CustomFileDialog(QFileDialog): root.setOpen(True) self.dirView.setFixedWidth(200) self.addLeftWidget(self.dirView) - p = QPushButton(self) - p.setPixmap(QPixmap(bookmarks)) - QToolTip.add(p, "Bookmarks") - self.bookmarkMenu = QPopupMenu(self) + p = TQPushButton(self) + p.setPixmap(TQPixmap(bookmarks)) + TQToolTip.add(p, "Bookmarks") + self.bookmarkMenu = TQPopupMenu(self) self.connect(self.bookmarkMenu, SIGNAL("activated(int)"), self.bookmarkChosen) self.addId = self.bookmarkMenu.insertItem("Add bookmark") @@ -181,13 +181,13 @@ class CustomFileDialog(QFileDialog): self.bookmarkMenu.insertItem(l) p.setPopup(self.bookmarkMenu) self.addToolButton(p, True) - self.connect(self.dirView, PYSIGNAL("folderSelected(const QString &)"), + self.connect(self.dirView, PYSIGNAL("folderSelected(const TQString &)"), self.setDir2) - self.connect(self, SIGNAL("dirEntered(const QString &)"), + self.connect(self, SIGNAL("dirEntered(const TQString &)"), self.dirView.setDir) - b = QToolButton(self) - QToolTip.add(b, "Go Home!") - b.setPixmap(QPixmap(home)) + b = TQToolButton(self) + TQToolTip.add(b, "Go Home!") + b.setPixmap(TQPixmap(home)) self.connect(b, SIGNAL("clicked()"), self.goHome) self.addToolButton(b) @@ -195,8 +195,8 @@ class CustomFileDialog(QFileDialog): self.setContentsPreviewEnabled(True) pw = PreviewWidget(self) self.setContentsPreview(pw, pw.preview) - self.setViewMode(QFileDialog.List) - self.setPreviewMode(QFileDialog.Contents) + self.setViewMode(TQFileDialog.List) + self.setPreviewMode(TQFileDialog.Contents) w = self.width() h = self.height() @@ -211,10 +211,10 @@ class CustomFileDialog(QFileDialog): open(self.bookmarkFile, "wb").write(pickle.dumps(self.bookmarkList)) except IOError, msg: print msg - return QFileDialog.done(self, r) + return TQFileDialog.done(self, r) def showEvent(self, e): - QFileDialog.showEvent(self, e) + TQFileDialog.showEvent(self, e) self.dirView.setDir(self.dirPath()) def setDir2(self, path): @@ -250,7 +250,7 @@ if __name__ == '__main__': usage: qdir [--any | --dir | --custom] [--preview] [--default f] {--filter f} [caption ...] --any Get any filename, need not exist. --dir Return a directory rather than a file. - --custom Opens a customized QFileDialog with + --custom Opens a customized TQFileDialog with dir browser, bookmark menu, etc. --preview Show a preview widget. --default f Start from directory/file f. @@ -261,12 +261,12 @@ usage: qdir [--any | --dir | --custom] [--preview] [--default f] {--filter f} [c def main(): options = ["help", "any", "dir", "custom", "preview", "default=", "filter="] - mode = QFileDialog.ExistingFile + mode = TQFileDialog.ExistingFile preview = False custom = False start = None - filter = QString.null - app = QApplication(sys.argv) + filter = TQString.null + app = TQApplication(sys.argv) try: optlist, args = getopt.getopt(sys.argv[1:], "h", options) @@ -277,9 +277,9 @@ usage: qdir [--any | --dir | --custom] [--preview] [--default f] {--filter f} [c if opt in ("-h", "--help"): usage() elif opt == "--any": - mode = QFileDialog.AnyFile + mode = TQFileDialog.AnyFile elif opt == "--dir": - mode = QFileDialog.Directory + mode = TQFileDialog.Directory elif opt == "--default": start = par elif opt == "--filter": @@ -290,27 +290,27 @@ usage: qdir [--any | --dir | --custom] [--preview] [--default f] {--filter f} [c custom = True if args: caption = " ".join(args) - elif mode == QFileDialog.Directory: + elif mode == TQFileDialog.Directory: caption = "Choose directory..." else: caption = "Choose file..." if not start: - start = QDir.currentDirPath() + start = TQDir.currentDirPath() if not custom: - fd = QFileDialog(QString.null, filter, None, None, True) + fd = TQFileDialog(TQString.null, filter, None, None, True) fd.setMode(mode) if preview: fd.setContentsPreviewEnabled(True) pw = PreviewWidget(fd) fd.setContentsPreview(pw, pw.preview) - fd.setViewMode(QFileDialog.List) - fd.setPreviewMode(QFileDialog.Contents) + fd.setViewMode(TQFileDialog.List) + fd.setPreviewMode(TQFileDialog.Contents) w = fd.width() h = fd.height() fd.resize(w + w / 3, h + h / 4) fd.setCaption(caption) fd.setSelection(start) - if fd.exec_loop() == QDialog.Accepted: + if fd.exec_loop() == TQDialog.Accepted: print "%s\n" % fd.selectedFile().latin1() return 0 else: diff --git a/examples3/qmag.py b/examples3/qmag.py index f27da2c..d52a48c 100755 --- a/examples3/qmag.py +++ b/examples3/qmag.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. #** #*****************************************************************************/ @@ -25,25 +25,25 @@ refreshrates = [ timer = (0, 20, 250, 333, 500, 1000, 2000, 3000, 5000, 10000) -class MagWidget(QWidget): +class MagWidget(TQWidget): def __init__(self, qApp, parent = None, name = None): self.qApp = qApp - QWidget.__init__(self, parent, name) - self.pm = QPixmap() # pixmap magnified - self.p = QPixmap() # pixmap - self.image = QImage() # image of pixmap (for RGB) + TQWidget.__init__(self, parent, name) + self.pm = TQPixmap() # pixmap magnified + self.p = TQPixmap() # pixmap + self.image = TQImage() # image of pixmap (for RGB) self.z = 0 # zoom factor self.r = 0 # autorefresh rate (index into refreshrates) self.grabbing = FALSE # TRUE if currently grabbing self.grabx = -1 self.graby = -1 - self.zoom = QComboBox(FALSE, self) + self.zoom = TQComboBox(FALSE, self) self.zoom.insertStrList(zoomfactors, len(zoomfactors)) self.connect(self.zoom, SIGNAL("activated(int)"), self.setZoom) - self.refresh = QComboBox(FALSE, self) + self.refresh = TQComboBox(FALSE, self) self.refresh.insertStrList(refreshrates, len(refreshrates)) self.connect(self.refresh, SIGNAL("activated(int)"), self.setRefresh) @@ -63,21 +63,21 @@ class MagWidget(QWidget): w = max(cw, w) self.refresh.setGeometry(x, 2, w + 30, h) - self.saveButton = QPushButton(self) + self.saveButton = TQPushButton(self) self.connect(self.saveButton, SIGNAL("clicked()"), self.save) self.saveButton.setText("Save") self.saveButton.setGeometry(x + w + 30 + 2, 2, 10 + self.saveButton.fontMetrics().width("Save"), h) - self.quitButton = QPushButton(self) + self.quitButton = TQPushButton(self) self.connect(self.quitButton, SIGNAL("clicked()"), self.qApp, SLOT("quit()")) self.quitButton.setText("Quit") self.quitButton.setGeometry(self.saveButton.geometry().right() + 2, 2, 10 + self.quitButton.fontMetrics().width("Quit"), h) - self.rgb = QLabel(self) + self.rgb = TQLabel(self) self.rgb.setText("") - self.rgb.setAlignment(Qt.AlignVCenter) + self.rgb.setAlignment(TQt.AlignVCenter) self.rgb.resize(self.width(), self.rgb.fontMetrics().height() + 4) self.yoffset = self.zoom.height() + 4 + self.rgb.height() @@ -89,7 +89,7 @@ class MagWidget(QWidget): self.setMouseTracking(TRUE) self.grabx = self.qApp.desktop().width() / 2 self.graby = self.qApp.desktop().height() / 2 - self.grabAround(QPoint(self.grabx, self.graby)) + self.grabAround(TQPoint(self.grabx, self.graby)) #self.zoom.setCurrentItem(1) # grabAround sets zoom factor #self.setZoom(1) @@ -113,7 +113,7 @@ class MagWidget(QWidget): def save(self): if not self.p.isNull(): self.killTimers() - fn = QFileDialog.getSaveFileName() + fn = TQFileDialog.getSaveFileName() if not fn.isEmpty(): self.p.save(fn, "BMP") if self.r: @@ -132,19 +132,19 @@ class MagWidget(QWidget): x = self.grabx - w / 2 y = self.graby - h / 2 - if x + w > QApplication.desktop().width(): - x = QApplication.desktop().width() - w + if x + w > TQApplication.desktop().width(): + x = TQApplication.desktop().width() - w elif x < 0: x = 0 - if y + h > QApplication.desktop().height(): - y = QApplication.desktop().height() - h + if y + h > TQApplication.desktop().height(): + y = TQApplication.desktop().height() - h elif y < 0: y = 0 - self.p = QPixmap.grabWindow(QApplication.desktop().winId(), x, y, w, h) + self.p = TQPixmap.grabWindow(TQApplication.desktop().winId(), x, y, w, h) self.image = self.p.convertToImage() - m = QWMatrix() + m = TQWMatrix() #print "z:", self.z m.scale(float(self.z), float(self.z)) self.pm = self.p.xForm(m) @@ -152,7 +152,7 @@ class MagWidget(QWidget): def paintEvent(self, e): if not self.pm.isNull(): - paint = QPainter(self) + paint = TQPainter(self) paint.drawPixmap(0, self.zoom.height() + 4, self.pm, 0, 0, self.width(), self.height() - self.yoffset) @@ -160,7 +160,7 @@ class MagWidget(QWidget): if not self.grabbing: self.grabbing = TRUE self.killTimers() - self.grabMouse(Qt.crossCursor) + self.grabMouse(TQt.crossCursor) self.grabx = -1 self.graby = -1 else: @@ -181,8 +181,8 @@ class MagWidget(QWidget): if w > 10 and h > 10: pz = 1 while w*pz*h*pz < self.width()*(self.height()-self.yoffset) and \ - w*pz < QApplication.desktop().width() and \ - h*pz < QApplication.desktop().height(): + w*pz < TQApplication.desktop().width() and \ + h*pz < TQApplication.desktop().height(): pz += 1 if (w*pz*h*pz - self.width()*(self.height()-self.yoffset)) > \ (self.width()*(self.height()-self.yoffset) - w*(pz-1)*h*(pz-1)): @@ -226,7 +226,7 @@ class MagWidget(QWidget): self.width(), self.rgb.height()) if __name__=='__main__': - app = QApplication( sys.argv ) + app = TQApplication( sys.argv ) m = MagWidget(app) app.setMainWidget(m) m.show() diff --git a/examples3/qtlogo.png b/examples3/qtlogo.png Binary files differindex 0dc05a0..4b97130 100644 --- a/examples3/qtlogo.png +++ b/examples3/qtlogo.png diff --git a/examples3/rangecontrols.py b/examples3/rangecontrols.py index a47b8ff..6250bf4 100755 --- a/examples3/rangecontrols.py +++ b/examples3/rangecontrols.py @@ -5,7 +5,7 @@ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** ***************************************************************************""" @@ -15,61 +15,61 @@ from qt import * INT_MAX = sys.maxint -class RangeControls( QVBox ): +class RangeControls( TQVBox ): def __init__( self, parent=None, name=None ): - QVBox.__init__( self, parent, name ) + TQVBox.__init__( self, parent, name ) - row1 = QHBox( self ) - cell2 = QVBox( row1 ) + row1 = TQHBox( self ) + cell2 = TQVBox( row1 ) cell2.setMargin( 10 ) - cell2.setFrameStyle( QFrame.WinPanel | QFrame.Sunken ) + cell2.setFrameStyle( TQFrame.WinPanel | TQFrame.Sunken ) - QWidget( cell2 ) + TQWidget( cell2 ) - label1 = QLabel( QString( "Enter a value between\n%1 and %2:" ).arg( -INT_MAX ).arg( INT_MAX ), cell2 ) + label1 = TQLabel( TQString( "Enter a value between\n%1 and %2:" ).arg( -INT_MAX ).arg( INT_MAX ), cell2 ) label1.setMaximumHeight( label1.sizeHint().height() ) - sb1 = QSpinBox( -INT_MAX, INT_MAX, 1, cell2 ) + sb1 = TQSpinBox( -INT_MAX, INT_MAX, 1, cell2 ) sb1.setValue( 0 ) - label2 = QLabel( "Enter a zoom value:", cell2 ) + label2 = TQLabel( "Enter a zoom value:", cell2 ) label2.setMaximumHeight( label2.sizeHint().height() ) - sb2 = QSpinBox( 0, 1000, 10, cell2 ) + sb2 = TQSpinBox( 0, 1000, 10, cell2 ) sb2.setSuffix( " %" ) sb2.setSpecialValueText( "Automatic" ) - label3 = QLabel( "Enter a price:", cell2 ) + label3 = TQLabel( "Enter a price:", cell2 ) label3.setMaximumHeight( label3.sizeHint().height() ) - sb3 = QSpinBox( 0, INT_MAX, 1, cell2 ) + sb3 = TQSpinBox( 0, INT_MAX, 1, cell2 ) sb3.setPrefix( "$" ) sb3.setValue( 355 ) - QWidget( cell2 ) + TQWidget( cell2 ) - row2 = QHBox( self ) + row2 = TQHBox( self ) - cell3 = QVBox( row2 ) + cell3 = TQVBox( row2 ) cell3.setMargin( 10 ) - cell3.setFrameStyle( QFrame.WinPanel | QFrame.Sunken ) - hslider = QSlider( 0, 64, 1, 33, Qt.Horizontal, cell3 ) - lcd2 = QLCDNumber( 2, cell3 ) + cell3.setFrameStyle( TQFrame.WinPanel | TQFrame.Sunken ) + hslider = TQSlider( 0, 64, 1, 33, TQt.Horizontal, cell3 ) + lcd2 = TQLCDNumber( 2, cell3 ) lcd2.display( 33 ) - lcd2.setSegmentStyle( QLCDNumber.Filled ) + lcd2.setSegmentStyle( TQLCDNumber.Filled ) self.connect( hslider, SIGNAL("valueChanged( int )"), lcd2, SLOT("display( int )") ) - cell4 = QHBox( row2 ) - cell4.setFrameStyle( QFrame.WinPanel | QFrame.Sunken ) + cell4 = TQHBox( row2 ) + cell4.setFrameStyle( TQFrame.WinPanel | TQFrame.Sunken ) cell4.setMargin( 10 ) - vslider = QSlider( 0, 64, 1, 8, Qt.Vertical, cell4 ) - lcd3 = QLCDNumber( 3, cell4 ) + vslider = TQSlider( 0, 64, 1, 8, TQt.Vertical, cell4 ) + lcd3 = TQLCDNumber( 3, cell4 ) lcd3.display( 8 ) self.connect( vslider, SIGNAL("valueChanged( int )"), lcd3, SLOT("display( int )") ) def main( args ): - a = QApplication( args ) + a = TQApplication( args ) rangecontrols = RangeControls() rangecontrols.resize( 500, 300 ) - rangecontrols.setCaption( "Qt Example - Range Control Widgets" ); + rangecontrols.setCaption( "TQt Example - Range Control Widgets" ); a.setMainWidget( rangecontrols ) rangecontrols.show() diff --git a/examples3/richtext.py b/examples3/richtext.py index 592213d..f7eb73e 100755 --- a/examples3/richtext.py +++ b/examples3/richtext.py @@ -5,7 +5,7 @@ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** ***************************************************************************""" @@ -70,16 +70,16 @@ sayings = [ 0 ] -class MyRichText( QVBox ): +class MyRichText( TQVBox ): def __init__( self, parent = None, name = None ): - QVBox.__init__( self, parent, name ) + TQVBox.__init__( self, parent, name ) self.setMargin( 5 ) - self.view = QTextView( self ) + self.view = TQTextView( self ) #self.view.setText( "This is a <b>Test</b> with <i>italic</i> <u>stuff</u>" ) - paper = QBrush() - paper.setPixmap( QPixmap( "marble.png" ) ) + paper = TQBrush() + paper.setPixmap( TQPixmap( "marble.png" ) ) if paper.pixmap() != 0 : self.view.setPaper( paper ) else : @@ -88,12 +88,12 @@ class MyRichText( QVBox ): self.view.setText( sayings[0] ) self.view.setMinimumSize( 450, 250 ) - buttons = QHBox( self ) + buttons = TQHBox( self ) buttons.setMargin( 5 ) - self.bClose = QPushButton( "&Close", buttons ) - self.bPrev = QPushButton( "<< &Prev", buttons ) - self.bNext = QPushButton( "&Next >>", buttons ) + self.bClose = TQPushButton( "&Close", buttons ) + self.bPrev = TQPushButton( "<< &Prev", buttons ) + self.bNext = TQPushButton( "&Next >>", buttons ) self.bPrev.setEnabled( False ) @@ -122,11 +122,11 @@ class MyRichText( QVBox ): self.bPrev.setEnabled( True ) def main( args ): - a = QApplication(sys.argv) # application object + a = TQApplication(sys.argv) # application object richtext = MyRichText() richtext.resize( 450, 350 ); - richtext.setCaption( "Qt Example - Richtext" ) + richtext.setCaption( "TQt Example - Richtext" ) a.setMainWidget( richtext ) richtext.show() diff --git a/examples3/secret.py b/examples3/secret.py index d6d2b6d..434664b 100644 --- a/examples3/secret.py +++ b/examples3/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.setEraseColor( Qt.blue.light() ) - self.setFrameStyle( QLabel.Box | QLabel.Sunken ) + TQLabel.__init__(self, "Secret", parent, name) + self.setEraseColor( 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/examples3/semaphore.py b/examples3/semaphore.py index ac8b231..68128d7 100755 --- a/examples3/semaphore.py +++ b/examples3/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.setEraseColor(Qt.green) + self.label.setEraseColor(TQt.green) else: - self.label.setEraseColor(Qt.yellow) + self.label.setEraseColor(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/examples3/smalltable.py b/examples3/smalltable.py index 83e74bf..2fbda72 100755 --- a/examples3/smalltable.py +++ b/examples3/smalltable.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. #** #*****************************************************************************/ @@ -22,9 +22,9 @@ numRows = 30 numCols = 10 if __name__ == '__main__': - app = QApplication(sys.argv) + app = TQApplication(sys.argv) - table = QTable(numRows, numCols) + table = TQTable(numRows, numCols) header = table.horizontalHeader() @@ -33,23 +33,23 @@ if __name__ == '__main__': header.setLabel(5, "Combos") header.setMovingEnabled(TRUE) - img = QImage("trolltech.bmp") - pix = QPixmap(img.scaleHeight(table.rowHeight(3))) + img = TQImage("trolltech.bmp") + pix = TQPixmap(img.scaleHeight(table.rowHeight(3))) table.setPixmap(3, 2, pix) table.setText(3, 2, "A Pixmap") - comboEntries = QStringList("one") + comboEntries = TQStringList("one") comboEntries.append("two") comboEntries.append("three") comboEntries.append("four") for i in range(numRows): - item = QComboTableItem(table, comboEntries, FALSE) + item = TQComboTableItem(table, comboEntries, FALSE) item.setCurrentItem(i % 4) table.setItem(i, 5, item) for i in range(numRows): - table.setItem(i, 1, QCheckTableItem(table, "Check me")) + table.setItem(i, 1, TQCheckTableItem(table, "Check me")) table.setCaption("Small table example") table.show() diff --git a/examples3/splitter.py b/examples3/splitter.py index 3cee9cf..33d1aa2 100755 --- a/examples3/splitter.py +++ b/examples3/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.setEraseColor(Qt.blue.light(180)) + t1.setEraseColor(TQt.blue.light(180)) t1.setMinimumSize(50,0) t2 = Test(s2) - t2.setEraseColor(Qt.green.light(180)) - s2.setResizeMode(t2, QSplitter.KeepSize) + t2.setEraseColor(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.setEraseColor(Qt.red) + t3.setEraseColor(TQt.red) t4 = Test(s3) - t4.setEraseColor(Qt.white) + t4.setEraseColor(TQt.white) t5 = Test(s3) t5.setMaximumHeight(250) t5.setMinimumSize(80,50) - t5.setEraseColor(Qt.yellow) + t5.setEraseColor(TQt.yellow) s1.setOpaqueResize(1) s2.setOpaqueResize(1) diff --git a/examples3/tabdialog.py b/examples3/tabdialog.py index 0d37cc5..fe1ecd7 100755 --- a/examples3/tabdialog.py +++ b/examples3/tabdialog.py @@ -5,7 +5,7 @@ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** ***************************************************************************""" @@ -13,100 +13,100 @@ import sys from qt import * -class TabDialog( QTabDialog ): +class TabDialog( TQTabDialog ): def __init__( self, parent=None, name=None, filename=None ): - QTabDialog.__init__( self, parent, name ) - self.filename = QString( filename ) - self.fileinfo = QFileInfo( filename ) + TQTabDialog.__init__( self, parent, name ) + self.filename = TQString( filename ) + self.fileinfo = TQFileInfo( filename ) self.setupTab1() self.setupTab2() self.setupTab3() self.connect( self, SIGNAL("applyButtonPressed()"), qApp, SLOT("quit()" ) ) def setupTab1( self ): - tab1 = QVBox( self ) + tab1 = TQVBox( self ) tab1.setMargin( 5 ) - QLabel( "Filename:", tab1 ) - fname = QLineEdit( self.filename, tab1 ) + TQLabel( "Filename:", tab1 ) + fname = TQLineEdit( self.filename, tab1 ) fname.setFocus() - QLabel( "Path:", tab1 ) - path = QLabel( self.fileinfo.dirPath( True ), tab1 ) - path.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Path:", tab1 ) + path = TQLabel( self.fileinfo.dirPath( True ), tab1 ) + path.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) - QLabel( "Size:", tab1 ) - size = QLabel( QString( "%1 KB" ).arg( self.fileinfo.size() ), tab1 ) - size.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Size:", tab1 ) + size = TQLabel( TQString( "%1 KB" ).arg( self.fileinfo.size() ), tab1 ) + size.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) - QLabel( "Last Read:", tab1 ) - lread = QLabel( self.fileinfo.lastRead().toString(), tab1 ) - lread.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Last Read:", tab1 ) + lread = TQLabel( self.fileinfo.lastRead().toString(), tab1 ) + lread.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) - QLabel( "Last Modified:", tab1 ) - lmodif = QLabel( self.fileinfo.lastModified().toString(), tab1 ) - lmodif.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Last Modified:", tab1 ) + lmodif = TQLabel( self.fileinfo.lastModified().toString(), tab1 ) + lmodif.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) self.addTab( tab1, "General" ) def setupTab2( self ): - tab2 = QVBox( self ) + tab2 = TQVBox( self ) tab2.setMargin( 5 ) - bg = QButtonGroup( 1, QGroupBox.Horizontal, "Permissions", tab2 ) + bg = TQButtonGroup( 1, TQGroupBox.Horizontal, "Permissions", tab2 ) - readable = QCheckBox( "Readable", bg ) + readable = TQCheckBox( "Readable", bg ) if self.fileinfo.isReadable() : readable.setChecked( True ) - writable = QCheckBox( "Writeable", bg ) + writable = TQCheckBox( "Writeable", bg ) if self.fileinfo.isWritable() : writable.setChecked( True ) - executable = QCheckBox( "Executable", bg ) + executable = TQCheckBox( "Executable", bg ) if self.fileinfo.isExecutable() : executable.setChecked( True ) - bg2 = QButtonGroup( 2, QGroupBox.Horizontal, "Owner", tab2 ) + bg2 = TQButtonGroup( 2, TQGroupBox.Horizontal, "Owner", tab2 ) - QLabel( "Owner", bg2 ) - owner = QLabel( self.fileinfo.owner(), bg2 ) - owner.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Owner", bg2 ) + owner = TQLabel( self.fileinfo.owner(), bg2 ) + owner.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) - QLabel( "Group", bg2 ) - group = QLabel( self.fileinfo.group(), bg2 ) - group.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + TQLabel( "Group", bg2 ) + group = TQLabel( self.fileinfo.group(), bg2 ) + group.setFrameStyle( TQFrame.Panel | TQFrame.Sunken ) self.addTab( tab2, "Permissions" ) def setupTab3( self ): - tab3 = QVBox( self ) + tab3 = TQVBox( self ) tab3.setMargin( 5 ) tab3.setSpacing( 5 ) - QLabel( QString( "Open %1 with:" ).arg( self.filename ), tab3 ) + TQLabel( TQString( "Open %1 with:" ).arg( self.filename ), tab3 ) - prgs = QListBox( tab3 ) + prgs = TQListBox( tab3 ) for i in range( 0, 30, 1 ) : - prg = QString( "Application %1" ).arg( i ) + prg = TQString( "Application %1" ).arg( i ) prgs.insertItem( prg ) prgs.setCurrentItem( 3 ) - QCheckBox( QString( "Open files with the extension '%1' always with this application" ).arg( self.fileinfo.extension() ), tab3 ) + TQCheckBox( TQString( "Open files with the extension '%1' always with this application" ).arg( self.fileinfo.extension() ), tab3 ) self.addTab( tab3, "Applications" ) def main( args ): - a = QApplication(sys.argv) + a = TQApplication(sys.argv) #sys.argv.append("tabdialog.py") # to test uncomment this line if len(sys.argv) < 2: - filename = QString(".") + filename = TQString(".") else: - filename = QString(sys.argv[1]) + filename = TQString(sys.argv[1]) tabdialog = TabDialog( None, "tabdialog", filename ) tabdialog.resize( 450, 350 ); - tabdialog.setCaption( "Qt Example - Tabbed Dialog" ) + tabdialog.setCaption( "TQt Example - Tabbed Dialog" ) a.setMainWidget( tabdialog ) tabdialog.show() diff --git a/examples3/tablestatistics.py b/examples3/tablestatistics.py index 49f82ae..c0aa072 100755 --- a/examples3/tablestatistics.py +++ b/examples3/tablestatistics.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. #** #*****************************************************************************/ @@ -36,9 +36,9 @@ dirs = ( "canvas", ) -class Table(QTable): +class Table(TQTable): def __init__(self): - QTable.__init__(self, 0, TB_COLS) + TQTable.__init__(self, 0, TB_COLS) self.setSorting(TRUE) self.horizontalHeader().setLabel(TB_FILE, self.tr("File")) self.horizontalHeader().setLabel(TB_SIZE, self.tr("Size (bytes)")) @@ -50,12 +50,12 @@ class Table(QTable): self.connect(self, SIGNAL("valueChanged(int, int)"), self.recalcSum) def initTable(self): - # read all the Qt source and header files into a list + # read all the TQt source and header files into a list all = [] qtdir = os.getenv("QTDIR") for i in dirs: - dir = QDir(os.path.join(qtdir, "src", i)) - lst = QStringList(dir.entryList("*.cpp; *.h")) + dir = TQDir(os.path.join(qtdir, "src", i)) + lst = TQStringList(dir.entryList("*.cpp; *.h")) for f in lst: if f.contains("moc"): continue @@ -69,9 +69,9 @@ class Table(QTable): # insert the data into the table for it in all: self.setText(i, TB_FILE, it) - f = QFile(os.path.join(qtdir, "src", str(it))) + f = TQFile(os.path.join(qtdir, "src", str(it))) self.setText(i, TB_SIZE, str(f.size())) - ci = ComboItem(self, QTableItem.WhenCurrent) + ci = ComboItem(self, TQTableItem.WhenCurrent) self.setItem(i, TB_FLAG, ci) i = i + 1 sum += f.size() @@ -91,9 +91,9 @@ class Table(QTable): def displaySum(self, sum): # insert calculated data - i1 = TableItem(self, QTableItem.Never, self.tr("Sum")) + i1 = TableItem(self, TQTableItem.Never, self.tr("Sum")) self.setItem(self.numRows()-1, TB_FILE, i1) - i2 = TableItem(self, QTableItem.Never, str(sum)) + i2 = TableItem(self, TQTableItem.Never, str(sum)) self.setItem(self.numRows()-1, TB_SIZE, i2) def sortColumn(self, col, ascending, wholeRows): @@ -101,35 +101,35 @@ class Table(QTable): self.clearCell(self.numRows()-1, TB_FILE) self.clearCell(self.numRows()-1, TB_SIZE) # do sort - QTable.sortColumn(self, col, ascending, TRUE) + TQTable.sortColumn(self, col, ascending, TRUE) # re-insert sum row self.recalcSum(0, TB_SIZE) -class TableItem(QTableItem): +class TableItem(TQTableItem): def __init__(self, *args): - apply(QTableItem.__init__, (self,) + args) + apply(TQTableItem.__init__, (self,) + args) def paint(self, p, cg, cr, selected): - g = QColorGroup(cg) + g = TQColorGroup(cg) # last row is the sum row - we want to make it more visible by # using a red background if self.row() == self.table().numRows()-1: - g.setColor(QColorGroup.Base, QColor("red")) - QTableItem.paint(self, p, g, cr, selected) + g.setColor(TQColorGroup.Base, TQColor("red")) + TQTableItem.paint(self, p, g, cr, selected) -class ComboItem(QTableItem): +class ComboItem(TQTableItem): def __init__(self, t, et): - QTableItem.__init__(self, t, et, "Yes") + TQTableItem.__init__(self, t, et, "Yes") self.cb = None # we do not want this item to be replaced self.setReplaceable(FALSE) def createEditor(self): # create an editor - a combobox in our case - self.cb = QComboBox(self.table().viewport()) - QObject.connect(self.cb, SIGNAL("activated(int)"), + self.cb = TQComboBox(self.table().viewport()) + TQObject.connect(self.cb, SIGNAL("activated(int)"), self.table(), SLOT("doValueChanged()")) self.cb.insertItem("Yes") self.cb.insertItem("No") @@ -143,10 +143,10 @@ class ComboItem(QTableItem): def setContentFromEditor(self, w): # the user changed the value of the combobox, so synchronize the # value of the item (its text), with the value of the combobox - if w.inherits("QComboBox"): + if w.inherits("TQComboBox"): self.setText(w.currentText()) else: - QTableItem.setContentFromEditor(self, w) + TQTableItem.setContentFromEditor(self, w) def setText(self, s): # initialize the combobox from the text @@ -155,11 +155,11 @@ class ComboItem(QTableItem): self.cb.setCurrentItem(1) else: self.cb.setCurrentItem(0) - QTableItem.setText(self, s) + TQTableItem.setText(self, s) if __name__ == '__main__': - app = QApplication(sys.argv) + app = TQApplication(sys.argv) t = Table() t.setCaption("Statistics") diff --git a/examples3/tooltip.py b/examples3/tooltip.py index 7eadb7f..040d548 100755 --- a/examples3/tooltip.py +++ b/examples3/tooltip.py @@ -5,7 +5,7 @@ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** -** This file is part of an example program for Qt. This example +** This file is part of an example program for TQt. This example ** program may be used, distributed and modified without limitation. ** ***************************************************************************""" @@ -14,25 +14,25 @@ import sys from qt import * from random import random -class DynamicTip( QToolTip ): +class DynamicTip( TQToolTip ): def __init__( self, parent ): - QToolTip.__init__( self, parent ) + TQToolTip.__init__( self, parent ) def maybeTip( self, pos ): #if not self.parent.inherits( "TellMe" ): - if QToolTip(self).parentWidget().inherits( "TellMe" ) : + if TQToolTip(self).parentWidget().inherits( "TellMe" ) : return - r = QRect( QToolTip(self).parentWidget().tip(pos) ) + r = TQRect( TQToolTip(self).parentWidget().tip(pos) ) if not r.isValid(): return - s = QString( "position: %d,%d" % (r.center().x(), r.center().y()) ) - QToolTip(self).tip( r, s ) + s = TQString( "position: %d,%d" % (r.center().x(), r.center().y()) ) + TQToolTip(self).tip( r, s ) -class TellMe( QWidget ): +class TellMe( TQWidget ): def __init__( self, parent=None, name=None ): - QWidget.__init__( self, parent, name ) + TQWidget.__init__( self, parent, name ) self.setMinimumSize( 30, 30 ) self.r1 = self.randomRect() @@ -41,23 +41,23 @@ class TellMe( QWidget ): self.t = DynamicTip( self ) - QToolTip.add( self, self.r3, "this color is called red" ) # <- helpful + TQToolTip.add( self, self.r3, "this color is called red" ) # <- helpful def paintEvent( self, e ): - p = QPainter( self ) + p = TQPainter( self ) # I try to be efficient here, and repaint only what's needed if e.rect().intersects( self.r1 ): - p.setBrush( Qt.blue ) + p.setBrush( TQt.blue ) p.drawRect( self.r1 ) if e.rect().intersects( self.r2 ): - p.setBrush( Qt.blue ) + p.setBrush( TQt.blue ) p.drawRect( self.r2 ) if e.rect().intersects( self.r3 ): - p.setBrush( Qt.red ) + p.setBrush( TQt.red ) p.drawRect( self.r3 ) def mousePressEvent( self, e ): @@ -76,7 +76,7 @@ class TellMe( QWidget ): self.r2 = self.randomRect() def randomRect( self ): - return QRect( random() * (self.width() - 20), random() * (self.height() - 20), 20, 20 ) + return TQRect( random() * (self.width() - 20), random() * (self.height() - 20), 20, 20 ) def tip( self, p ): @@ -85,17 +85,17 @@ class TellMe( QWidget ): elif self.r2.contains( p ): return self.r2 else: - return QRect( 0,0, -1,-1 ) + return TQRect( 0,0, -1,-1 ) def __del__( self ): del self.t self.t = None def main( args ): - a = QApplication( args ) + a = TQApplication( args ) mw = TellMe() - mw.setCaption( "Qt Example - Dynamic Tool Tips" ) + mw.setCaption( "TQt Example - Dynamic Tool Tips" ) a.setMainWidget( mw ) mw.show() diff --git a/examples3/trolltech.bmp b/examples3/trolltech.bmp Binary files differindex 220861e..9f399c7 100644 --- a/examples3/trolltech.bmp +++ b/examples3/trolltech.bmp diff --git a/examples3/trolltech.gif b/examples3/trolltech.gif Binary files differindex f674369..7b0b8c9 100644 --- a/examples3/trolltech.gif +++ b/examples3/trolltech.gif diff --git a/examples3/tt-logo.png b/examples3/tt-logo.png Binary files differindex a0d9e34..1e51bfe 100644 --- a/examples3/tt-logo.png +++ b/examples3/tt-logo.png diff --git a/examples3/tut1.py b/examples3/tut1.py index 982e984..34dada8 100755 --- a/examples3/tut1.py +++ b/examples3/tut1.py @@ -1,14 +1,14 @@ #!/usr/bin/env python -# Qt tutorial 1. +# TQt tutorial 1. import sys import qt -a = qt.QApplication(sys.argv) +a = qt.TQApplication(sys.argv) -hello = qt.QPushButton("Hello world!", None) +hello = qt.TQPushButton("Hello world!", None) hello.resize(100, 30) a.setMainWidget(hello) diff --git a/examples3/tut10.py b/examples3/tut10.py index 182d04d..919ea7e 100755 --- a/examples3/tut10.py +++ b/examples3/tut10.py @@ -1,17 +1,17 @@ #!/usr/bin/env python -# Qt tutorial 10. +# TQt tutorial 10. import sys import qt -class LCDRange(qt.QVBox): +class LCDRange(qt.TQVBox): def __init__(self, parent=None, name=None): - qt.QVBox.__init__(self, parent, name) + qt.TQVBox.__init__(self, parent, name) - lcd = qt.QLCDNumber(2, self, "lcd") - self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + lcd = qt.TQLCDNumber(2, self, "lcd") + self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) @@ -31,13 +31,13 @@ class LCDRange(qt.QVBox): self.slider.setRange(minVal, maxVal) -class CannonField(qt.QWidget): +class CannonField(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) self.ang = 45 self.f = 0 - self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) def angle(self): return self.ang @@ -69,38 +69,38 @@ class CannonField(qt.QWidget): return cr = self.cannonRect() - pix = qt.QPixmap(cr.size()) + pix = qt.TQPixmap(cr.size()) pix.fill(self, cr.topLeft()) - p = qt.QPainter(pix) + p = qt.TQPainter(pix) - p.setBrush(qt.Qt.blue) - p.setPen(qt.Qt.NoPen) + p.setBrush(qt.TQt.blue) + p.setPen(qt.TQt.NoPen) p.translate(0, pix.height() - 1) - p.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + p.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) p.rotate(-self.ang) - p.drawRect(qt.QRect(33, -4, 15, 8)) + p.drawRect(qt.TQRect(33, -4, 15, 8)) p.end() p.begin(self) p.drawPixmap(cr.topLeft(), pix) def cannonRect(self): - r = qt.QRect(0, 0, 50, 50) + r = qt.TQRect(0, 0, 50, 50) r.moveBottomLeft(self.rect().bottomLeft()) return r def sizePolicy(self): - return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) -class MyWidget(qt.QWidget): +class MyWidget(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) - quit = qt.QPushButton("&Quit", self, "quit") - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit = qt.TQPushButton("&Quit", self, "quit") + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) self.angle = LCDRange(self, "angle") @@ -117,13 +117,13 @@ class MyWidget(qt.QWidget): self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) - grid = qt.QGridLayout(self, 2, 2, 10) + grid = qt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) - leftBox = qt.QVBoxLayout() + leftBox = qt.TQVBoxLayout() grid.addLayout(leftBox, 1, 0) @@ -135,8 +135,8 @@ class MyWidget(qt.QWidget): self.angle.setFocus() -qt.QApplication.setColorSpec(qt.QApplication.CustomColor) -a = qt.QApplication(sys.argv) +qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) +a = qt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 500, 355) diff --git a/examples3/tut11.py b/examples3/tut11.py index 95d5066..305994f 100755 --- a/examples3/tut11.py +++ b/examples3/tut11.py @@ -1,18 +1,18 @@ #!/usr/bin/env python -# Qt tutorial 11. +# TQt tutorial 11. import sys import math import qt -class LCDRange(qt.QVBox): +class LCDRange(qt.TQVBox): def __init__(self, parent=None, name=None): - qt.QVBox.__init__(self, parent, name) + qt.TQVBox.__init__(self, parent, name) - lcd = qt.QLCDNumber(2, self, "lcd") - self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + lcd = qt.TQLCDNumber(2, self, "lcd") + self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) @@ -32,23 +32,23 @@ class LCDRange(qt.QVBox): self.slider.setRange(minVal, maxVal) -class CannonField(qt.QWidget): +class CannonField(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) self.ang = 45 self.f = 0 self.timerCount = 0 - self.autoShootTimer = qt.QTimer(self, "movement handler") + self.autoShootTimer = qt.TQTimer(self, "movement handler") self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) self.shoot_ang = 0 self.shoot_f = 0 - self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) - self.barrelRect = qt.QRect(33, -4, 15, 8) + self.barrelRect = qt.TQRect(33, -4, 15, 8) def angle(self): return self.ang @@ -85,7 +85,7 @@ class CannonField(qt.QWidget): self.autoShootTimer.start(50) def moveShot(self): - r = qt.QRegion(self.shotRect()) + r = qt.TQRegion(self.shotRect()) self.timerCount = self.timerCount + 1 shotR = self.shotRect() @@ -93,13 +93,13 @@ class CannonField(qt.QWidget): if shotR.x() > self.width() or shotR.y() > self.height(): self.autoShootTimer.stop() else: - r = r.unite(qt.QRegion(shotR)) + r = r.unite(qt.TQRegion(shotR)) self.repaint(r) def paintEvent(self, ev): updateR = ev.rect() - p = qt.QPainter(self) + p = qt.TQPainter(self) if updateR.intersects(self.cannonRect()): self.paintCannon(p) @@ -108,21 +108,21 @@ class CannonField(qt.QWidget): self.paintShot(p) def paintShot(self, p): - p.setBrush(qt.Qt.black) - p.setPen(qt.Qt.NoPen) + p.setBrush(qt.TQt.black) + p.setPen(qt.TQt.NoPen) p.drawRect(self.shotRect()) def paintCannon(self, p): cr = self.cannonRect() - pix = qt.QPixmap(cr.size()) + pix = qt.TQPixmap(cr.size()) pix.fill(self, cr.topLeft()) - tmp = qt.QPainter(pix) - tmp.setBrush(qt.Qt.blue) - tmp.setPen(qt.Qt.NoPen) + tmp = qt.TQPainter(pix) + tmp.setBrush(qt.TQt.blue) + tmp.setPen(qt.TQt.NoPen) tmp.translate(0, pix.height() - 1) - tmp.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) tmp.rotate(-self.ang) tmp.drawRect(self.barrelRect) tmp.end() @@ -130,7 +130,7 @@ class CannonField(qt.QWidget): p.drawPixmap(cr.topLeft(), pix) def cannonRect(self): - r = qt.QRect(0, 0, 50, 50) + r = qt.TQRect(0, 0, 50, 50) r.moveBottomLeft(self.rect().bottomLeft()) return r @@ -148,20 +148,20 @@ class CannonField(qt.QWidget): x = x0 + velx * time y = y0 + vely * time - 0.5 * gravity * time * time - r = qt.QRect(0, 0, 6, 6) - r.moveCenter(qt.QPoint(x, self.height() - 1 - y)) + r = qt.TQRect(0, 0, 6, 6) + r.moveCenter(qt.TQPoint(x, self.height() - 1 - y)) return r def sizePolicy(self): - return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) -class MyWidget(qt.QWidget): +class MyWidget(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) - quit = qt.QPushButton("&Quit", self, "quit") - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit = qt.TQPushButton("&Quit", self, "quit") + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) self.angle = LCDRange(self, "angle") @@ -178,22 +178,22 @@ class MyWidget(qt.QWidget): self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) - shoot = qt.QPushButton("&Shoot", self, "shoot") - shoot.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + shoot = qt.TQPushButton("&Shoot", self, "shoot") + shoot.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(shoot, qt.SIGNAL("clicked()"), self.cannonField.shoot) - grid = qt.QGridLayout(self, 2, 2, 10) + grid = qt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) - leftBox = qt.QVBoxLayout() + leftBox = qt.TQVBoxLayout() grid.addLayout(leftBox, 1, 0) leftBox.addWidget(self.angle) leftBox.addWidget(self.force) - topBox = qt.QHBoxLayout() + topBox = qt.TQHBoxLayout() grid.addLayout(topBox, 0, 1) topBox.addWidget(shoot) topBox.addStretch(1) @@ -203,8 +203,8 @@ class MyWidget(qt.QWidget): self.angle.setFocus() -qt.QApplication.setColorSpec(qt.QApplication.CustomColor) -a = qt.QApplication(sys.argv) +qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) +a = qt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 500, 355) diff --git a/examples3/tut12.py b/examples3/tut12.py index 818afd3..a16b088 100755 --- a/examples3/tut12.py +++ b/examples3/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 import qt -class LCDRange(qt.QVBox): +class LCDRange(qt.TQVBox): def __init__(self, s=None, parent=None, name=None): - qt.QVBox.__init__(self, parent, name) + qt.TQVBox.__init__(self, parent, name) - lcd = qt.QLCDNumber(2, self, "lcd") - self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + lcd = qt.TQLCDNumber(2, self, "lcd") + self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.label = qt.QLabel(" ", self, "label") - self.label.setAlignment(qt.Qt.AlignCenter) + self.label = qt.TQLabel(" ", self, "label") + self.label.setAlignment(qt.TQt.AlignCenter) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) @@ -47,24 +47,24 @@ class LCDRange(qt.QVBox): self.label.setText(s) -class CannonField(qt.QWidget): +class CannonField(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) self.ang = 45 self.f = 0 self.timerCount = 0 - self.autoShootTimer = qt.QTimer(self, "movement handler") + self.autoShootTimer = qt.TQTimer(self, "movement handler") self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) self.shoot_ang = 0 self.shoot_f = 0 - self.target = qt.QPoint(0, 0) + self.target = qt.TQPoint(0, 0) - self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) - self.barrelRect = qt.QRect(33, -4, 15, 8) + self.barrelRect = qt.TQRect(33, -4, 15, 8) self.newTarget() @@ -103,12 +103,12 @@ class CannonField(qt.QWidget): self.autoShootTimer.start(50) def newTarget(self): - r = qt.QRegion(self.targetRect()) - self.target = qt.QPoint(random.randint(200, 390), random.randint(10, 265)) - self.repaint(r.unite(qt.QRegion(self.targetRect()))) + r = qt.TQRegion(self.targetRect()) + self.target = qt.TQPoint(random.randint(200, 390), random.randint(10, 265)) + self.repaint(r.unite(qt.TQRegion(self.targetRect()))) def moveShot(self): - r = qt.QRegion(self.shotRect()) + r = qt.TQRegion(self.shotRect()) self.timerCount = self.timerCount + 1 shotR = self.shotRect() @@ -120,13 +120,13 @@ class CannonField(qt.QWidget): self.autoShootTimer.stop() self.emit(qt.PYSIGNAL("missed()"), ()) else: - r = r.unite(qt.QRegion(shotR)) + r = r.unite(qt.TQRegion(shotR)) self.repaint(r) def paintEvent(self, ev): updateR = ev.rect() - p = qt.QPainter(self) + p = qt.TQPainter(self) if updateR.intersects(self.cannonRect()): self.paintCannon(p) @@ -138,26 +138,26 @@ class CannonField(qt.QWidget): self.paintTarget(p) def paintShot(self, p): - p.setBrush(qt.Qt.black) - p.setPen(qt.Qt.NoPen) + p.setBrush(qt.TQt.black) + p.setPen(qt.TQt.NoPen) p.drawRect(self.shotRect()) def paintTarget(self, p): - p.setBrush(qt.Qt.red) - p.setPen(qt.Qt.black) + p.setBrush(qt.TQt.red) + p.setPen(qt.TQt.black) p.drawRect(self.targetRect()) def paintCannon(self, p): cr = self.cannonRect() - pix = qt.QPixmap(cr.size()) + pix = qt.TQPixmap(cr.size()) pix.fill(self, cr.topLeft()) - tmp = qt.QPainter(pix) - tmp.setBrush(qt.Qt.blue) - tmp.setPen(qt.Qt.NoPen) + tmp = qt.TQPainter(pix) + tmp.setBrush(qt.TQt.blue) + tmp.setPen(qt.TQt.NoPen) tmp.translate(0, pix.height() - 1) - tmp.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) tmp.rotate(-self.ang) tmp.drawRect(self.barrelRect) tmp.end() @@ -165,7 +165,7 @@ class CannonField(qt.QWidget): p.drawPixmap(cr.topLeft(), pix) def cannonRect(self): - r = qt.QRect(0, 0, 50, 50) + r = qt.TQRect(0, 0, 50, 50) r.moveBottomLeft(self.rect().bottomLeft()) return r @@ -183,25 +183,25 @@ class CannonField(qt.QWidget): x = x0 + velx * time y = y0 + vely * time - 0.5 * gravity * time * time - r = qt.QRect(0, 0, 6, 6) - r.moveCenter(qt.QPoint(x, self.height() - 1 - y)) + r = qt.TQRect(0, 0, 6, 6) + r.moveCenter(qt.TQPoint(x, self.height() - 1 - y)) return r def targetRect(self): - r = qt.QRect(0, 0, 20, 10) - r.moveCenter(qt.QPoint(self.target.x(), self.height() - 1 - self.target.y())) + r = qt.TQRect(0, 0, 20, 10) + r.moveCenter(qt.TQPoint(self.target.x(), self.height() - 1 - self.target.y())) return r def sizePolicy(self): - return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) -class MyWidget(qt.QWidget): +class MyWidget(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) - quit = qt.QPushButton("&Quit", self, "quit") - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit = qt.TQPushButton("&Quit", self, "quit") + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) self.angle = LCDRange("ANGLE", self, "angle") @@ -218,22 +218,22 @@ class MyWidget(qt.QWidget): self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) - shoot = qt.QPushButton("&Shoot", self, "shoot") - shoot.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + shoot = qt.TQPushButton("&Shoot", self, "shoot") + shoot.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(shoot, qt.SIGNAL("clicked()"), self.cannonField.shoot) - grid = qt.QGridLayout(self, 2, 2, 10) + grid = qt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) - leftBox = qt.QVBoxLayout() + leftBox = qt.TQVBoxLayout() grid.addLayout(leftBox, 1, 0) leftBox.addWidget(self.angle) leftBox.addWidget(self.force) - topBox = qt.QHBoxLayout() + topBox = qt.TQHBoxLayout() grid.addLayout(topBox, 0, 1) topBox.addWidget(shoot) topBox.addStretch(1) @@ -243,8 +243,8 @@ class MyWidget(qt.QWidget): self.angle.setFocus() -qt.QApplication.setColorSpec(qt.QApplication.CustomColor) -a = qt.QApplication(sys.argv) +qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) +a = qt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 500, 355) diff --git a/examples3/tut13.py b/examples3/tut13.py index a973ea7..5514a2e 100755 --- a/examples3/tut13.py +++ b/examples3/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 import qt -class LCDRange(qt.QWidget): +class LCDRange(qt.TQWidget): def __init__(self, s=None, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) - lcd = qt.QLCDNumber(2, self, "lcd") - self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + lcd = qt.TQLCDNumber(2, self, "lcd") + self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.label = qt.QLabel(" ", self, "label") - self.label.setAlignment(qt.Qt.AlignCenter) + self.label = qt.TQLabel(" ", self, "label") + self.label.setAlignment(qt.TQt.AlignCenter) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) self.setFocusProxy(self.slider) - l = qt.QVBoxLayout(self) + l = qt.TQVBoxLayout(self) l.addWidget(lcd, 1) l.addWidget(self.slider) l.addWidget(self.label) @@ -52,25 +52,25 @@ class LCDRange(qt.QWidget): self.label.setText(s) -class CannonField(qt.QWidget): +class CannonField(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) self.ang = 45 self.f = 0 self.timerCount = 0 - self.autoShootTimer = qt.QTimer(self, "movement handler") + self.autoShootTimer = qt.TQTimer(self, "movement handler") self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) self.shoot_ang = 0 self.shoot_f = 0 - self.target = qt.QPoint(0, 0) + self.target = qt.TQPoint(0, 0) self.gameEnded = 0 - self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) - self.barrelRect = qt.QRect(33, -4, 15, 8) + self.barrelRect = qt.TQRect(33, -4, 15, 8) self.newTarget() @@ -110,9 +110,9 @@ class CannonField(qt.QWidget): self.emit(qt.PYSIGNAL("canShoot(bool)"), (0, )) def newTarget(self): - r = qt.QRegion(self.targetRect()) - self.target = qt.QPoint(random.randint(200, 390), random.randint(10, 265)) - self.repaint(r.unite(qt.QRegion(self.targetRect()))) + r = qt.TQRegion(self.targetRect()) + self.target = qt.TQPoint(random.randint(200, 390), random.randint(10, 265)) + self.repaint(r.unite(qt.TQRegion(self.targetRect()))) def gameOver(self): return self.gameEnded @@ -133,7 +133,7 @@ class CannonField(qt.QWidget): self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) def moveShot(self): - r = qt.QRegion(self.shotRect()) + r = qt.TQRegion(self.shotRect()) self.timerCount = self.timerCount + 1 shotR = self.shotRect() @@ -147,18 +147,18 @@ class CannonField(qt.QWidget): self.emit(qt.PYSIGNAL("missed()"), ()) self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) else: - r = r.unite(qt.QRegion(shotR)) + r = r.unite(qt.TQRegion(shotR)) self.repaint(r) def paintEvent(self, ev): updateR = ev.rect() - p = qt.QPainter(self) + p = qt.TQPainter(self) if self.gameEnded: - p.setPen(qt.Qt.black) - p.setFont(qt.QFont("Courier", 48, qt.QFont.Bold)) - p.drawText(self.rect(), qt.Qt.AlignCenter, "Game Over") + p.setPen(qt.TQt.black) + p.setFont(qt.TQFont("Courier", 48, qt.TQFont.Bold)) + p.drawText(self.rect(), qt.TQt.AlignCenter, "Game Over") if updateR.intersects(self.cannonRect()): self.paintCannon(p) @@ -170,26 +170,26 @@ class CannonField(qt.QWidget): self.paintTarget(p) def paintShot(self, p): - p.setBrush(qt.Qt.black) - p.setPen(qt.Qt.NoPen) + p.setBrush(qt.TQt.black) + p.setPen(qt.TQt.NoPen) p.drawRect(self.shotRect()) def paintTarget(self, p): - p.setBrush(qt.Qt.red) - p.setPen(qt.Qt.black) + p.setBrush(qt.TQt.red) + p.setPen(qt.TQt.black) p.drawRect(self.targetRect()) def paintCannon(self, p): cr = self.cannonRect() - pix = qt.QPixmap(cr.size()) + pix = qt.TQPixmap(cr.size()) pix.fill(self, cr.topLeft()) - tmp = qt.QPainter(pix) - tmp.setBrush(qt.Qt.blue) - tmp.setPen(qt.Qt.NoPen) + tmp = qt.TQPainter(pix) + tmp.setBrush(qt.TQt.blue) + tmp.setPen(qt.TQt.NoPen) tmp.translate(0, pix.height() - 1) - tmp.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) tmp.rotate(-self.ang) tmp.drawRect(self.barrelRect) tmp.end() @@ -197,7 +197,7 @@ class CannonField(qt.QWidget): p.drawPixmap(cr.topLeft(), pix) def cannonRect(self): - r = qt.QRect(0, 0, 50, 50) + r = qt.TQRect(0, 0, 50, 50) r.moveBottomLeft(self.rect().bottomLeft()) return r @@ -215,28 +215,28 @@ class CannonField(qt.QWidget): x = x0 + velx * time y = y0 + vely * time - 0.5 * gravity * time * time - r = qt.QRect(0, 0, 6, 6) - r.moveCenter(qt.QPoint(x, self.height() - 1 - y)) + r = qt.TQRect(0, 0, 6, 6) + r.moveCenter(qt.TQPoint(x, self.height() - 1 - y)) return r def targetRect(self): - r = qt.QRect(0, 0, 20, 10) - r.moveCenter(qt.QPoint(self.target.x(), self.height() - 1 - self.target.y())) + r = qt.TQRect(0, 0, 20, 10) + r.moveCenter(qt.TQPoint(self.target.x(), self.height() - 1 - self.target.y())) return r def isShooting(self): return self.autoShootTimer.isActive() def sizePolicy(self): - return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) -class GameBoard(qt.QWidget): +class GameBoard(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) - quit = qt.QPushButton("&Quit", self, "quit") - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit = qt.TQPushButton("&Quit", self, "quit") + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) self.angle = LCDRange("ANGLE", self, "angle") @@ -256,31 +256,31 @@ class GameBoard(qt.QWidget): self.connect(self.cannonField, qt.PYSIGNAL("hit()"), self.hit) self.connect(self.cannonField, qt.PYSIGNAL("missed()"), self.missed) - self.shoot = qt.QPushButton("&Shoot", self, "shoot") - self.shoot.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.shoot = qt.TQPushButton("&Shoot", self, "shoot") + self.shoot.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(self.shoot, qt.SIGNAL("clicked()"), self.fire) self.connect(self.cannonField, qt.PYSIGNAL("canShoot(bool)"), self.shoot, qt.SLOT("setEnabled(bool)")) - restart = qt.QPushButton("&New Game", self, "newgame") - restart.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + restart = qt.TQPushButton("&New Game", self, "newgame") + restart.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(restart, qt.SIGNAL("clicked()"), self.newGame) - self.hits = qt.QLCDNumber(2, self, "hits") - self.shotsLeft = qt.QLCDNumber(2, self, "shotsleft") - hitsL = qt.QLabel("HITS", self, "hitsLabel") - shotsLeftL = qt.QLabel("SHOTS LEFT", self, "shotsleftLabel") + self.hits = qt.TQLCDNumber(2, self, "hits") + self.shotsLeft = qt.TQLCDNumber(2, self, "shotsleft") + hitsL = qt.TQLabel("HITS", self, "hitsLabel") + shotsLeftL = qt.TQLabel("SHOTS LEFT", self, "shotsleftLabel") - grid = qt.QGridLayout(self, 2, 2, 10) + grid = qt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) - leftBox = qt.QVBoxLayout() + leftBox = qt.TQVBoxLayout() grid.addLayout(leftBox, 1, 0) leftBox.addWidget(self.angle) leftBox.addWidget(self.force) - topBox = qt.QHBoxLayout() + topBox = qt.TQHBoxLayout() grid.addLayout(topBox, 0, 1) topBox.addWidget(self.shoot) topBox.addWidget(self.hits) @@ -320,8 +320,8 @@ class GameBoard(qt.QWidget): self.cannonField.newTarget() -qt.QApplication.setColorSpec(qt.QApplication.CustomColor) -a = qt.QApplication(sys.argv) +qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) +a = qt.TQApplication(sys.argv) gb = GameBoard() gb.setGeometry(100, 100, 500, 355) diff --git a/examples3/tut14.py b/examples3/tut14.py index f046757..c442767 100755 --- a/examples3/tut14.py +++ b/examples3/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 import qt -class LCDRange(qt.QWidget): +class LCDRange(qt.TQWidget): def __init__(self, s=None, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) - lcd = qt.QLCDNumber(2, self, "lcd") - self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + lcd = qt.TQLCDNumber(2, self, "lcd") + self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) - self.label = qt.QLabel(" ", self, "label") - self.label.setAlignment(qt.Qt.AlignCenter) + self.label = qt.TQLabel(" ", self, "label") + self.label.setAlignment(qt.TQt.AlignCenter) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) self.setFocusProxy(self.slider) - l = qt.QVBoxLayout(self) + l = qt.TQVBoxLayout(self) l.addWidget(lcd, 1) l.addWidget(self.slider) l.addWidget(self.label) @@ -52,26 +52,26 @@ class LCDRange(qt.QWidget): self.label.setText(s) -class CannonField(qt.QWidget): +class CannonField(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) self.ang = 45 self.f = 0 self.timerCount = 0 - self.autoShootTimer = qt.QTimer(self, "movement handler") + self.autoShootTimer = qt.TQTimer(self, "movement handler") self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) self.shoot_ang = 0 self.shoot_f = 0 - self.target = qt.QPoint(0, 0) + self.target = qt.TQPoint(0, 0) self.gameEnded = 0 self.barrelPressed = 0 - self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) - self.barrelRect = qt.QRect(33, -4, 15, 8) + self.barrelRect = qt.TQRect(33, -4, 15, 8) self.newTarget() @@ -111,9 +111,9 @@ class CannonField(qt.QWidget): self.emit(qt.PYSIGNAL("canShoot(bool)"), (0, )) def newTarget(self): - r = qt.QRegion(self.targetRect()) - self.target = qt.QPoint(random.randint(200, 390), random.randint(10, 265)) - self.repaint(r.unite(qt.QRegion(self.targetRect()))) + r = qt.TQRegion(self.targetRect()) + self.target = qt.TQPoint(random.randint(200, 390), random.randint(10, 265)) + self.repaint(r.unite(qt.TQRegion(self.targetRect()))) def gameOver(self): return self.gameEnded @@ -134,7 +134,7 @@ class CannonField(qt.QWidget): self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) def moveShot(self): - r = qt.QRegion(self.shotRect()) + r = qt.TQRegion(self.shotRect()) self.timerCount = self.timerCount + 1 shotR = self.shotRect() @@ -148,12 +148,12 @@ class CannonField(qt.QWidget): self.emit(qt.PYSIGNAL("missed()"), ()) self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) else: - r = r.unite(qt.QRegion(shotR)) + r = r.unite(qt.TQRegion(shotR)) self.repaint(r) def mousePressEvent(self, ev): - if ev.button() != qt.Qt.LeftButton: + if ev.button() != qt.TQt.LeftButton: return if self.barrelHit(ev.pos()): self.barrelPressed = 1 @@ -170,17 +170,17 @@ class CannonField(qt.QWidget): self.setAngle(int(round(rad * 180 / math.pi))) def mouseReleaseEvent(self, ev): - if ev.button() == qt.Qt.LeftButton: + if ev.button() == qt.TQt.LeftButton: self.barrelPressed = 0 def paintEvent(self, ev): updateR = ev.rect() - p = qt.QPainter(self) + p = qt.TQPainter(self) if self.gameEnded: - p.setPen(qt.Qt.black) - p.setFont(qt.QFont("Courier", 48, qt.QFont.Bold)) - p.drawText(self.rect(), qt.Qt.AlignCenter, "Game Over") + p.setPen(qt.TQt.black) + p.setFont(qt.TQFont("Courier", 48, qt.TQFont.Bold)) + p.drawText(self.rect(), qt.TQt.AlignCenter, "Game Over") if updateR.intersects(self.cannonRect()): self.paintCannon(p) @@ -195,31 +195,31 @@ class CannonField(qt.QWidget): self.paintTarget(p) def paintShot(self, p): - p.setBrush(qt.Qt.black) - p.setPen(qt.Qt.NoPen) + p.setBrush(qt.TQt.black) + p.setPen(qt.TQt.NoPen) p.drawRect(self.shotRect()) def paintTarget(self, p): - p.setBrush(qt.Qt.red) - p.setPen(qt.Qt.black) + p.setBrush(qt.TQt.red) + p.setPen(qt.TQt.black) p.drawRect(self.targetRect()) def paintBarrier(self, p): - p.setBrush(qt.Qt.yellow) - p.setPen(qt.Qt.black) + p.setBrush(qt.TQt.yellow) + p.setPen(qt.TQt.black) p.drawRect(self.barrierRect()) def paintCannon(self, p): cr = self.cannonRect() - pix = qt.QPixmap(cr.size()) + pix = qt.TQPixmap(cr.size()) pix.fill(self, cr.topLeft()) - tmp = qt.QPainter(pix) - tmp.setBrush(qt.Qt.blue) - tmp.setPen(qt.Qt.NoPen) + tmp = qt.TQPainter(pix) + tmp.setBrush(qt.TQt.blue) + tmp.setPen(qt.TQt.NoPen) tmp.translate(0, pix.height() - 1) - tmp.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) tmp.rotate(-self.ang) tmp.drawRect(self.barrelRect) tmp.end() @@ -227,7 +227,7 @@ class CannonField(qt.QWidget): p.drawPixmap(cr.topLeft(), pix) def cannonRect(self): - r = qt.QRect(0, 0, 50, 50) + r = qt.TQRect(0, 0, 50, 50) r.moveBottomLeft(self.rect().bottomLeft()) return r @@ -245,20 +245,20 @@ class CannonField(qt.QWidget): x = x0 + velx * time y = y0 + vely * time - 0.5 * gravity * time * time - r = qt.QRect(0, 0, 6, 6) - r.moveCenter(qt.QPoint(x, self.height() - 1 - y)) + r = qt.TQRect(0, 0, 6, 6) + r.moveCenter(qt.TQPoint(x, self.height() - 1 - y)) return r def targetRect(self): - r = qt.QRect(0, 0, 20, 10) - r.moveCenter(qt.QPoint(self.target.x(), self.height() - 1 - self.target.y())) + r = qt.TQRect(0, 0, 20, 10) + r.moveCenter(qt.TQPoint(self.target.x(), self.height() - 1 - self.target.y())) return r def barrierRect(self): - return qt.QRect(145, self.height() - 100, 15, 100) + return qt.TQRect(145, self.height() - 100, 15, 100) def barrelHit(self, p): - mtx = qt.QWMatrix() + mtx = qt.TQWMatrix() mtx.translate(0, self.height() - 1) mtx.rotate(-self.ang) (mtx, invertable) = mtx.invert() @@ -268,15 +268,15 @@ class CannonField(qt.QWidget): return self.autoShootTimer.isActive() def sizePolicy(self): - return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) -class GameBoard(qt.QWidget): +class GameBoard(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) - quit = qt.QPushButton("&Quit", self, "quit") - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit = qt.TQPushButton("&Quit", self, "quit") + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) self.angle = LCDRange("ANGLE", self, "angle") @@ -285,8 +285,8 @@ class GameBoard(qt.QWidget): self.force = LCDRange("FORCE", self, "force") self.force.setRange(10, 50) - box = qt.QVBox(self, "cannonFrame") - box.setFrameStyle(qt.QFrame.WinPanel | qt.QFrame.Sunken) + box = qt.TQVBox(self, "cannonFrame") + box.setFrameStyle(qt.TQFrame.WinPanel | qt.TQFrame.Sunken) self.cannonField = CannonField(box, "cannonField") @@ -299,36 +299,36 @@ class GameBoard(qt.QWidget): self.connect(self.cannonField, qt.PYSIGNAL("hit()"), self.hit) self.connect(self.cannonField, qt.PYSIGNAL("missed()"), self.missed) - self.shoot = qt.QPushButton("&Shoot", self, "shoot") - self.shoot.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.shoot = qt.TQPushButton("&Shoot", self, "shoot") + self.shoot.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(self.shoot, qt.SIGNAL("clicked()"), self.fire) self.connect(self.cannonField, qt.PYSIGNAL("canShoot(bool)"), self.shoot, qt.SLOT("setEnabled(bool)")) - restart = qt.QPushButton("&New Game", self, "newgame") - restart.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + restart = qt.TQPushButton("&New Game", self, "newgame") + restart.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(restart, qt.SIGNAL("clicked()"), self.newGame) - self.hits = qt.QLCDNumber(2, self, "hits") - self.shotsLeft = qt.QLCDNumber(2, self, "shotsleft") - hitsL = qt.QLabel("HITS", self, "hitsLabel") - shotsLeftL = qt.QLabel("SHOTS LEFT", self, "shotsleftLabel") + self.hits = qt.TQLCDNumber(2, self, "hits") + self.shotsLeft = qt.TQLCDNumber(2, self, "shotsleft") + hitsL = qt.TQLabel("HITS", self, "hitsLabel") + shotsLeftL = qt.TQLabel("SHOTS LEFT", self, "shotsleftLabel") - accel = qt.QAccel(self) - accel.connectItem(accel.insertItem(qt.Qt.Key_Enter), self.fire) - accel.connectItem(accel.insertItem(qt.Qt.Key_Return), self.fire) - accel.connectItem(accel.insertItem(qt.Qt.CTRL + qt.Qt.Key_Q), qt.qApp, qt.SLOT("quit()")) + accel = qt.TQAccel(self) + accel.connectItem(accel.insertItem(qt.TQt.Key_Enter), self.fire) + accel.connectItem(accel.insertItem(qt.TQt.Key_Return), self.fire) + accel.connectItem(accel.insertItem(qt.TQt.CTRL + qt.TQt.Key_Q), qt.qApp, qt.SLOT("quit()")) - grid = qt.QGridLayout(self, 2, 2, 10) + grid = qt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) grid.addWidget(box, 1, 1) grid.setColStretch(1, 10) - leftBox = qt.QVBoxLayout() + leftBox = qt.TQVBoxLayout() grid.addLayout(leftBox, 1, 0) leftBox.addWidget(self.angle) leftBox.addWidget(self.force) - topBox = qt.QHBoxLayout() + topBox = qt.TQHBoxLayout() grid.addLayout(topBox, 0, 1) topBox.addWidget(self.shoot) topBox.addWidget(self.hits) @@ -368,8 +368,8 @@ class GameBoard(qt.QWidget): self.cannonField.newTarget() -qt.QApplication.setColorSpec(qt.QApplication.CustomColor) -a = qt.QApplication(sys.argv) +qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) +a = qt.TQApplication(sys.argv) gb = GameBoard() gb.setGeometry(100, 100, 500, 355) diff --git a/examples3/tut2.py b/examples3/tut2.py index 8b6a076..0234d48 100755 --- a/examples3/tut2.py +++ b/examples3/tut2.py @@ -1,18 +1,18 @@ #!/usr/bin/env python -# Qt tutorial 2. +# TQt tutorial 2. import sys import qt -a = qt.QApplication(sys.argv) +a = qt.TQApplication(sys.argv) -quit = qt.QPushButton("Quit", None) +quit = qt.TQPushButton("Quit", None) quit.resize(75, 30) -quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) +quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) -qt.QObject.connect(quit, qt.SIGNAL("clicked()"), a, qt.SLOT("quit()")) +qt.TQObject.connect(quit, qt.SIGNAL("clicked()"), a, qt.SLOT("quit()")) a.setMainWidget(quit) quit.show() diff --git a/examples3/tut3.py b/examples3/tut3.py index 9b73954..4f69461 100755 --- a/examples3/tut3.py +++ b/examples3/tut3.py @@ -1,20 +1,20 @@ #!/usr/bin/env python -# Qt tutorial 3. +# TQt tutorial 3. import sys import qt -a = qt.QApplication(sys.argv) +a = qt.TQApplication(sys.argv) -box = qt.QVBox() +box = qt.TQVBox() box.resize(200, 120) -quit = qt.QPushButton("Quit", box) -quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) +quit = qt.TQPushButton("Quit", box) +quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) -qt.QObject.connect(quit, qt.SIGNAL("clicked()"), a, qt.SLOT("quit()")) +qt.TQObject.connect(quit, qt.SIGNAL("clicked()"), a, qt.SLOT("quit()")) a.setMainWidget(box) box.show() diff --git a/examples3/tut4.py b/examples3/tut4.py index 9ad05c7..968d325 100755 --- a/examples3/tut4.py +++ b/examples3/tut4.py @@ -1,26 +1,26 @@ #!/usr/bin/env python -# Qt tutorial 4. +# TQt tutorial 4. import sys import qt -class MyWidget(qt.QWidget): +class MyWidget(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) self.setMinimumSize(200, 120) self.setMaximumSize(200, 120) - quit = qt.QPushButton("Quit", self, "quit") + quit = qt.TQPushButton("Quit", self, "quit") quit.setGeometry(62, 40, 75, 30) - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) -a = qt.QApplication(sys.argv) +a = qt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 200, 120) diff --git a/examples3/tut5.py b/examples3/tut5.py index 88a2447..f084cdb 100755 --- a/examples3/tut5.py +++ b/examples3/tut5.py @@ -1,30 +1,30 @@ #!/usr/bin/env python -# Qt tutorial 5. +# TQt tutorial 5. import sys import qt -class MyWidget(qt.QVBox): +class MyWidget(qt.TQVBox): def __init__(self, parent=None, name=None): - qt.QVBox.__init__(self, parent, name) + qt.TQVBox.__init__(self, parent, name) - quit = qt.QPushButton("Quit", self, "quit") - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit = qt.TQPushButton("Quit", self, "quit") + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) - lcd = qt.QLCDNumber(2, self, "lcd") + lcd = qt.TQLCDNumber(2, self, "lcd") - slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") slider.setRange(0, 99) slider.setValue(0) self.connect(slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) -a = qt.QApplication(sys.argv) +a = qt.TQApplication(sys.argv) w = MyWidget() a.setMainWidget(w) diff --git a/examples3/tut6.py b/examples3/tut6.py index 785edfe..022e408 100755 --- a/examples3/tut6.py +++ b/examples3/tut6.py @@ -1,39 +1,39 @@ #!/usr/bin/env python -# Qt tutorial 6. +# TQt tutorial 6. import sys import qt -class LCDRange(qt.QVBox): +class LCDRange(qt.TQVBox): def __init__(self, parent=None, name=None): - qt.QVBox.__init__(self, parent, name) + qt.TQVBox.__init__(self, parent, name) - lcd = qt.QLCDNumber(2, self, "lcd") - slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + lcd = qt.TQLCDNumber(2, self, "lcd") + slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") slider.setRange(0, 99) slider.setValue(0) self.connect(slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) -class MyWidget(qt.QVBox): +class MyWidget(qt.TQVBox): def __init__(self, parent=None, name=None): - qt.QVBox.__init__(self, parent, name) + qt.TQVBox.__init__(self, parent, name) - quit = qt.QPushButton("Quit", self, "quit") - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit = qt.TQPushButton("Quit", self, "quit") + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) - grid = qt.QGrid(4, self) + grid = qt.TQGrid(4, self) for c in range(4): for r in range(4): LCDRange(grid) -a = qt.QApplication(sys.argv) +a = qt.TQApplication(sys.argv) w = MyWidget() a.setMainWidget(w) diff --git a/examples3/tut7.py b/examples3/tut7.py index 400505e..20e5455 100755 --- a/examples3/tut7.py +++ b/examples3/tut7.py @@ -1,17 +1,17 @@ #!/usr/bin/env python -# Qt tutorial 7. +# TQt tutorial 7. import sys import qt -class LCDRange(qt.QVBox): +class LCDRange(qt.TQVBox): def __init__(self, parent=None, name=None): - qt.QVBox.__init__(self, parent, name) + qt.TQVBox.__init__(self, parent, name) - lcd = qt.QLCDNumber(2, self, "lcd") - self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + lcd = qt.TQLCDNumber(2, self, "lcd") + self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) @@ -24,16 +24,16 @@ class LCDRange(qt.QVBox): self.slider.setValue(value) -class MyWidget(qt.QVBox): +class MyWidget(qt.TQVBox): def __init__(self, parent=None, name=None): - qt.QVBox.__init__(self, parent, name) + qt.TQVBox.__init__(self, parent, name) - quit = qt.QPushButton("Quit", self, "quit") - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit = qt.TQPushButton("Quit", self, "quit") + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) - grid = qt.QGrid(4, self) + grid = qt.TQGrid(4, self) self.lcdlist = [] previous = None @@ -49,7 +49,7 @@ class MyWidget(qt.QVBox): self.lcdlist.append(lr) -a = qt.QApplication(sys.argv) +a = qt.TQApplication(sys.argv) w = MyWidget() a.setMainWidget(w) diff --git a/examples3/tut8.py b/examples3/tut8.py index f7dd156..2bbc7b9 100755 --- a/examples3/tut8.py +++ b/examples3/tut8.py @@ -1,17 +1,17 @@ #!/usr/bin/env python -# Qt tutorial 8. +# TQt tutorial 8. import sys import qt -class LCDRange(qt.QVBox): +class LCDRange(qt.TQVBox): def __init__(self, parent=None, name=None): - qt.QVBox.__init__(self, parent, name) + qt.TQVBox.__init__(self, parent, name) - lcd = qt.QLCDNumber(2, self, "lcd") - self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + lcd = qt.TQLCDNumber(2, self, "lcd") + self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) @@ -32,12 +32,12 @@ class LCDRange(qt.QVBox): self.slider.setRange(minVal, maxVal) -class CannonField(qt.QWidget): +class CannonField(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) self.ang = 45 - self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) def angle(self): return self.ang @@ -54,19 +54,19 @@ class CannonField(qt.QWidget): self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) def paintEvent(self, ev): - p = qt.QPainter(self) + p = qt.TQPainter(self) p.drawText(200, 200, "Angle = %d" % (self.ang)) def sizePolicy(self): - return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) -class MyWidget(qt.QWidget): +class MyWidget(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) - quit = qt.QPushButton("Quit", self, "quit") - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit = qt.TQPushButton("Quit", self, "quit") + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) self.angle = LCDRange(self, "angle") @@ -77,10 +77,10 @@ class MyWidget(qt.QWidget): self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) - grid = qt.QGridLayout(self, 2, 2, 10) + grid = qt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) - grid.addWidget(self.angle, 1, 0, qt.Qt.AlignTop) + grid.addWidget(self.angle, 1, 0, qt.TQt.AlignTop) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) @@ -88,7 +88,7 @@ class MyWidget(qt.QWidget): self.angle.setFocus() -a = qt.QApplication(sys.argv) +a = qt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 500, 355) diff --git a/examples3/tut9.py b/examples3/tut9.py index aba7ddc..6c1880a 100755 --- a/examples3/tut9.py +++ b/examples3/tut9.py @@ -1,17 +1,17 @@ #!/usr/bin/env python -# Qt tutorial 9. +# TQt tutorial 9. import sys import qt -class LCDRange(qt.QVBox): +class LCDRange(qt.TQVBox): def __init__(self, parent=None, name=None): - qt.QVBox.__init__(self, parent, name) + qt.TQVBox.__init__(self, parent, name) - lcd = qt.QLCDNumber(2, self, "lcd") - self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + lcd = qt.TQLCDNumber(2, self, "lcd") + self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider") self.slider.setRange(0, 99) self.slider.setValue(0) self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) @@ -31,12 +31,12 @@ class LCDRange(qt.QVBox): self.slider.setRange(minVal, maxVal) -class CannonField(qt.QWidget): +class CannonField(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) self.ang = 45 - self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200))) def angle(self): return self.ang @@ -53,26 +53,26 @@ class CannonField(qt.QWidget): self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) def paintEvent(self, ev): - p = qt.QPainter(self) + p = qt.TQPainter(self) - p.setBrush(qt.Qt.blue) - p.setPen(qt.Qt.NoPen) + p.setBrush(qt.TQt.blue) + p.setPen(qt.TQt.NoPen) p.translate(0, self.rect().bottom()) - p.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + p.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16) p.rotate(-self.ang) - p.drawRect(qt.QRect(33, -4, 15, 8)) + p.drawRect(qt.TQRect(33, -4, 15, 8)) def sizePolicy(self): - return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding) -class MyWidget(qt.QWidget): +class MyWidget(qt.TQWidget): def __init__(self, parent=None, name=None): - qt.QWidget.__init__(self, parent, name) + qt.TQWidget.__init__(self, parent, name) - quit = qt.QPushButton("&Quit", self, "quit") - quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + quit = qt.TQPushButton("&Quit", self, "quit") + quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold)) self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) self.angle = LCDRange(self, "angle") @@ -83,10 +83,10 @@ class MyWidget(qt.QWidget): self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) - grid = qt.QGridLayout(self, 2, 2, 10) + grid = qt.TQGridLayout(self, 2, 2, 10) grid.addWidget(quit, 0, 0) - grid.addWidget(self.angle, 1, 0, qt.Qt.AlignTop) + grid.addWidget(self.angle, 1, 0, qt.TQt.AlignTop) grid.addWidget(self.cannonField, 1, 1) grid.setColStretch(1, 10) @@ -94,8 +94,8 @@ class MyWidget(qt.QWidget): self.angle.setFocus() -qt.QApplication.setColorSpec(qt.QApplication.CustomColor) -a = qt.QApplication(sys.argv) +qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor) +a = qt.TQApplication(sys.argv) w = MyWidget() w.setGeometry(100, 100, 500, 355) diff --git a/examples3/webbrowser/mainwindow.py b/examples3/webbrowser/mainwindow.py index 6afdfc8..c88be2f 100644 --- a/examples3/webbrowser/mainwindow.py +++ b/examples3/webbrowser/mainwindow.py @@ -3,13 +3,13 @@ # Form implementation generated from reading ui file 'mainwindow.ui' # # Created: Sun Dec 5 14:50:47 2004 -# by: The PyQt User Interface Compiler (pyuic) snapshot-20041203 +# by: The PyTQt User Interface Compiler (pyuic) snapshot-20041203 # # WARNING! All changes made in this file will be lost! from qt import * -from qtaxcontainer import QAxWidget +from qtaxcontainer import TQAxWidget image0_data = [ "32 32 3 1", @@ -51,7 +51,7 @@ image0_data = [ ] image1_data = [ "32 32 142 2", -"Qt c None", +"TQt c None", "#O c #0010f7", "#P c #0021ef", "#R c #0021f7", @@ -193,19 +193,19 @@ image1_data = [ ".v c #efffff", ".p c #f7ffff", ".g c #ffffff", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQt.#.a.b.c.aQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQt.d.e.f.g.h.iQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQt.d.j.k.g.g.l.mQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQt.a.n.o.g.p.q.r.mQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQt.s.t.u.g.g.v.w.x.y.mQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQt.z.A.g.g.v.B.x.r.C.DQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQt.E.a.F.g.g.v.G.r.H.H.I.JQtQtQtQtQtQtQtQtQtQt.s.s.K.K.KQtQt", -"QtQt.L.M.N.g.g.q.x.H.O.y.P.P.Q.LQtQtQt.s.s.K.a.R.S.T.U.V.V.Q.W.X", -"Qt.#.Q.Y.g.g.Z.0.O.y.P.P.P.P.1.2.3.4.S.e.c.5.f.6.N.l.7.8.Z.0.9.T", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.#.a.b.c.aTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQt.d.e.f.g.h.iTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQt.d.j.k.g.g.l.mTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQt.a.n.o.g.p.q.r.mTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.s.t.u.g.g.v.w.x.y.mTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.z.A.g.g.v.B.x.r.C.DTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQt.E.a.F.g.g.v.G.r.H.H.I.JTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.s.s.K.K.KTQtTQt", +"TQtTQt.L.M.N.g.g.q.x.H.O.y.P.P.Q.LTQtTQtTQt.s.s.K.a.R.S.T.U.V.V.Q.W.X", +"TQt.#.Q.Y.g.g.Z.0.O.y.P.P.P.P.1.2.3.4.S.e.c.5.f.6.N.l.7.8.Z.0.9.T", ".s.W#..g.p.Z###a.O.P.P.I.I.P#b#c#d#e.B#f#g.7.8.8.q#h#i.r.H#j#k#l", ".e#e.g#m.G#d.O.y.P.I.I.I.I.I.I.H.6####.0.r.H#a.O#c.I#n.I#j.1#o#p", ".5.p#f.x.0.O.y.P.I.I.I.I.I.I.I.I.I.I.I.I.I.I.I.I.I.C.C.C#b#q#r#s", @@ -213,22 +213,22 @@ image1_data = [ "#y#z#j.I.I.P.I.I.C.C.C.I.I.C.C#j#b#v#v#b#j#j#j#b#j#v#b#v#A#B#C#p", "#D#E#k#q#A#j.C.I.C.I.C.C.C.I#F#G#k#k#H#G#I#B.1.1#J#K#K.1#q#z#x#L", ".s#M#N#r#z#K#b#u.C#u.C.C.I.I#B#O#P#Q#E#P#R#S#T#x#r#r#H.9#U#G#T#V", -"QtQt.z#N#r#I.1#v#j#u#j.C#u.I#W#X#D.s#Y#D#Z#0#1#2#Q#P#P#N#N#T#E#3", -"QtQt.s#4#5#x#H#B#K#v#j#j#j#j#6QtQtQtQtQtQtQt.s.s.d.X#7#8#9a..X.s", -"QtQtQtQt.da##S#k#z#J#v#b#j#vaaQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQt.Eab#x#o#I#K#v#vac.iQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQt.sad#E#rae#q#K#wafQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQt.#.Lagah#k#U#kafQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQt#4#Q#T#xahaiQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQt#4adajakalQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt" +"TQtTQt.z#N#r#I.1#v#j#u#j.C#u.I#W#X#D.s#Y#D#Z#0#1#2#Q#P#P#N#N#T#E#3", +"TQtTQt.s#4#5#x#H#B#K#v#j#j#j#j#6TQtTQtTQtTQtTQtTQtTQt.s.s.d.X#7#8#9a..X.s", +"TQtTQtTQtTQt.da##S#k#z#J#v#b#j#vaaTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.Eab#x#o#I#K#v#vac.iTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQt.sad#E#rae#q#K#wafTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQt.#.Lagah#k#U#kafTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQt#4#Q#T#xahaiTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQt#4adajakalTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt" ] image2_data = [ "32 32 142 2", -"Qt c None", +"TQt c None", "#Y c #0018e7", "aa c #0018ef", "#E c #0018ff", @@ -370,18 +370,18 @@ image2_data = [ ".5 c #e7ffff", ".4 c #efffff", ".3 c #f7ffff", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.a.b.c.#QtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.d.e.f.g.h.iQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.j.k.l.m.n.o.pQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.d.f.q.r.m.s.t.cQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.u.q.v.m.r.m.w.x.y.#QtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.u.z.z.z.z.m.m.A.B.C.DQtQtQtQt", -"QtQt.#.E.F.#.#QtQtQtQtQtQtQtQtQtQt.j.G.H.z.H.z.m.m.I.n.J.KQtQtQt", -".L.M.N.O.P.Q.R.S.T.U.E.#.#QtQtQt.V.W.X.H.Y.H.H.z.z.z.Z.g.0.VQtQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.#.a.b.c.#TQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.d.e.f.g.h.iTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.j.k.l.m.n.o.pTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.d.f.q.r.m.s.t.cTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.u.q.v.m.r.m.w.x.y.#TQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.u.z.z.z.z.m.m.A.B.C.DTQtTQtTQtTQt", +"TQtTQt.#.E.F.#.#TQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.j.G.H.z.H.z.m.m.I.n.J.KTQtTQtTQt", +".L.M.N.O.P.Q.R.S.T.U.E.#.#TQtTQtTQt.V.W.X.H.Y.H.H.z.z.z.Z.g.0.VTQtTQt", ".1.2.3.4.5.k.6.2.Y.7.8.a.9#.###a#b.Y.G.G.G.G.Y.G.Y.H.z#c.n#d.u.#", ".b#e#f#g#h#i.f#h#g#g#j#k#k#k.e.4.4#l#c.X.G.G.G.G.G.G.G.H.H#m#n#o", "#p.m#q.r.m.m.m.z#r.m.z.m.r.q.q.q.m.H.G.G.X#c.G.G.G.X.X.X.X.7#s.J", @@ -389,19 +389,19 @@ image2_data = [ "#t.H.r.z.Y.G#c.X.X.X.7.X.X.X.X.X.X.X.X.X.X.X.X.X.7.A#u#v#w#x#y#z", "#A.I.m.H.X.X.X.A.A#B.A#B#u#u#u#u#B.X#c.X.X.X.X.A.A#u.w#C.g#D#E#F", "#G.s.G.A.w#v#H#w#C.n#x#s#I#y#y#y#J#H.X.7.X.X.7.A#u.w#w#J#y#K#L.U", -"#M.x.n#N#D#O#P#K#K#Q#Q#R#S#T#U#U#V#W.A.X.A.A#B#u.w.n#D#P#E#L.VQt", -"#X.h#V#Q#Y#R#S#U#Z#0#1.p.#.#.#.#.V#2.s.7.A#u#u.w#3#D#P#E#4#5QtQt", -"QtQt#6#1#7.D.#.#QtQtQtQtQtQtQtQtQt#6#8#B#u.w#9#s#ya.#E#F.V.#QtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.8#9#H#w#s#Wa#aa#2#XQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#ab#w#C#N#W#K#Eac.#QtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtad.Pae#J#Wa##Vaf#XQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#ag#W#P#Eah#6QtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#ai#K#Eaj.jQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#akalak.iQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt" +"#M.x.n#N#D#O#P#K#K#Q#Q#R#S#T#U#U#V#W.A.X.A.A#B#u.w.n#D#P#E#L.VTQt", +"#X.h#V#Q#Y#R#S#U#Z#0#1.p.#.#.#.#.V#2.s.7.A#u#u.w#3#D#P#E#4#5TQtTQt", +"TQtTQt#6#1#7.D.#.#TQtTQtTQtTQtTQtTQtTQtTQtTQt#6#8#B#u.w#9#s#ya.#E#F.V.#TQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.#.8#9#H#w#s#Wa#aa#2#XTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.#ab#w#C#N#W#K#Eac.#TQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtad.Pae#J#Wa##Vaf#XTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.#ag#W#P#Eah#6TQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.#ai#K#Eaj.jTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.#akalak.iTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt" ] image3_data = [ "25 25 2 1", @@ -473,7 +473,7 @@ image4_data = [ ] image5_data = [ "32 32 211 2", -"Qt c None", +"TQt c None", "aJ c #000000", "#W c #080800", "#N c #100800", @@ -684,42 +684,42 @@ image5_data = [ "aA c #efde29", "#Z c #f7e729", "#0 c #f7e739", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.aQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQt.b.c.d.eQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQt.f.g.h.i.bQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQt.j.k.l.e.m.nQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQt.b.a.o.p.q.r.s.tQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQt.u.v.w.k.x.y.z.A.bQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQt.t.k.B.C.k.D.E.F.G.HQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQt.b.#.#.o.I.b.c.J.K.L.M.tQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQt.a.N.O.P.Q.R.o.S.T.U.V.s.bQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQt.t.N.P.W.k.X.R.P.Y.i.A.Z.0.1QtQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQt.b.x.2.w.3.4.I.j.#.5.6.L.F.7.0.cQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQt.n.8.9.p#..o.4.x.x.x##.s#a#b.s#c.bQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQt.t.D.##d#e.h#f.o.P.2.2#g###h.A.z#i.KQtQtQtQtQtQtQt", -"QtQtQtQtQtQt.b#j.P.f.P#k.q.4.X#l#m#n.n#o.J.6#p#i#q.cQtQtQtQtQtQt", -"QtQtQtQtQtQt.W#m#k.O#m#r.5.k#s#t#m.q#r.U.E.T#p#u#i.M.eQtQtQtQtQt", -"QtQtQtQtQt.b.x#r.o.t#v.f.o.4.l#l#w#x.f.i#o.E###a.m#y.nQtQtQtQtQt", -"QtQtQtQtQt.b.e.c#d.o#z.u.q#f.I.q.#.#.2#A.U.m#B#h.h.j.bQtQtQtQtQt", -"QtQtQtQtQtQtQtQt.b#C#D#E#F#G#G#G#H#I#J#K#L#M#N.iQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQt.b#O#P#Q#R#S#T#U#L#M#V#W#N#V#V.iQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQt.b#X#Y#Z#0#0#1#2#3#4#5#6#7#M#V#AQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQt.b#8#9a.a#aaaaabac#3adaeaf#7#M.JQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQt.bagaha.a##1aaaa#2aiajakalaman#AQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtaoapa.a#aaaqaraq#3aj#5afamas.JQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtatauava#aw#V#W#Max#4ayafazan.JQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtatahaAaB#W#N#M#V#V#RaCalazas.JQtQtQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQt.baDap#Z#Q#N#M#V#M#N#6akafaEaFaG.E#h.JQtQtQtQtQt", -"QtQtQtQtQtQtQtQtaHaIahaAaB#W#W#N#WaJ#6aKalamaF#WaJaJ#yQtQtQtQtQt", -"QtQtQtQtQtQtQt.qaLaIahavaM#WaJ#W#DaN#RaealaOan#NaNaPaQQtQtQtQtQt", -"QtQtQtQtQtQt.jaRaSaTaUavaB#WaNaPaLaVaWaeaX#6aYaZa0a1a2QtQtQtQtQt", -"QtQtQtQtQt.ba3a4a5a5aVa6a1aZa7aSaSa5a8a9a4a5b.b#a5a5.kQtQtQtQtQt", -"QtQtQtQtQtbaa7a7aVa0b.b#a7b#a0a7a7a7aSaSa7b.aVa0aVaR.#QtQtQtQtQt", -"QtQtQtQtQtbbbcbdbebebfbgbhbhbibjbjbkbkblbmbmbnbobpbq.bQtQtQtQtQt" +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.#.aTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.b.c.d.eTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.f.g.h.i.bTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.j.k.l.e.m.nTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.b.a.o.p.q.r.s.tTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.u.v.w.k.x.y.z.A.bTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.t.k.B.C.k.D.E.F.G.HTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.b.#.#.o.I.b.c.J.K.L.M.tTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQt.a.N.O.P.Q.R.o.S.T.U.V.s.bTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQt.t.N.P.W.k.X.R.P.Y.i.A.Z.0.1TQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQt.b.x.2.w.3.4.I.j.#.5.6.L.F.7.0.cTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQt.n.8.9.p#..o.4.x.x.x##.s#a#b.s#c.bTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQt.t.D.##d#e.h#f.o.P.2.2#g###h.A.z#i.KTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQt.b#j.P.f.P#k.q.4.X#l#m#n.n#o.J.6#p#i#q.cTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQt.W#m#k.O#m#r.5.k#s#t#m.q#r.U.E.T#p#u#i.M.eTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.b.x#r.o.t#v.f.o.4.l#l#w#x.f.i#o.E###a.m#y.nTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.b.e.c#d.o#z.u.q#f.I.q.#.#.2#A.U.m#B#h.h.j.bTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQt.b#C#D#E#F#G#G#G#H#I#J#K#L#M#N.iTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQt.b#O#P#Q#R#S#T#U#L#M#V#W#N#V#V.iTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQt.b#X#Y#Z#0#0#1#2#3#4#5#6#7#M#V#ATQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQt.b#8#9a.a#aaaaabac#3adaeaf#7#M.JTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQt.bagaha.a##1aaaa#2aiajakalaman#ATQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtaoapa.a#aaaqaraq#3aj#5afamas.JTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtatauava#aw#V#W#Max#4ayafazan.JTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtatahaAaB#W#N#M#V#V#RaCalazas.JTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQt.baDap#Z#Q#N#M#V#M#N#6akafaEaFaG.E#h.JTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtaHaIahaAaB#W#W#N#WaJ#6aKalamaF#WaJaJ#yTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQt.qaLaIahavaM#WaJ#W#DaN#RaealaOan#NaNaPaTQTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQt.jaRaSaTaUavaB#WaNaPaLaVaWaeaX#6aYaZa0a1a2TQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.ba3a4a5a5aVa6a1aZa7aSaSa5a8a9a4a5b.b#a5a5.kTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtbaa7a7aVa0b.b#a7b#a0a7a7a7aSaSa7b.aVa0aVaR.#TQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtbbbcbdbebebfbgbhbhbibjbjbkbkblbmbmbnbobpbq.bTQtTQtTQtTQtTQt" ] image6_data = [ "22 22 165 2", -"Qt c None", +"TQt c None", ".h c #000000", ".o c #010101", "aF c #030303", @@ -884,84 +884,84 @@ image6_data = [ ".B c #fdfdfd", ".j c #fefefe", ".i c #ffffff", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", -"QtQtQtQtQt.#.a.b.c.d.d.e.f.g.hQtQtQtQtQtQtQt", -"QtQtQtQt.#.i.i.i.i.i.i.i.i.i.h.hQtQtQtQtQtQt", -"QtQtQtQt.a.j.j.j.j.j.j.i.i.i.h.k.hQtQtQtQtQt", -"QtQtQtQt.l.m.n.o.p.q.r.s.j.i.h.t.u.hQtQtQtQt", -"QtQtQtQt.e.v.w.x.y.z.A.n.B.B.h.C.D.E.hQtQtQt", -"QtQtQt.h.h.h.h.h.F.G.H.I.n.J.h.h.h.h.h.hQtQt", -"QtQt.h.K.L.M.N.O.h.P.Q.R.S.n.T.j.U.V.W.hQtQt", -"Qt.h.X.Y.Z.0.1.2.3.h.4.5.6.q.r.s.7.v.8.hQtQt", -"Qt.h.9#..###.F.F.F#a.h#b#c#d.m.j.7.v#c.hQtQt", -"Qt.h#e#f.a#g#h#i#j#k.h#l#m.r#n#o.7.v#c.hQtQt", -"Qt.h#p#q.a#r.F.F.F#s.h#t#u.x.n.j.7.v#c.hQtQt", -"Qt.h#v#w.##x#y#z#A#B.h#C#m#m.q#o.7.v#c.hQtQt", -"QtQt.h#D.Z#E.F.F#F.h#G#H#I#J.A.7.m.v#c.hQtQt", -"QtQtQt.h#K#L#M#N.h#O#P#Q#R#m.q#S#T#d#c.hQtQt", -"QtQtQtQt.h.h.h.h.Z#U#V#W#X#Y#Z#0.S#1#2.hQtQt", -"QtQtQtQt#3.t.v.x#4#5#6#7#8#9a.a#aaabac.hQtQt", -"QtQtQtQt.6ad.kae.yafagahaiajakalamana..oQtQt", -"QtQtQtQt.haeaoapaqaqarasatauavawaxayaz.oQtQt", -"QtQtQtQtQt.h.h.h.h.haA.oaBaCaiaD.HaEaFQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtaGaHaIQtQtQtQtQtQt", -"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt" +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.#.a.b.c.d.d.e.f.g.hTQtTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQt.#.i.i.i.i.i.i.i.i.i.h.hTQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQt.a.j.j.j.j.j.j.i.i.i.h.k.hTQtTQtTQtTQtTQt", +"TQtTQtTQtTQt.l.m.n.o.p.q.r.s.j.i.h.t.u.hTQtTQtTQtTQt", +"TQtTQtTQtTQt.e.v.w.x.y.z.A.n.B.B.h.C.D.E.hTQtTQtTQt", +"TQtTQtTQt.h.h.h.h.h.F.G.H.I.n.J.h.h.h.h.h.hTQtTQt", +"TQtTQt.h.K.L.M.N.O.h.P.Q.R.S.n.T.j.U.V.W.hTQtTQt", +"TQt.h.X.Y.Z.0.1.2.3.h.4.5.6.q.r.s.7.v.8.hTQtTQt", +"TQt.h.9#..###.F.F.F#a.h#b#c#d.m.j.7.v#c.hTQtTQt", +"TQt.h#e#f.a#g#h#i#j#k.h#l#m.r#n#o.7.v#c.hTQtTQt", +"TQt.h#p#q.a#r.F.F.F#s.h#t#u.x.n.j.7.v#c.hTQtTQt", +"TQt.h#v#w.##x#y#z#A#B.h#C#m#m.q#o.7.v#c.hTQtTQt", +"TQtTQt.h#D.Z#E.F.F#F.h#G#H#I#J.A.7.m.v#c.hTQtTQt", +"TQtTQtTQt.h#K#L#M#N.h#O#P#Q#R#m.q#S#T#d#c.hTQtTQt", +"TQtTQtTQtTQt.h.h.h.h.Z#U#V#W#X#Y#Z#0.S#1#2.hTQtTQt", +"TQtTQtTQtTQt#3.t.v.x#4#5#6#7#8#9a.a#aaabac.hTQtTQt", +"TQtTQtTQtTQt.6ad.kae.yafagahaiajakalamana..oTQtTQt", +"TQtTQtTQtTQt.haeaoapaqaqarasatauavawaxayaz.oTQtTQt", +"TQtTQtTQtTQtTQt.h.h.h.h.haA.oaBaCaiaD.HaEaFTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtaGaHaITQtTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQtTQt" ] -class MainWindow(QMainWindow): +class MainWindow(TQMainWindow): def __init__(self,parent = None,name = None,fl = 0): - QMainWindow.__init__(self,parent,name,fl) + TQMainWindow.__init__(self,parent,name,fl) self.statusBar() - self.image0 = QPixmap(image0_data) - self.image1 = QPixmap(image1_data) - self.image2 = QPixmap(image2_data) - self.image3 = QPixmap(image3_data) - self.image4 = QPixmap(image4_data) - self.image5 = QPixmap(image5_data) - self.image6 = QPixmap(image6_data) + self.image0 = TQPixmap(image0_data) + self.image1 = TQPixmap(image1_data) + self.image2 = TQPixmap(image2_data) + self.image3 = TQPixmap(image3_data) + self.image4 = TQPixmap(image4_data) + self.image5 = TQPixmap(image5_data) + self.image6 = TQPixmap(image6_data) if not name: self.setName("MainWindow") - self.setCentralWidget(QWidget(self,"qt_central_widget")) - MainWindowLayout = QHBoxLayout(self.centralWidget(),0,6,"MainWindowLayout") + self.setCentralWidget(TQWidget(self,"qt_central_widget")) + MainWindowLayout = TQHBoxLayout(self.centralWidget(),0,6,"MainWindowLayout") - self.Frame3 = QFrame(self.centralWidget(),"Frame3") - self.Frame3.setFrameShape(QFrame.StyledPanel) - self.Frame3.setFrameShadow(QFrame.Sunken) - Frame3Layout = QVBoxLayout(self.Frame3,1,0,"Frame3Layout") + self.Frame3 = TQFrame(self.centralWidget(),"Frame3") + self.Frame3.setFrameShape(TQFrame.StyledPanel) + self.Frame3.setFrameShadow(TQFrame.Sunken) + Frame3Layout = TQVBoxLayout(self.Frame3,1,0,"Frame3Layout") - self.WebBrowser = QAxWidget(self.Frame3,"WebBrowser") + self.WebBrowser = TQAxWidget(self.Frame3,"WebBrowser") self.WebBrowser.setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}") - self.WebBrowser.setFocusPolicy(QAxWidget.StrongFocus) + self.WebBrowser.setFocusPolicy(TQAxWidget.StrongFocus) Frame3Layout.addWidget(self.WebBrowser) MainWindowLayout.addWidget(self.Frame3) - self.actionGo = QAction(self,"actionGo") - self.actionGo.setIconSet(QIconSet(self.image0)) - self.actionBack = QAction(self,"actionBack") - self.actionBack.setIconSet(QIconSet(self.image1)) - self.actionForward = QAction(self,"actionForward") - self.actionForward.setIconSet(QIconSet(self.image2)) - self.actionStop = QAction(self,"actionStop") - self.actionStop.setIconSet(QIconSet(self.image3)) - self.actionRefresh = QAction(self,"actionRefresh") - self.actionRefresh.setIconSet(QIconSet(self.image4)) - self.actionHome = QAction(self,"actionHome") - self.actionHome.setIconSet(QIconSet(self.image5)) - self.actionFileClose = QAction(self,"actionFileClose") - self.FileNewGroup = QActionGroup(self,"FileNewGroup") + self.actionGo = TQAction(self,"actionGo") + self.actionGo.setIconSet(TQIconSet(self.image0)) + self.actionBack = TQAction(self,"actionBack") + self.actionBack.setIconSet(TQIconSet(self.image1)) + self.actionForward = TQAction(self,"actionForward") + self.actionForward.setIconSet(TQIconSet(self.image2)) + self.actionStop = TQAction(self,"actionStop") + self.actionStop.setIconSet(TQIconSet(self.image3)) + self.actionRefresh = TQAction(self,"actionRefresh") + self.actionRefresh.setIconSet(TQIconSet(self.image4)) + self.actionHome = TQAction(self,"actionHome") + self.actionHome.setIconSet(TQIconSet(self.image5)) + self.actionFileClose = TQAction(self,"actionFileClose") + self.FileNewGroup = TQActionGroup(self,"FileNewGroup") self.FileNewGroup.setUsesDropDown(1) - self.actionNewWindow = QAction(self.FileNewGroup,"actionNewWindow") - self.actionSearch = QAction(self,"actionSearch") - self.actionSearch.setIconSet(QIconSet(self.image6)) - self.actionAbout = QAction(self,"actionAbout") - self.actionAboutQt = QAction(self,"actionAboutQt") + self.actionNewWindow = TQAction(self.FileNewGroup,"actionNewWindow") + self.actionSearch = TQAction(self,"actionSearch") + self.actionSearch.setIconSet(TQIconSet(self.image6)) + self.actionAbout = TQAction(self,"actionAbout") + self.actionAboutTQt = TQAction(self,"actionAboutTQt") - self.Toolbar = QToolBar(QString(""),self,Qt.DockTop) + self.Toolbar = TQToolBar(TQString(""),self,TQt.DockTop) self.actionBack.addTo(self.Toolbar) self.actionForward.addTo(self.Toolbar) @@ -970,37 +970,37 @@ class MainWindow(QMainWindow): self.actionHome.addTo(self.Toolbar) self.Toolbar.addSeparator() self.actionSearch.addTo(self.Toolbar) - self.Toolbar_2 = QToolBar(QString(""),self,Qt.DockTop) + self.Toolbar_2 = TQToolBar(TQString(""),self,TQt.DockTop) self.Toolbar_2.setHorizontallyStretchable(1) - self.lblAddress = QLabel(self.Toolbar_2,"lblAddress") + self.lblAddress = TQLabel(self.Toolbar_2,"lblAddress") - self.addressEdit = QLineEdit(self.Toolbar_2,"addressEdit") + self.addressEdit = TQLineEdit(self.Toolbar_2,"addressEdit") self.actionGo.addTo(self.Toolbar_2) - self.menubar = QMenuBar(self,"menubar") + self.menubar = TQMenuBar(self,"menubar") - self.PopupMenu = QPopupMenu(self) - self.FileNewGroup_2 = QPopupMenu(self) - self.PopupMenu.setAccel(QString.null,self.PopupMenu.insertItem(self.FileNewGroup.iconSet(),self.__tr("New"),self.FileNewGroup_2)) + self.PopupMenu = TQPopupMenu(self) + self.FileNewGroup_2 = TQPopupMenu(self) + self.PopupMenu.setAccel(TQString.null,self.PopupMenu.insertItem(self.FileNewGroup.iconSet(),self.__tr("New"),self.FileNewGroup_2)) self.actionNewWindow.addTo(self.FileNewGroup_2) self.PopupMenu.insertSeparator() self.actionFileClose.addTo(self.PopupMenu) - self.menubar.insertItem(QString(""),self.PopupMenu,1) + self.menubar.insertItem(TQString(""),self.PopupMenu,1) - self.unnamed = QPopupMenu(self) + self.unnamed = TQPopupMenu(self) self.actionAbout.addTo(self.unnamed) - self.actionAboutQt.addTo(self.unnamed) - self.menubar.insertItem(QString(""),self.unnamed,2) + self.actionAboutTQt.addTo(self.unnamed) + self.menubar.insertItem(TQString(""),self.unnamed,2) self.languageChange() - self.resize(QSize(812,605).expandedTo(self.minimumSizeHint())) - self.clearWState(Qt.WState_Polished) + self.resize(TQSize(812,605).expandedTo(self.minimumSizeHint())) + self.clearWState(TQt.WState_Polished) self.connect(self.actionHome,SIGNAL("activated()"),self.WebBrowser,SLOT("GoHome()")) self.connect(self.actionRefresh,SIGNAL("activated()"),self.WebBrowser,SLOT("Refresh()")) @@ -1011,21 +1011,21 @@ class MainWindow(QMainWindow): self.connect(self.actionFileClose,SIGNAL("activated()"),self.close) self.connect(self.actionSearch,SIGNAL("activated()"),self.WebBrowser,SLOT("GoSearch()")) self.connect(self.addressEdit,SIGNAL("returnPressed()"),self.go) - self.connect(self.WebBrowser,SIGNAL("NavigateComplete(const QString&)"),self.addressEdit.setText) - self.connect(self.WebBrowser,SIGNAL("TitleChange(const QString&)"),self.setTitle) - self.connect(self.WebBrowser,SIGNAL("NavigateComplete(const QString&)"),self.navigateComplete) + self.connect(self.WebBrowser,SIGNAL("NavigateComplete(const TQString&)"),self.addressEdit.setText) + self.connect(self.WebBrowser,SIGNAL("TitleChange(const TQString&)"),self.setTitle) + self.connect(self.WebBrowser,SIGNAL("NavigateComplete(const TQString&)"),self.navigateComplete) self.connect(self.WebBrowser,SIGNAL("CommandStateChange(int,bool)"),self.setCommandState) - self.connect(self.WebBrowser,SIGNAL("BeforeNavigate(const QString&,int,const QString&,const QVariant&,const QString&,bool&)"),self.navigateBegin) + self.connect(self.WebBrowser,SIGNAL("BeforeNavigate(const TQString&,int,const TQString&,const TQVariant&,const TQString&,bool&)"),self.navigateBegin) self.connect(self.actionStop,SIGNAL("activated()"),self.navigateComplete) self.connect(self.actionNewWindow,SIGNAL("activated()"),self.newWindow) self.connect(self.actionAbout,SIGNAL("activated()"),self.aboutSlot) - self.connect(self.actionAboutQt,SIGNAL("activated()"),self.aboutQtSlot) + self.connect(self.actionAboutTQt,SIGNAL("activated()"),self.aboutTQtSlot) self.init() def languageChange(self): - self.setCaption(self.__tr("Qt WebBrowser")) + self.setCaption(self.__tr("TQt WebBrowser")) self.WebBrowser.setControl(self.__tr("{8856F961-340A-11D0-A96B-00C04FD705A2}")) self.actionGo.setText(self.__tr("Go")) self.actionGo.setMenuText(self.__tr("Go")) @@ -1051,8 +1051,8 @@ class MainWindow(QMainWindow): self.actionSearch.setMenuText(self.__tr("Search")) self.actionAbout.setText(self.__tr("About")) self.actionAbout.setMenuText(self.__tr("About")) - self.actionAboutQt.setText(self.__tr("About Qt")) - self.actionAboutQt.setMenuText(self.__tr("About Qt")) + self.actionAboutTQt.setText(self.__tr("About TQt")) + self.actionAboutTQt.setMenuText(self.__tr("About TQt")) self.Toolbar.setLabel(self.__tr("Toolbar")) self.Toolbar_2.setLabel(self.__tr("Toolbar_2")) self.lblAddress.setText(self.__tr("Address")) @@ -1076,7 +1076,7 @@ class MainWindow(QMainWindow): pass def setTitle(self,a0): - print "MainWindow.setTitle(const QString&): Not implemented yet" + print "MainWindow.setTitle(const TQString&): Not implemented yet" def setCommandState(self,a0,a1): print "MainWindow.setCommandState(int,bool): Not implemented yet" @@ -1090,8 +1090,8 @@ class MainWindow(QMainWindow): def aboutSlot(self): print "MainWindow.aboutSlot(): Not implemented yet" - def aboutQtSlot(self): - print "MainWindow.aboutQtSlot(): Not implemented yet" + def aboutTQtSlot(self): + print "MainWindow.aboutTQtSlot(): Not implemented yet" def __tr(self,s,c = None): return qApp.translate("MainWindow",s,c) diff --git a/examples3/webbrowser/mainwindow.ui b/examples3/webbrowser/mainwindow.ui index 1689e8a..ec38e1c 100644 --- a/examples3/webbrowser/mainwindow.ui +++ b/examples3/webbrowser/mainwindow.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1">
<class>MainWindow</class>
-<widget class="QMainWindow">
+<widget class="TQMainWindow">
<property name="name">
<cstring>MainWindow</cstring>
</property>
@@ -13,7 +13,7 @@ </rect>
</property>
<property name="caption">
- <string>Qt WebBrowser</string>
+ <string>TQt WebBrowser</string>
</property>
<hbox>
<property name="name">
@@ -25,7 +25,7 @@ <property name="spacing">
<number>6</number>
</property>
- <widget class="QFrame">
+ <widget class="TQFrame">
<property name="name">
<cstring>Frame3</cstring>
</property>
@@ -45,7 +45,7 @@ <property name="spacing">
<number>0</number>
</property>
- <widget class="QAxWidget">
+ <widget class="TQAxWidget">
<property name="name">
<cstring>WebBrowser</cstring>
</property>
@@ -74,7 +74,7 @@ </item>
<item text="&Help" name="unnamed">
<action name="actionAbout"/>
- <action name="actionAboutQt"/>
+ <action name="actionAboutTQt"/>
</item>
</menubar>
<toolbars>
@@ -103,7 +103,7 @@ <property name="label">
<string>Toolbar_2</string>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>lblAddress</cstring>
</property>
@@ -111,7 +111,7 @@ <string>Address</string>
</property>
</widget>
- <widget class="QLineEdit">
+ <widget class="TQLineEdit">
<property name="name">
<cstring>addressEdit</cstring>
</property>
@@ -245,10 +245,10 @@ </action>
<action>
<property name="name">
- <cstring>actionAboutQt</cstring>
+ <cstring>actionAboutTQt</cstring>
</property>
<property name="text">
- <string>About Qt</string>
+ <string>About TQt</string>
</property>
</action>
</actions>
@@ -332,19 +332,19 @@ </connection>
<connection>
<sender>WebBrowser</sender>
- <signal>NavigateComplete(const QString&)</signal>
+ <signal>NavigateComplete(const TQString&)</signal>
<receiver>addressEdit</receiver>
- <slot>setText(const QString&)</slot>
+ <slot>setText(const TQString&)</slot>
</connection>
<connection>
<sender>WebBrowser</sender>
- <signal>TitleChange(const QString&)</signal>
+ <signal>TitleChange(const TQString&)</signal>
<receiver>MainWindow</receiver>
- <slot>setTitle(const QString&)</slot>
+ <slot>setTitle(const TQString&)</slot>
</connection>
<connection>
<sender>WebBrowser</sender>
- <signal>NavigateComplete(const QString&)</signal>
+ <signal>NavigateComplete(const TQString&)</signal>
<receiver>MainWindow</receiver>
<slot>navigateComplete()</slot>
</connection>
@@ -356,7 +356,7 @@ </connection>
<connection>
<sender>WebBrowser</sender>
- <signal>BeforeNavigate(const QString&,int,const QString&,const QVariant&,const QString&,bool&)</signal>
+ <signal>BeforeNavigate(const TQString&,int,const TQString&,const TQVariant&,const TQString&,bool&)</signal>
<receiver>MainWindow</receiver>
<slot>navigateBegin()</slot>
</connection>
@@ -379,29 +379,29 @@ <slot>aboutSlot()</slot>
</connection>
<connection>
- <sender>actionAboutQt</sender>
+ <sender>actionAboutTQt</sender>
<signal>activated()</signal>
<receiver>MainWindow</receiver>
- <slot>aboutQtSlot()</slot>
+ <slot>aboutTQtSlot()</slot>
</connection>
</connections>
<forwards>
- <forward>class QProgressBar</forward>
+ <forward>class TQProgressBar</forward>
</forwards>
<variables>
- <variable>QProgressBar *pb;</variable>
+ <variable>TQProgressBar *pb;</variable>
</variables>
<slots>
<slot>go()</slot>
<slot>newWindow()</slot>
<slot>setProgress( int a, int b )</slot>
<slot>init()</slot>
- <slot>setTitle( const QString & title )</slot>
+ <slot>setTitle( const TQString & title )</slot>
<slot>setCommandState( int cmd, bool on )</slot>
<slot>navigateComplete()</slot>
<slot>navigateBegin()</slot>
<slot>aboutSlot()</slot>
- <slot>aboutQtSlot()</slot>
+ <slot>aboutTQtSlot()</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
diff --git a/examples3/webbrowser/webbrowser.py b/examples3/webbrowser/webbrowser.py index bd1462e..17155b4 100644 --- a/examples3/webbrowser/webbrowser.py +++ b/examples3/webbrowser/webbrowser.py @@ -1,7 +1,7 @@ # Copyright (C) 2001-2002 Trolltech AS. All rights reserved. # Copyright (C) 2004 Riverbank Computing Ltd. All rights reserved. # -# This file is part of an example program for the ActiveQt integration. +# This file is part of an example program for the ActiveTQt integration. # This example program may be used, distributed and modified without # limitation. @@ -15,13 +15,13 @@ import mainwindow class MainWindowImpl(mainwindow.MainWindow): def init(self): - self.pb = qt.QProgressBar(self.statusBar()) + self.pb = qt.TQProgressBar(self.statusBar()) self.pb.setPercentageVisible(False) self.pb.hide() self.statusBar().addWidget(self.pb, 0, True) self.connect(self.WebBrowser, qt.SIGNAL("ProgressChange(int,int)"), self.setProgress) - self.connect(self.WebBrowser, qt.SIGNAL("StatusTextChange(const QString&)"), self.statusBar(), qt.SLOT("message(const QString&)")) + self.connect(self.WebBrowser, qt.SIGNAL("StatusTextChange(const TQString&)"), self.statusBar(), qt.SLOT("message(const TQString&)")) self.WebBrowser.dynamicCall("GoHome()"); @@ -29,10 +29,10 @@ class MainWindowImpl(mainwindow.MainWindow): def go(self): self.actionStop.setEnabled(True) - self.WebBrowser.dynamicCall("Navigate(const QString&)", qt.QVariant(self.addressEdit.text())) + self.WebBrowser.dynamicCall("Navigate(const TQString&)", qt.TQVariant(self.addressEdit.text())) def setTitle(self, title): - self.setCaption("Qt WebBrowser - " + title.latin1()) + self.setCaption("TQt WebBrowser - " + title.latin1()) def setProgress(self, a, b): if a <= 0 or b <= 0: @@ -69,17 +69,17 @@ class MainWindowImpl(mainwindow.MainWindow): self.subwindows += window def aboutSlot(self): - qt.QMessageBox.about(self, self.tr("About WebBrowser"), self.tr( -"""This Example has been created using the ActiveQt integration into Qt Designer. -It demonstrates the use of QAxWidget to embed the Internet Explorer ActiveX -control into a Qt application.""")) + qt.TQMessageBox.about(self, self.tr("About WebBrowser"), self.tr( +"""This Example has been created using the ActiveTQt integration into TQt Designer. +It demonstrates the use of TQAxWidget to embed the Internet Explorer ActiveX +control into a TQt application.""")) - def aboutQtSlot(self): - qt.QMessageBox.aboutQt(self, self.tr("About Qt")) + def aboutTQtSlot(self): + qt.TQMessageBox.aboutTQt(self, self.tr("About TQt")) def main(args): - a = qt.QApplication(args) + a = qt.TQApplication(args) w = MainWindowImpl() a.setMainWidget(w) w.show() diff --git a/examples3/widgets.py b/examples3/widgets.py index 470f24e..c0927b2 100755 --- a/examples3/widgets.py +++ b/examples3/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,42 +125,42 @@ 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 ) # 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 ) @@ -176,63 +176,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] ) @@ -241,44 +241,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 ) @@ -287,24 +287,24 @@ 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.setTickInterval( 10 ) - self.sb.setFocusPolicy( QWidget.TabFocus ) + self.sb.setFocusPolicy( TQWidget.TabFocus ) 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" ) @@ -313,10 +313,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" ) @@ -324,50 +324,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 ) @@ -383,24 +383,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() @@ -412,13 +412,13 @@ 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" ) @@ -450,18 +450,18 @@ class WidgetView ( QWidget ): def comboBoxItemActivated( self, index ): self.msg.setText( "Combo box item %d activated" % index ) - p = QApplication.palette() + p = TQApplication.palette() if index == 0: - p.setColor( QColorGroup.Highlight, Qt.darkBlue ) + p.setColor( TQColorGroup.Highlight, TQt.darkBlue ) elif index == 1: - p.setColor( QColorGroup.Highlight, Qt.darkRed ) + p.setColor( TQColorGroup.Highlight, TQt.darkRed ) elif index == 2: - p.setColor( QColorGroup.Highlight, Qt.darkGreen ) + p.setColor( TQColorGroup.Highlight, TQt.darkGreen ) elif index == 3: - p.setColor( QColorGroup.Highlight, Qt.blue ) + p.setColor( TQColorGroup.Highlight, TQt.blue ) elif index == 4: - p.setColor( QColorGroup.Highlight, Qt.red ) - QApplication.setPalette( p, TRUE ) + p.setColor( TQColorGroup.Highlight, TQt.red ) + TQApplication.setPalette( p, TRUE ) def lineEditTextChanged( self, newText ): self.msg.setText("Line edit text: " + unicode(newText)) @@ -475,24 +475,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 ) |