diff options
Diffstat (limited to 'lib/kross/test/testgui.py')
-rw-r--r-- | lib/kross/test/testgui.py | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/lib/kross/test/testgui.py b/lib/kross/test/testgui.py index 0a3cf822..9c2747e8 100644 --- a/lib/kross/test/testgui.py +++ b/lib/kross/test/testgui.py @@ -37,37 +37,37 @@ class TkTest: class TQtTest: def __init__(self): - from TQt import qt + from TQt import tqt - class Button(qt.TQPushButton): + class Button(tqt.TQPushButton): def __init__(self, *args): - qt.TQPushButton.__init__(*(self,) + args) + tqt.TQPushButton.__init__(*(self,) + args) - class ComboBox(qt.TQHBox): + class ComboBox(tqt.TQHBox): def __init__(self, parent, caption, items = []): - qt.TQHBox.__init__(self, parent) + tqt.TQHBox.__init__(self, parent) self.setSpacing(6) - label = qt.TQLabel(str(caption), self) - self.combobox = qt.TQComboBox(self) + label = tqt.TQLabel(str(caption), self) + self.combobox = tqt.TQComboBox(self) self.setStretchFactor(self.combobox, 1) label.setBuddy(self.combobox) for item in items: self.combobox.insertItem( str(item) ) - class FileChooser(qt.TQHBox): + class FileChooser(tqt.TQHBox): def __init__(self, *args): - qt.TQHBox.__init__(*(self,) + args) + tqt.TQHBox.__init__(*(self,) + args) self.defaultfilename = "~/output.html" self.setSpacing(6) - label = qt.TQLabel("File:", self) - self.edit = qt.TQLineEdit(self) + label = tqt.TQLabel("File:", self) + self.edit = tqt.TQLineEdit(self) self.edit.setText(self.defaultfilename) self.setStretchFactor(self.edit, 1) label.setBuddy(self.edit) browsebutton = Button("...", self) - qt.TQObject.connect(browsebutton, qt.SIGNAL("clicked()"), self.browseButtonClicked) + tqt.TQObject.connect(browsebutton, tqt.SIGNAL("clicked()"), self.browseButtonClicked) def file(self): return self.edit.text() @@ -80,22 +80,22 @@ class TQtTest: filename = tdefile.KFileDialog.getOpenFileName(self.defaultfilename, "*.html", self, "Save to file") except: # fallback to TQt filedialog - filename = qt.TQFileDialog.getOpenFileName(self.defaultfilename, "*.html", self, "Save to file") + filename = tqt.TQFileDialog.getOpenFileName(self.defaultfilename, "*.html", self, "Save to file") if filename != None and filename != "": self.edit.setText(filename) - class Dialog(qt.TQDialog): + class Dialog(tqt.TQDialog): def __init__(self, parent = None, name = None, modal = 0, fl = 0): - qt.TQDialog.__init__(self, parent, name, modal, fl) - qt.TQDialog.accept = self.accept + tqt.TQDialog.__init__(self, parent, name, modal, fl) + tqt.TQDialog.accept = self.accept self.setCaption("Export to HTML") #self.layout() - self.layout = qt.TQVBoxLayout(self) + self.layout = tqt.TQVBoxLayout(self) self.layout.setSpacing(6) self.layout.setMargin(11) - infolabel = qt.TQLabel("Export the data of a table or a query to a HTML-file.", self) + infolabel = tqt.TQLabel("Export the data of a table or a query to a HTML-file.", self) self.layout.addWidget(infolabel) source = ComboBox(self, "Datasource:") @@ -107,21 +107,21 @@ class TQtTest: self.filechooser = FileChooser(self) self.layout.addWidget(self.filechooser) - buttonbox = qt.TQHBox(self) + buttonbox = tqt.TQHBox(self) buttonbox.setSpacing(6) self.layout.addWidget(buttonbox) savebutton = Button("Save", buttonbox) - qt.TQObject.connect(savebutton, qt.SIGNAL("clicked()"), self, qt.SLOT("accept()")) - #qt.TQObject.connect(savebutton, qt.SIGNAL("clicked()"), self.exportButtonClicked) + tqt.TQObject.connect(savebutton, tqt.SIGNAL("clicked()"), self, tqt.SLOT("accept()")) + #tqt.TQObject.connect(savebutton, tqt.SIGNAL("clicked()"), self.exportButtonClicked) cancelbutton = Button("Cancel", buttonbox) - qt.TQObject.connect(cancelbutton, qt.SIGNAL("clicked()"), self, qt.SLOT("close()")) + tqt.TQObject.connect(cancelbutton, tqt.SIGNAL("clicked()"), self, tqt.SLOT("close()")) def accept(self): print("ACCEPTTTTTTTT !!!!!!!!!!!!!!!!!!!!!!!!!!!!") - file = qt.TQFile( self.filechooser.file() ) + file = tqt.TQFile( self.filechooser.file() ) #if not file.exists(): # print "File '%s' does not exist." % self.filechooser.file() #else: @@ -137,9 +137,9 @@ class TQtTest: print("=> Dialog.event %s" % e) #self.deleteLater() #support.swapThreadState() # calls appropriate c-function - return qt.TQDialog.event(self, e) + return tqt.TQDialog.event(self, e) - app = qt.tqApp + app = tqt.tqApp dialog = Dialog(app.mainWidget(), "Dialog", 1) dialog.show() |