"task_btn": 1, "publish_btn": 2, "chat_btn": 3 } sender = self.tab_btn_grp.checkedButton() page_index = page_dict.get(sender.objectName()) self.work_stack.setCurrentIndex(page_index) def mousePressEvent(obj, event): super(obj.__class__, obj).mousePressEvent(event) obj.last_clicked_pos = (event.globalPos(), QtCore.QPoint(obj.main_dialog.pos())) def mouseMoveEvent(obj, event): if obj.last_clicked_pos: move, begin = obj.last_clicked_pos obj.main_dialog.move((event.globalPos() - move) + begin) else: super(obj.__class__, obj).mouseMoveEvent(event) def mouseReleaseEvent(obj, event): super(obj.__class__, obj).mouseReleaseEvent(event) obj.last_clicked_pos = None if __name__ == "__main__": cgtk_qt.render_gui(MainUI)
def call_mainUI(self): app = QtGui.QApplication.instance() self.main_window = cgtk_qt.render_gui(GUIClass=main_ui.MainUI, app=app, style="strack_main", singleton=True)
def call_script_editor(self): app = QtGui.QApplication.instance() cgtk_qt.render_gui(GUIClass=scriptEditor.scriptEditorClass, app=app, singleton=True) def call_mainUI(self): app = QtGui.QApplication.instance() self.main_window = cgtk_qt.render_gui(GUIClass=main_ui.MainUI, app=app, style="strack_main", singleton=True) def call_configUI(self): # todo: show config UI print "show config UI here..." def call_helpUI(self): # todo: show config UI print "show help UI here..." def call_feedbackUI(self): # todo: show config UI print "show feedback UI here..." if __name__ == '__main__': import standalone_env cgtk_qt.render_gui(StrackTrayIcon)
def call_script_editor(self): app = QtGui.QApplication.instance() cgtk_qt.render_gui(GUIClass=scriptEditor.scriptEditorClass, app=app, singleton=True)
# coding=utf8 import os import Qt.QtGui as QtGui import cgtk_qt current_dir = os.path.dirname(__file__) UI = os.path.join(current_dir, "chat.ui") FormClass, BaseClass = cgtk_qt.load_ui_type(UI) class ChatUI(FormClass, BaseClass): def __init__(self, parent=None): super(ChatUI, self).__init__(parent) # setup ui self.setupUi(self) if __name__ == "__main__": cgtk_qt.render_gui(ChatUI)