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/SQL/sqlcustom1.py | |
parent | b388516ca2691303a076a0764fd40bf7116fe43d (diff) | |
download | pytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip |
Initial TQt conversion
Diffstat (limited to 'examples3/SQL/sqlcustom1.py')
-rwxr-xr-x | examples3/SQL/sqlcustom1.py | 34 |
1 files changed, 17 insertions, 17 deletions
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() |