def __init__(self, parent=None): QtWidgets.QMainWindow.__init__(self, parent) self.ui = Ui_MainWindow() self.setup_ui() self.ui.screen.set_disconnect_callback(self.on_disconnected) self.setup_signal() self.cap_screen = None self.queue = multiprocessing.Queue() self.starting_dialog = None self.timer = None self.check_code = -1 self.recording = False self.record_frames = [] self.record_timer = QtCore.QTimer() self.record_timer.timeout.connect(self.on_record_timeout) self.mini_cap_head = None self.ipc = None # 是否连接过本地手机 self.cap_used = False self.is_first_start = True self.customer_running = False self.device_name = "" self.angle = 0 self.virtual_width = config.DEFAULT_WIDTH self.rotation_watcher = None self.share_proc = None self.share_val = multiprocessing.Value("i", 0) self.frame_timer = None self.frame_queue = deque() self.donate_scene = QtWidgets.QGraphicsScene(self) self.donate_view = QtWidgets.QGraphicsView(self.donate_scene) self.donate_view.setWindowTitle(_("Donate")) self.donate_scene.addItem(QtWidgets.QGraphicsPixmapItem(QtGui.QPixmap(":/app/icons/app/donate.jpg")))
def __init__(self, configDb): # self.obeyResize = False self.servers = [] self.configDb = configDb QMainWindow.__init__(self) mainWindow = Ui_MainWindow() mainWindow.setupUi(self) databaseInfoTable = mainWindow.databaseInfoTable mainWindow.databaseTree.currentItemChanged.connect( self.updateDatabaseTreeSelection) # 左侧数据库Tree展开处理 mainWindow.databaseTree.itemExpanded.connect( self.databaseTreeItemExpanded) databaseInfoTable.horizontalHeader().sectionResized.connect( self.databaseTreeColumnResized) # mainWindow.txtStatus.setTextColor(QColor('darkBlue')) mainWindow.twMachineTabs.removeTab( mainWindow.twMachineTabs.indexOf(mainWindow.databaseTab)) mainWindow.twMachineTabs.removeTab( mainWindow.twMachineTabs.indexOf(mainWindow.tableTab)) mainWindow.tableInfoTable.mainApplicationWindow = self # self.logHighlighter = MysqlSyntaxHighlighter(mainWindow.txtStatus.document()) self.mainWindow = mainWindow # self.restoreSizePreferences() self.show() self.tableTab = TableTab(self) self.databaseTab = DatabaseTab(self) self.closeEvent = self.onClose
def __init__(self): super(MainWindow, self).__init__() self.ui = Ui_MainWindow() self.ui.setupUi(self) self.logger = logging.getLogger() self.strl = [] self.connectSlots() self.show()
def __init__(self, configDb): self.obeyResize = False self.servers = [] self.configDb = configDb QMainWindow.__init__(self) mainWindow = Ui_MainWindow() mainWindow.setupUi(self) databaseInfoTable = mainWindow.databaseInfoTable mainWindow.actionRefresh.activated.connect(self.actionRefresh) mainWindow.databaseTree.currentItemChanged.connect( self.updateDatabaseTreeSelection) databaseInfoTable.horizontalHeader().sectionResized.connect( self.databaseTreeColumnResized) mainWindow.databaseTree.itemExpanded.connect( self.databaseTreeItemExpanded) mainWindow.txtStatus.setTextColor(QColor('darkBlue')) mainWindow.twMachineTabs.removePage(mainWindow.databaseTab) mainWindow.twMachineTabs.removePage(mainWindow.tableTab) mainWindow.tableInfoTable.mainApplicationWindow = self # mainWindow.txtStatus.append("# Single Comment") # mainWindow.txtStatus.append("/* Multi\nLine Comment") # mainWindow.txtStatus.append("*/") # mainWindow.txtStatus.append("SHOW CREATE TABLE FOR `apiclarify`.`facepalm`;") # mainWindow.txtStatus.append("/* multi-line\n commentz */ SHOW CREATE TABLE FOR `apiclarify`.`facepalm`;") # mainWindow.txtStatus.append("/* comment */ SHOW CREATE TABLE FOR `apiclarify`.`facepalm`; /* commentz */") # mainWindow.txtStatus.append("/* comment SHOW CREATE TABLE FOR `apiclarify`.`facepalm`; commentz */") # mainWindow.txtStatus.append("/* comment \nSHOW CREATE TABLE FOR `apiclarify`.`facepalm`; commentz */") # mainWindow.txtStatus.append("SELECT * FROM test_command;") # mainWindow.txtStatus.append("SHOW TABLE STATUS; # Inline comment") # mainWindow.txtStatus.append("/* comment */ SHOW DATABASES; /* commentz */") # mainWindow.txtStatus.append("SHOW DATABASEN; /* start multiline") # mainWindow.txtStatus.append("commenting */") # mainWindow.txtStatus.append('SELECT * FROM facepalm; /* i can haz comment? */') self.logHighlighter = MysqlSyntaxHighlighter( mainWindow.txtStatus.document()) self.mainWindow = mainWindow self.restoreSizePreferences() self.show() self.tableTab = TableTab(self) self.databaseTab = DatabaseTab(self) self.closeEvent = self.onClose databaseInfoTable.setContextMenuPolicy(Qt.CustomContextMenu) databaseInfoTable.customContextMenuRequested.connect( self.databaseContextMenu)
def __init__(self, parent=None): QtWidgets.QMainWindow.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.data_root = "dtpdata" self.year = "" self.month = "" self.reg_code = "" self.ui.tableWidget.setHorizontalHeaderLabels([ "Дата", "ДТП Район", "Вид ДТП", "Погибло", "Ранено", "Кол-во ТС", "Кол-во уч." ]) # Установить текущий год self.ui.spinBox_year.setValue(datetime.now().year) # Установить список месяцев months = [""] months.extend([str(x) for x in range(1, 13)]) self.ui.comboBox_month.insertItems(0, months) if os.path.isfile(regions_json_filename): self.ui.comboBox_regcode.insertItems(0, self.get_combobox_regions()) else: msg = "Необходимо обновить справочник кодов регионов." self.statusBar().showMessage(msg) self.ui.pushButton.setDisabled(True) self.ui.action_Start.setDisabled(True) # a figure instance to plot on self.figure = plt.figure() # self.figure = matplotlib.pyplot.figure() # this is the Canvas Widget that displays the `figure` # it takes the `figure` instance as a parameter to __init__ self.canvas = FigureCanvas(self.figure) # this is the Navigation widget # it takes the Canvas widget and a parent # self.toolbar = NavigationToolbar(self.canvas, self) # Just some button connected to `plot` method # self.button.clicked.connect(self.plot) self.ui.verticalLayout_graph.addWidget(self.canvas)
def __init__(self): super(MainWindow, self).__init__() # Set up the user interface from Designer. self.ui = Ui_MainWindow() self.ui.setupUi(self) self.loadDataDialog = QFileDialog() self.loadDataDialog.setFileMode(QFileDialog.DirectoryOnly) self.loadDataDialog.setOption(QFileDialog.ShowDirsOnly, True) self.loadDataDialog.setAcceptMode(QFileDialog.AcceptOpen) self.loadDataDialog.fileSelected.connect(self.directorySelected) self.ui.loadDataButton.clicked.connect(self.loadDataDialog.show) self.ui.calculateButton.clicked.connect(self.calculateClicked) self.ui.actionAbout.triggered.connect(self.actionAboutTriggered)
def __init__(self): super(MainWindow, self).__init__() self.ui = Ui_MainWindow() self.ui.setupUi(self) # slot button self.ui.buttonCompte.clicked.connect(self.on_click_button_compte) QObject.connect(self.ui.actionClose, SIGNAL("triggered()"), self, SLOT('on_click_menu_button_close()')) QObject.connect(self.ui.actionOuvrir, SIGNAL("triggered()"), self, SLOT('on_click_menu_button_open()')) # widget self.comptepage = ComptePage() self.ui.stack.addWidget(self.comptepage) #default page self.ui.stack.setCurrentWidget(self.comptepage)
def __init__(self, parent=None): super().__init__(parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.worker = None self.DataVisualizer = DataVisualizer(self) self.addDockWidget(Qt.TopDockWidgetArea, self.DataVisualizer) self.boardControl = BoardControl(self) self.addDockWidget(Qt.BottomDockWidgetArea, self.boardControl) self.cmdline = CommandLineWidget(self) self.addDockWidget(Qt.BottomDockWidgetArea, self.cmdline) self.tabifyDockWidget(self.boardControl, self.cmdline) s = QSettings() if s.value("mainwindow/geometry") is not None: self.restoreGeometry(s.value("mainwindow/geometry")) self.restoreState(s.value("mainwindow/state")) # run loadState when the event loop starts QTimer.singleShot(0, self.loadState)
def __init__(self): super(MainWindow, self).__init__() self.ui = Ui_MainWindow() self.ui.setupUi(self)