diff options
Diffstat (limited to 'examples3/i18n/i18n.py')
-rwxr-xr-x | examples3/i18n/i18n.py | 34 |
1 files changed, 17 insertions, 17 deletions
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() |