def __init__(self): super().__init__() layout = QVBoxLayout() self.text = QPlainTextEdit() layout.addWidget(self.text) self.progress = QProgressBar() self.progress.setRange(0, 100) self.progress.setValue(0) layout.addWidget(self.progress) btn_run = QPushButton("Execute") btn_run.clicked.connect(self.start) layout.addWidget(btn_run) w = QWidget() w.setLayout(layout) self.setCentralWidget(w) # Thread runner self.threadpool = QThreadPool() self.show()
def __init__(self): super().__init__() self.threadpool = QThreadPool() self.cpuUsage = [] self.countTime = [] self.start_time = time() self.timer = QTimer() # --------------------------------------------------------------------------- self.plot_view = PlotWidget() self.plot_view.plotItem.setTitle("Processor percent usage") setConfigOptions(antialias=False) # --------------------------------------------------------------------------- self.hour = [] self.temperature = [] # --------------------------------------------------------------------------- self.plot_view.plot(self.hour, self.temperature, pen=mkPen(cosmetic=True, width=40.0, color='r')) self.plot_view.setLabel('left', "Processor usage", units='%') # --------------------------------------------------------------------------- self.main_layout = QVBoxLayout() self.main_layout.addWidget(self.plot_view) self.setLayout(self.main_layout)
def __init__(self): super().__init__() self.threadpool = QThreadPool() self.totalTickets = QSpinBox() self.totalTickets.setRange(0, 500) self.serviceTickets = QSpinBox() self.serviceTickets.setRange(0, 250) self.incidentTickets = QSpinBox() self.incidentTickets.setRange(0, 250) self.unassignedTickets = QSpinBox() self.unassignedTickets.setRange(0, 200) self.reasonOne = QLineEdit() self.reasonTwo = QLineEdit() self.reasonThree = QLineEdit() self.additionalNotes = QTextEdit() self.generate_btn = QPushButton("Generate PDF") self.generate_btn.pressed.connect(self.generate) layout = QFormLayout() layout.addRow("Number of tickets today", self.totalTickets) layout.addRow("Service tickets", self.serviceTickets) layout.addRow("Incident tickets", self.incidentTickets) layout.addRow("Unassigned tickets", self.unassignedTickets) layout.addRow("Reason for most tickets", self.reasonOne) layout.addRow("Second reason for most tickets", self.reasonTwo) layout.addRow("Third reason for most tickets", self.reasonThree) layout.addRow("additionalNotes", self.additionalNotes) layout.addRow(self.generate_btn) self.setLayout(layout)
def __init__(self): super().__init__() # Some buttons layout = QVBoxLayout() self.name = QLineEdit() layout.addWidget(self.name) self.country = QLineEdit() layout.addWidget(self.country) self.website = QLineEdit() layout.addWidget(self.website) self.number_of_lines = QSpinBox() layout.addWidget(self.number_of_lines) btn_run = QPushButton("Execute") btn_run.clicked.connect(self.start) layout.addWidget(btn_run) w = QWidget() w.setLayout(layout) self.setCentralWidget(w) # Thread runner self.threadpool = QThreadPool() self.show()
def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.setupUi(self) # Setting Column width header = self.oc_treeWidget.header() header.setSectionResizeMode(QHeaderView.ResizeToContents) header.setStretchLastSection(False) header.setSectionResizeMode(7, QHeaderView.Stretch) self.oc_treeWidget.sortItems(0, Qt.AscendingOrder) self.actionFile.triggered.connect(self.fileButtonClicked) self.oc_treeWidget.currentItemChanged.connect(self.treeItemClicked) self.oc_treeWidget.itemClicked.connect(self.treeItemClicked) self.raw_checkBox.toggled.connect(self.highLightToggle) self.actionExit.triggered.connect(sys.exit) self.threadPool = QThreadPool() self.lastFile = "" self.statusbar.showMessage("Idle") self.fileLineCount = 0 self.currentLineLoader = None
def __init__(self): QObject.__init__(self) self.__motor = ClearpathSCSK() self.__motor_nodes_count_list = [2] self.__motor_nodes_id_list = ["Disconnected 0", "Disconnected 1"] self.__motor_ports_connected = len(self.__motor_nodes_count_list) self.__building_plate_port = 0 self.__wiper_port = 0 self.__building_plate_node = 0 self.__wiper_node = 1 self.__wiper_recoat_offset_mm = 245 self.__wiper_recoat_feedrate_mm_min = 1800 self.__building_plate_recoat_offset_mm = 1 self.__building_plate_recoat_feedrate_mm_min = 300 self.__pause_toggle = False self.__ser = serial.Serial(timeout=5, write_timeout=0) self.__loaded_gcode = [] self.__number_of_lines = 0 self.__baudrates_list = (115200, 57600, 38400, 28800, 19200, 14400, 9600, 4800, 2400, 1200, 600, 300) self.__baudrate = self.__baudrates_list[0] self.__com_port = '' self.__available_ports = serial.tools.list_ports.comports() ports = () for p in self.__available_ports: ports = ports + (str(p.device), ) self.__available_ports = ports if len(self.__available_ports) > 0: self.__com_port = self.__available_ports[0] self.__threadpool = QThreadPool()
def __init__(self, node_set: NodeSet): super(LndWalletLayout, self).__init__() self.node_set = node_set self.password_dialog = QInputDialog() self.error_message = QErrorMessage() self.state = None self.threadpool = QThreadPool() columns = 2 self.addWidget(SectionName('LND Wallet'), column_span=columns) wallet_buttons_layout = QtWidgets.QHBoxLayout() # Unlock wallet button self.unlock_wallet_button = QtWidgets.QPushButton('Unlock') # noinspection PyUnresolvedReferences self.unlock_wallet_button.clicked.connect(self.unlock_wallet) wallet_buttons_layout.addWidget(self.unlock_wallet_button) # Create wallet button self.create_wallet_button = QtWidgets.QPushButton('Create') # noinspection PyUnresolvedReferences self.create_wallet_button.clicked.connect(self.create_wallet) wallet_buttons_layout.addWidget(self.create_wallet_button, same_row=True, column=2) # Recover wallet button self.recover_wallet_button = QtWidgets.QPushButton('Recover') # noinspection PyUnresolvedReferences self.recover_wallet_button.clicked.connect(self.recover_wallet) wallet_buttons_layout.addWidget(self.recover_wallet_button) self.addLayout(wallet_buttons_layout, column_span=columns) self.addWidget(HorizontalLine(), column_span=columns)
def __init__(self, config): super(MainWindow, self).__init__() # Set basic window properties self.setWindowTitle("Cyckei Client") self.config = config self.resize(1100, 600) self.setStyleSheet( open(func.find_path("assets/style.css"), "r").read()) resource = {} # Setup ThreadPool resource["threadpool"] = QThreadPool() self.threadpool = resource["threadpool"] logging.info("Multithreading set with maximum {} threads".format( resource["threadpool"].maxThreadCount() )) # Load scripts resource["scripts"] = ScriptList(config) # Create menu and status bar self.create_menu() self.status_bar = self.statusBar() # Create Tabs resource["tabs"] = QTabWidget(self) self.setCentralWidget(resource["tabs"]) resource["tabs"].addTab(ChannelTab(config, resource), "Channels") resource["tabs"].addTab(ScriptEditor(config, resource), "Scripts") resource["tabs"].addTab(LogViewer(config, resource), "Logs") self.threadpool = resource["threadpool"] self.channels = resource["tabs"].widget(0).channels
def __init__(self, api: Alt1Api, rpc_secret: bytes, parent=None): super().__init__(parent) self.api = api self.rpc_secret = rpc_secret self.logger = logging.getLogger(__name__ + "." + self.__class__.__name__) self.thread_pool = QThreadPool(parent=self)
def __init__(self): super().__init__() self.counter = 0 layout = QVBoxLayout() self.l = QLabel("Start") b = QPushButton("DANGER!") b.pressed.connect(self.oh_no) layout.addWidget(self.l) layout.addWidget(b) w = QWidget() w.setLayout(layout) self.setCentralWidget(w) self.show() self.threadpool = QThreadPool() print("Multithreading with maximum %d threads" % self.threadpool.maxThreadCount()) self.timer = QTimer() self.timer.setInterval(1000) self.timer.timeout.connect(self.recurring_timer) self.timer.start()
def __init__(self, parent=None): super().__init__(parent) self.setupUi(self) self.setStyleSheet(qss) self.config_widget = parent self.check_res = None self.btn_group = QButtonGroup(self) # self.res.setWordWrap(True) self.user.setFocus() self.host.textChanged.connect(self.host_slot) self.port.textChanged.connect(self.textChanged_slot) self.user.textChanged.connect(self.textChanged_slot) self.password.textChanged.connect(self.textChanged_slot) self.database.textChanged.connect(self.textChanged_slot) # 右键菜单 self.ava_table.horizontalHeader().setVisible(False) self.ava_table.setContextMenuPolicy( Qt.CustomContextMenu) ######允许右键产生子菜单 self.ava_table.customContextMenuRequested.connect( self.generate_menu) ####右键菜单 # btn self.test_btn.clicked.connect(self.test_btn_slot) self.ok_btn.clicked.connect(self.ok_btn_slot) self.host.setText('localhost') self.port.setText('27017') self.url.setPlaceholderText( "mongodb://[user:password@]host:port/database") # self.thread_pool = QThreadPool() self.sig = DBObject() self.sig.dbsig.connect(self.db_connect_result)
def __init__(self): super().__init__() # Some buttons w = QWidget() l = QHBoxLayout() w.setLayout(l) btn_stop = QPushButton("Stop") l.addWidget(btn_stop) self.setCentralWidget(w) # Create a statusbar. self.status = self.statusBar() self.progress = QProgressBar() self.status.addPermanentWidget(self.progress) # Thread runner self.threadpool = QThreadPool() # Create a runner self.runner = JobRunner() self.runner.signals.progress.connect(self.update_progress) self.threadpool.start(self.runner) btn_stop.pressed.connect(self.runner.kill) self.show()
def __init__(self): super().__init__() self.urls = [ "https://www.learnpyqt.com/", "https://www.mfitzp.com/", "https://www.google.com", "https://www.udemy.com/create-simple-gui-applications-with-python-and-qt/", ] layout = QVBoxLayout() self.text = QPlainTextEdit() self.text.setReadOnly(True) button = QPushButton("GO GET EM!") button.pressed.connect(self.execute) layout.addWidget(self.text) layout.addWidget(button) w = QWidget() w.setLayout(layout) self.setCentralWidget(w) self.show() self.threadpool = QThreadPool() print("Multithreading with maximum %d threads" % self.threadpool.maxThreadCount())
def __init__(self, mainwindow): super(self.__class__, self).__init__() self.setupUi(self) self.setStyleSheet(qss) self.mainwindow = mainwindow self.k_thread = QThreadPool() # calendar self.start.setCalendarPopup(True) self.end.setCalendarPopup(True) self.start.setDisplayFormat('yyyy-MM-dd HH:mm:ss') self.end.setDisplayFormat('yyyy-MM-dd HH:mm:ss') now = datetime.now() - timedelta(days=30) self.start.setDate(QDate(now.year, now.month, now.day)) self.end.setDateTime(QDateTime.currentDateTime()) # for local_symbol in sorted(G.all_contracts): self.symbol_list.addItem(local_symbol + contract_space + G.all_contracts[local_symbol]) # 添加下拉框 self.symbol_list.currentIndexChanged.connect(self.symbol_change_slot) self.frq.addItems(['1min', '3min', '15min', '30min', '60min']) # table self.tick_table.setRowCount(0) self.tick_row = len(G.order_tick_row_map) self.tick_table.horizontalHeader().setStretchLastSection(True) # 最后一列自适应表格宽度 # self.tick_table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch) # 所有列自适应表格宽度 self.tick_table.setEditTriggers(QTableWidget.NoEditTriggers) # 单元格不可编辑 self.tick_table.horizontalHeader().setVisible(False) # 水平表头不可见 self.tick_table.verticalHeader().setVisible(False) # 垂直表头不可见 # btn self.source_btn.clicked.connect(self.source_btn_slot) self.hide_btn.clicked.connect(self.hide_btn_slot) self.reload_btn.clicked.connect(self.k_line_reload) self.hide_btn_slot() # 默认隐藏 self.mainwindow.job.kline_tick_signal.connect(self.set_tick_slot) self.ready_action()
def __init__(self, parent=None, image_names=None): self.figure = Figure() super(ImageCanvas, self).__init__(self.figure) self.raw_axes = [] # only used for raw currently self.axes_images = [] self.overlay_artists = {} self.cached_detector_borders = [] self.saturation_texts = [] self.cmap = hexrd.ui.constants.DEFAULT_CMAP self.norm = None self.iviewer = None self.azimuthal_integral_axis = None self.azimuthal_line_artist = None self.wppf_plot = None # Track the current mode so that we can more lazily clear on change. self.mode = None # Track the pixel size self.cartesian_res_config = ( HexrdConfig().config['image']['cartesian'].copy()) self.polar_res_config = HexrdConfig().config['image']['polar'].copy() # Set up our async stuff self.thread_pool = QThreadPool(parent) if image_names is not None: self.load_images(image_names) self.setup_connections()
def __init__(self, window): super(View, self).__init__(window) self.setFocusPolicy(Qt.StrongFocus) self.shiftKey = False self.ctrlKey = False self.lastMousePos = QPoint() self.lastTabletPos = QPoint() self.mode = 'add' self.maskOnly = False self.refresh = QTimer(self) self.refresh.setSingleShot(True) self.refresh.timeout.connect(self.repaint) self.addCursor = makeCursor('images/cursor-add.png', QColor.fromRgbF(0.5, 0.5, 1.0)) self.delCursor = makeCursor('images/cursor-del.png', QColor.fromRgbF(1.0, 0.5, 0.5)) self.setCursor(self.addCursor) self.imagefile = None self.maskfile = None self.image = QImage() self.mask = QImage(self.image.size(), QImage.Format_RGB32) self.mask.fill(Qt.black) self.changed = False self.update() self.path = list() self.load_threads = QThreadPool() self.load_threads.setMaxThreadCount(4)
def __init__(self, parent: QWidget, network: str = 'mainnet'): super().__init__() self.timer = QTimer(self.parentWidget()) self.node_set = NodeSet(network) columns = 2 layout = QGridLayout() self.nodes_layout = NodesLayout(node_set=self.node_set) layout.addLayout(self.nodes_layout, column_span=columns) self.lnd_wallet_layout = LndWalletLayout(node_set=self.node_set, parent=parent) layout.addLayout(self.lnd_wallet_layout, column_span=columns) self.zap_layout = ZapLayout(node_set=self.node_set) layout.addLayout(self.zap_layout, column_span=columns) self.joule_layout = JouleLayout(node_set=self.node_set) layout.addLayout(self.joule_layout, column_span=columns) self.cli_layout = CliLayout(node_set=self.node_set) layout.addLayout(self.cli_layout, column_span=columns) self.setLayout(layout) self.threadpool = QThreadPool() self.timer.start(1000) self.timer.timeout.connect(self.refresh) self.refresh()
def __init__(self): super().__init__() self.threadpool = QThreadPool() self.x = {} # Keep timepoints. self.y = {} # Keep data. self.lines = {} # Keep references to plotted lines, to update. layout = QVBoxLayout() self.graphWidget = pg.PlotWidget() self.graphWidget.setBackground("w") layout.addWidget(self.graphWidget) button = QPushButton("Create New Worker") button.pressed.connect(self.execute) # layout.addWidget(self.progress) layout.addWidget(button) w = QWidget() w.setLayout(layout) self.setCentralWidget(w) self.show()
def __init__(self): super(Zipvy, self).__init__() self.setupUi(self) self.show() # Load default Widgets Values # .... self.setWindowTitle("Zipvy - To Make Video from Zip") self.setWindowIcon(QIcon('images\\icon.ico')) self.terminal_output.setReadOnly(True) self.terminal_output.setPlainText("Zipvy is Ready....") self.progressBar.hide() self.label_progress.hide() self.same_as_zip_name_checkbox.setChecked(True) #Variables .... self.algorithm = 0 self.zip_location = "" self.zip_name = "" self.lineEdit_text = "" self.video_name = "" self.video_location = "" #Threads... self.threadpool = QThreadPool() #Connect Signal to Slots... self.same_as_zip_name_checkbox.stateChanged.connect( self.checkbox_stat_changed) self.select_zip_button.clicked.connect(self.select_zip) self.start_button.clicked.connect(self.start) self.algorithm_combobox.currentIndexChanged.connect(self.set_algorithm) self.lineEdit.textChanged.connect(self.textedit_text_changed) self.toolButton.clicked.connect(self.set_video_location)
def __init__(self): super(MovieLibrary, self).__init__() self.resize(800, 600) self.setWindowTitle("Movie Library") self.downloader_pool = QThreadPool() self.downloader_pool.setMaxThreadCount(8) # menu self.build_menu() central_widget = QWidget() self.setCentralWidget(central_widget) main_layout = QHBoxLayout(central_widget) self.category_selector = CategorySelector() main_layout.addWidget(self.category_selector) self.movie_browser = MovieBrowser() main_layout.addWidget(self.movie_browser) self.apply_style() self.category_selector.filter_activated.connect(self.movie_browser.movie_list_view.do_filter)
def __init__(self): super().__init__() layout = QVBoxLayout() self.progress = QProgressBar() button = QPushButton("START IT UP") button.pressed.connect(self.execute) self.status = QLabel("0 workers") layout.addWidget(self.progress) layout.addWidget(button) layout.addWidget(self.status) w = QWidget() w.setLayout(layout) # Dictionary holds the progress of current workers. self.worker_progress = {} self.setCentralWidget(w) self.show() self.threadpool = QThreadPool() print( "Multithreading with maximum %d threads" % self.threadpool.maxThreadCount() ) self.timer = QTimer() self.timer.setInterval(100) self.timer.timeout.connect(self.refresh_progress) self.timer.start()
def __init__(self, home, app_name=None): super(self.__class__, self).__init__() self.setupUi(self) self.setStyleSheet(qss) self.home = home self.interpreter = None self.p = QProcess() self.thread_pool = QThreadPool() # btn self.py_setting_btn.clicked.connect(self.py_setting_slot) self.set_app_py.clicked.connect(self.set_app_py_slot) # self.py_box.currentTextChanged.connect(self.py_change_slot) self.pip_list.setContextMenuPolicy(Qt.CustomContextMenu) self.pip_list.customContextMenuRequested.connect(self.generate_menu) ####右键菜单 # self.load_py() if not app_name: """用于设置窗口""" self.app_name.hide() self.set_app_py.hide() self.cur_py.hide() self.label_3.hide() else: """用于应用窗口""" self.app_name.setText(app_name) self.app_name.setStyleSheet("""color:#BE9117""") self.cur_py.setStyleSheet("""color:#168AD5""") path = G.config.installed_apps[app_name].get('py_', '未选择') for name, p in G.config.python_path.items(): if path == p: self.cur_py.setText(name) else: self.cur_py.setText(path)
def __init__(self, parent=None): super().__init__(parent) self.parent = parent self.thread_pool = QThreadPool(self.parent) self.progress_dialog = ProgressDialog(self.parent) self.setup_connections()
def __init__(self): super().__init__() self.start_button = QPushButton('Start') self.keywords_line = QLineEdit() self.url_line = QLineEdit() self.status_label = QLabel('nix') self.threadpool = QThreadPool() self.initUI()
def __init__(self): super(MainWindow, self).__init__() self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ui.tableWidgetDownload.horizontalHeader().setSectionResizeMode(0, QHeaderView.ResizeToContents) self.ui.tableWidgetDownload.setContextMenuPolicy(Qt.CustomContextMenu) self.ui.tableWidgetDownload.customContextMenuRequested.connect(self.generate_menu) self.ui.lineEditFilePath.setText(u"E:\\video\合集\\") self.ui.lineEditDownloadUrl.setText('') self.ui.btnStartDownload.pressed.connect(self.click_event) self.clipBoard = QApplication.clipboard() self.clipBoard.dataChanged.connect(self.monitor_clipboard) self.mimeData = self.clipBoard.mimeData() self.clipBoard.setText("") self.parserList = [] self.downloaderList = [] self.checkerThreadPool = QThreadPool() self.checkerThreadPool.setMaxThreadCount(1) self.parserThreadPool = QThreadPool() self.ehentaiThreadPool = QThreadPool() self.nhentaiThreadPool = QThreadPool() self.nhentaiThreadPool.setMaxThreadCount(1) self.wnacgThreadPool = QThreadPool() self.wnacgThreadPool.setMaxThreadCount(1) self.eighteenComicThreadPool = QThreadPool() self.ahentaiThreadPool = QThreadPool()
def __init__(self): super().__init__() self._ui = Ui_MainWindow() self._ui.setupUi(self) self.setWindowTitle("File Converter") self.threadpool = QThreadPool(self) self._ui.pushButton_convertFiles.clicked.connect(self.convert_files) #self._ui.comboBox_filetype.removeItem(1) self.show()
def start(self): threadpool = QThreadPool() worker = Worker(fn=self.check_version) threadpool.start(worker) self.system_tray.show() self.node_set.start() status = self.exec_() return status
def __init__(self, parent=None): super(TabDisplays, self).__init__(parent) # Initialize logging logging_conf_file = os.path.join(os.path.dirname(__file__), 'cfg/aecgviewer_aecg_logging.conf') logging.config.fileConfig(logging_conf_file) self.logger = logging.getLogger(__name__) self.studyindex_info = aecg.tools.indexer.StudyInfo() self.validator = QWidget() self.studyinfo = QWidget() self.statistics = QWidget() self.waveforms = QWidget() self.waveforms.setAccessibleName("Waveforms") self.scatterplot = QWidget() self.histogram = QWidget() self.trends = QWidget() self.xmlviewer = QWidget() self.xml_display = QTextEdit(self.xmlviewer) self.options = QWidget() self.aecg_display_area = QScrollArea() self.cbECGLayout = QComboBox() self.aecg_display = EcgDisplayWidget(self.aecg_display_area) self.aecg_display_area.setWidget(self.aecg_display) self.addTab(self.validator, "Study information") self.addTab(self.waveforms, "Waveforms") self.addTab(self.xmlviewer, "XML") self.addTab(self.options, "Options") self.setup_validator() self.setup_waveforms() self.setup_xmlviewer() self.setup_options() size = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) size.setHeightForWidth(False) self.setSizePolicy(size) # Initialized a threpool with 2 threads 1 for the GUI, 1 for long # tasks, so GUI remains responsive self.threadpool = QThreadPool() self.threadpool.setMaxThreadCount(2) self.validator_worker = None self.indexing_timer = QElapsedTimer()
def __init__(self): QFileSystemModel.__init__(self) self.sizeRole = int(Qt.UserRole + 1) self.dirSelected.connect(self.selDirPath) self.Scanning = False self.threadpool = QThreadPool() self.progress = 0.0 print("Multithreading with maximum %d threads" % self.threadpool.maxThreadCount())
def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.setupUi(self) self.pushButton.pressed.connect(self.update_weather) self.threadpool = QThreadPool() self.update_weather() self.show()