def __init__(self): super().__init__() self.process = None self.queNum = mp.Queue() self.queDoc = mp.Queue() self.page_count = 0 self.curPageNum = 0 self.lastDir = "" self.timerSend = QtCore.QTimer(self) self.timerSend.timeout.connect(self.onTimerSendPageNum) self.timerGet = QtCore.QTimer(self) self.timerGet.timeout.connect(self.onTimerGetPage) self.timerWaiting = QtCore.QTimer(self) self.timerWaiting.timeout.connect(self.onTimerWaiting) self.initUI()
def setup_ui(self): self.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) # update panel setting self.timer = QtCore.QTimer(parent=self) self.timer.timeout.connect(self.update_extra) self.cuesheet = [] for i in range(self.config.G_CUESHEET_DISPLAY_NUM): cuesheet_point_layout = CueSheetItem(self, self.config) self.cuesheet.append(cuesheet_point_layout) self.cuesheet_layout = QtWidgets.QVBoxLayout(self) self.cuesheet_layout.setContentsMargins(0, 0, 0, 0) self.cuesheet_layout.setSpacing(0) for c in self.cuesheet: self.cuesheet_layout.addLayout(c) self.setStyleSheet("\ border-width: 0px 0px 0px 1px; \ border-style: solid; \ border-color: #000000;") for i in range(len(self.cuesheet) - 1): self.cuesheet[i].name.setStyleSheet( self.cuesheet[i].name.styleSheet() + " QLabel {border-bottom: 1px solid #CCCCCC;}")
def __init__(self, config, parent=None): QtWidgets.QLabel.__init__(self, parent) self.config = config self.px = 0 self.py = 18 self.timer = QtCore.QTimer(self) self.timer.timeout.connect(self.update) self.timer_interval = 200 #[ms] self._speed = 5 self.textLength = 0
def __init__(self): super().__init__() self.setupUi(self) # self.server_url = server_url self.pushButton.pressed.connect(self.send_message) self.after = 0 self.timer = QtCore.QTimer() self.timer.timeout.connect(self.get_messages) self.timer.start(1000)
def __init__(self): super().__init__() self.setupUi(self) #to run on button click self.pushButton.pressed.connect(self.send_message) #to run by timer self.after = 0 self.timer = QtCore.QTimer() self.timer.timeout.connect(self.get_messages) self.timer.start(1000)
def __init__(self): super().__init__() self.setupUi(self) self.pushButton.pressed.connect(self.send_message) self.timer = QtCore.QTimer() self.timer.timeout.connect(self.get_messages) self.timer.start(1000) self.after = 0 # время последнего сообщения, после которого выводим новые self.server_address = 'http://127.0.0.1:5000'
def __init__(self, host='http://178.250.157.243:5000'): super().__init__() self.setupUi(self) self.host = host self.pushButton.pressed.connect(self.send_message) self.after = 0 self.timer = QtCore.QTimer() self.timer.timeout.connect(self.get_messages) self.timer.start(1000)
def __init__(self, host='127.0.0.1:5000'): super().__init__() self.setupUi(self) self.host = host self.pushButton.pressed.connect(self.send_message) self.after = 2 self.timer = QtCore.QTimer() self.timer.timeout.connect(self.get_messages) self.timer.start(1000)
def __init__(self, host='http://127.0.0.1:5000'): super().__init__() self.setupUi(self) self.host = host # to run on button click: self.pushButton.pressed.connect(self.send_message) # to run by timer: self.after = 0 self.timer = QtCore.QTimer() self.timer.timeout.connect(self.get_messages) self.timer.start(1000)
def __init__(self, server_url): super().__init__() self.setupUi(self) self.server_url = server_url # to run on button click: self.pushButton.pressed.connect(self.send_message) self.after = 0 # to run by timer: self.timer = QtCore.QTimer() self.timer.timeout.connect(self.get_messages) self.timer.start(1000)
def __init__(self, mdbx, parent=None): super().__init__(parent=parent) self.setupUi(self) self.mdbx = mdbx self.sync_issue_widgets = [] self.refresh_gui() center_window(self) self.update_timer = QtCore.QTimer() self.update_timer.timeout.connect(self.refresh_gui) self.update_timer.start(1000) # every 1 sec
def __init__(self, config_name="maestral"): super().__init__() self.config_name = config_name self._n_sync_errors = None self._current_icon = None self.settings_window = None self.sync_issues_window = None self.rebuild_dialog = None self._progress_dialog = None self.statusAction = None self.accountEmailAction = None self.accountUsageAction = None self.syncIssuesAction = None self.pauseAction = None self.activityAction = None self.loading_done = False self.autostart = AutoStart(self.config_name) self.icons = self.load_tray_icons() self.setIcon(CONNECTING) self.show_when_systray_available() self.menu = QtWidgets.QMenu() self.menu.setSeparatorsCollapsible(False) self.setContextMenu(self.menu) self.setup_ui_unlinked() self.check_for_updates_timer = QtCore.QTimer() self.check_for_updates_timer.timeout.connect(self.auto_check_for_updates) self.check_for_updates_timer.start(30 * 60 * 1000) # every 30 min self.menu.aboutToShow.connect(self._onContextMenuAboutToShow) self.menu.aboutToHide.connect(self._onContextMenuAboutToHide) # schedule periodic updates self._wait_for_status = MaestralBackgroundTask( parent=self, config_name=self.config_name, target="status_change_longpoll", autostart=False, ) self._wait_for_status.sig_result.connect(self.update_ui)
def __init__( self, server_url ): # when initializing the object, we accept the link where the server will be located super().__init__() self.setupUi(self) self.server_url = server_url # save url self.pushButton.pressed.connect( self.send_message) # configuring the send message button self.after = 0 # set "after" to the beginning of the conversation self.timer = QtCore.QTimer() self.timer.timeout.connect( self.get_messages ) # we use a timer to send a get request to the server every second self.timer.start(1000)
def __init__(self, mdbx, parent=None): super().__init__(parent=parent) self.setupUi(self) self.setWindowFlags(QtCore.Qt.WindowType.WindowStaysOnTopHint) self.setWindowTitle("Maestral Activity") self.mdbx = mdbx self._ids = set() self.refresh_gui() center_window(self) self.update_timer = QtCore.QTimer() self.update_timer.timeout.connect(self.refresh_gui) self.update_timer.start(1000) # every 1 sec
def setup_ui(self): self.setSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding) if USE_PYQT6 \ else self.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) # update panel setting self.timer = QtCore.QTimer(parent=self) self.timer.timeout.connect(self.update_display) #layout self.layout = QtWidgets.QGridLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setSpacing(0) self.setup_ui_extra() self.make_item_layout() self.set_border() self.set_font_size(self.config.G_HEIGHT) self.add_items() self.add_extra() self.setLayout(self.layout)
def __init__(self, parent): QtWidgets.QTextEdit.__init__(self, parent) self.timer = QtCore.QTimer() self.timer.setInterval(1000) self.timer.timeout.connect(self.fire)
except Exception as err: # print(f'Other error occurred: {err}') # Python 3.6 return None else: text = response.text return text def timerEvent(self): msg = self.GetMessage(self.MessageID) if msg is not None: msg = json.loads(msg) UserName = msg["UserName"] MessageText = msg["MessageText"] TimeStamp = msg["TimeStamp"] msgtext = f"{TimeStamp} : <{UserName}> : {MessageText}" print(msgtext) self.listWidget1.insertItem(self.MessageID, msgtext) self.MessageID += 1 msg = self.GetMessage(self.MessageID) if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) w = MainWindow() w.show() timer = QtCore.QTimer() time = QtCore.QTime(0, 0, 0) timer.timeout.connect(w.timerEvent) timer.start(5000) sys.exit(app.exec())