diff options
author | Slávek Banko <[email protected]> | 2023-01-23 15:51:24 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2023-01-23 15:51:24 +0100 |
commit | 21c6548234338921fe97ec67148e9fa753c694b4 (patch) | |
tree | 3432057bff20868f762ffe12fe42924be193dce4 /lib/kross/python | |
parent | 86480e58eafc1fa3486e03155ed34e02b4595a24 (diff) | |
download | koffice-21c6548234338921fe97ec67148e9fa753c694b4.tar.gz koffice-21c6548234338921fe97ec67148e9fa753c694b4.zip |
Update after renaming qt => tqt in PyTQt module.
Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'lib/kross/python')
-rwxr-xr-x | lib/kross/python/scripts/gui.py | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/lib/kross/python/scripts/gui.py b/lib/kross/python/scripts/gui.py index 693261dd..aa4dc986 100755 --- a/lib/kross/python/scripts/gui.py +++ b/lib/kross/python/scripts/gui.py @@ -184,64 +184,64 @@ class TQtDialog: """ This class is used to wrap PyTQt/PyTDE into a more abstract interface.""" def __init__(self, title): - from TQt import qt + from TQt import tqt - 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 - self.layout = qt.TQVBoxLayout(self) + tqt.TQDialog.__init__(self, parent, name, modal, fl) + tqt.TQDialog.accept = self.accept + self.layout = tqt.TQVBoxLayout(self) self.layout.setSpacing(6) self.layout.setMargin(11) - class Label(qt.TQLabel): + class Label(tqt.TQLabel): def __init__(self, dialog, parent, caption): - qt.TQLabel.__init__(self, parent) + tqt.TQLabel.__init__(self, parent) self.setText("<qt>%s</qt>" % caption.replace("\n","<br>")) - class Frame(qt.TQHBox): + class Frame(tqt.TQHBox): def __init__(self, dialog, parent): - qt.TQHBox.__init__(self, parent) + tqt.TQHBox.__init__(self, parent) self.widget = self self.setSpacing(6) - class Edit(qt.TQHBox): + class Edit(tqt.TQHBox): def __init__(self, dialog, parent, caption, text): - qt.TQHBox.__init__(self, parent) + tqt.TQHBox.__init__(self, parent) self.setSpacing(6) - label = qt.TQLabel(caption, self) - self.edit = qt.TQLineEdit(self) + label = tqt.TQLabel(caption, self) + self.edit = tqt.TQLineEdit(self) self.edit.setText( str(text) ) self.setStretchFactor(self.edit, 1) label.setBuddy(self.edit) def get(self): return self.edit.text() - class Button(qt.TQPushButton): + class Button(tqt.TQPushButton): #def __init__(self, *args): def __init__(self, dialog, parent, caption, commandmethod): - #apply(qt.TQPushButton.__init__, (self,) + args) - qt.TQPushButton.__init__(self, parent) + #apply(tqt.TQPushButton.__init__, (self,) + args) + tqt.TQPushButton.__init__(self, parent) self.commandmethod = commandmethod self.setText(caption) - qt.TQObject.connect(self, qt.SIGNAL("clicked()"), self.commandmethod) + tqt.TQObject.connect(self, tqt.SIGNAL("clicked()"), self.commandmethod) - class CheckBox(qt.TQCheckBox): + class CheckBox(tqt.TQCheckBox): def __init__(self, dialog, parent, caption, checked = True): #TkDialog.Widget.__init__(self, dialog, parent) - qt.TQCheckBox.__init__(self, parent) + tqt.TQCheckBox.__init__(self, parent) self.setText(caption) self.setChecked(checked) #def isChecked(self): # return self.isChecked() - class List(qt.TQHBox): + class List(tqt.TQHBox): def __init__(self, dialog, parent, caption, items): - qt.TQHBox.__init__(self, parent) + tqt.TQHBox.__init__(self, parent) self.setSpacing(6) - label = qt.TQLabel(caption, self) - self.combo = qt.TQComboBox(self) + label = tqt.TQLabel(caption, self) + self.combo = tqt.TQComboBox(self) self.setStretchFactor(self.combo, 1) label.setBuddy(self.combo) for item in items: @@ -251,24 +251,24 @@ class TQtDialog: def set(self, index): self.combo.setCurrentItem(index) - class FileChooser(qt.TQHBox): + class FileChooser(tqt.TQHBox): def __init__(self, dialog, parent, caption, initialfile = None, filetypes = None): - #apply(qt.TQHBox.__init__, (self,) + args) - qt.TQHBox.__init__(self, parent) + #apply(tqt.TQHBox.__init__, (self,) + args) + tqt.TQHBox.__init__(self, parent) self.setMinimumWidth(400) self.initialfile = initialfile self.filetypes = filetypes self.setSpacing(6) - label = qt.TQLabel(caption, self) - self.edit = qt.TQLineEdit(self) + label = tqt.TQLabel(caption, self) + self.edit = tqt.TQLineEdit(self) self.edit.setText(self.initialfile) self.setStretchFactor(self.edit, 1) label.setBuddy(self.edit) browsebutton = Button(dialog, self, "...", self.browseButtonClicked) - #qt.TQObject.connect(browsebutton, qt.SIGNAL("clicked()"), self.browseButtonClicked) + #tqt.TQObject.connect(browsebutton, tqt.SIGNAL("clicked()"), self.browseButtonClicked) def get(self): return self.edit.text() @@ -294,9 +294,9 @@ class TQtDialog: import tdefile filename = tdefile.KFileDialog.getOpenFileName(self.initialfile, filtermask, self, "Save to file") except: - print("TQtDialog.FileChooser.browseButtonClicked() qt.TQFileDialog") + print("TQtDialog.FileChooser.browseButtonClicked() tqt.TQFileDialog") # fallback to TQt filedialog - filename = qt.TQFileDialog.getOpenFileName(self.initialfile, filtermask, self, "Save to file") + filename = tqt.TQFileDialog.getOpenFileName(self.initialfile, filtermask, self, "Save to file") if filename != None and filename != "": self.edit.setText(filename) @@ -309,19 +309,19 @@ class TQtDialog: def show(self): result = 1 if self.typename == "okcancel": - result = qt.TQMessageBox.question(self.widget, self.caption, self.message, "&Ok", "&Cancel", "", 1) + result = tqt.TQMessageBox.question(self.widget, self.caption, self.message, "&Ok", "&Cancel", "", 1) else: - qt.TQMessageBox.information(self.widget, self.caption, self.message, "&Ok") + tqt.TQMessageBox.information(self.widget, self.caption, self.message, "&Ok") result = 0 if result == 0: return True return False - self.app = qt.tqApp - self.dialog = Dialog(self.app.mainWidget(), "Dialog", 1, qt.TQt.WDestructiveClose) + self.app = tqt.tqApp + self.dialog = Dialog(self.app.mainWidget(), "Dialog", 1, tqt.TQt.WDestructiveClose) self.dialog.setCaption(title) - self.widget = qt.TQVBox(self.dialog) + self.widget = tqt.TQVBox(self.dialog) self.widget.setSpacing(6) self.dialog.layout.addWidget(self.widget) @@ -335,10 +335,10 @@ class TQtDialog: self.MessageBox = MessageBox def show(self): - from TQt import qt - qt.TQApplication.setOverrideCursor(qt.TQt.arrowCursor) + from TQt import tqt + tqt.TQApplication.setOverrideCursor(tqt.TQt.arrowCursor) self.dialog.exec_loop() - qt.TQApplication.restoreOverrideCursor() + tqt.TQApplication.restoreOverrideCursor() def close(self): print("TQtDialog.close()") |