diff options
Diffstat (limited to 'examples3/SQL/dbconnect.py')
-rwxr-xr-x | examples3/SQL/dbconnect.py | 20 |
1 files changed, 10 insertions, 10 deletions
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: |