def showEvent(self, event): # pylint: disable=unused-argument, invalid-name """ Start movie, when it is shown. """ # show version label if self._is_background_set: self._label = QtWidgets.QLabel(self) self._label.setText(WAQD_VERSION + " ") self._label.setAlignment(Qt.AlignmentFlag(Qt.AlignBottom | Qt.AlignRight)) self._label.setGeometry(0, 0, 800, 480) self._label.show() self._spinner = WaitingSpinner(self, centerOnParent=False, radius=30, roundness=60, line_length=20, line_width=6, speed=0.5, color=(15, 67, 116)) if self._is_background_set: self._spinner.setGeometry(int(self.width()/2 - self._spinner.width()/2), int(self.height() - self._spinner.height() - 20), self._spinner.width(), self._spinner.height()) else: self._spinner.setColor("white") self._spinner.setInnerRadius(40) self._spinner.setLineLength(40) self._spinner.setLineWidth(8) self._spinner.setTrailFadePercentage(90) self._spinner.setGeometry(int(self.width()/2 - self._spinner.width()/2), int(self.height()/2 - self._spinner.height()/2), self._spinner.width(), self._spinner.height()) self._spinner.start()
def __init__(self, width, height, parent, *args, **kwargs): super(MyMenu, self).__init__(*args, **kwargs) self.setStyleSheet("""background: #b4b4b4; color: black;""") self.parent = parent self.resize(width, height) self.main_layout = QtWidgets.QGridLayout() self.threadpool = QtCore.QThreadPool() self.wait = WaitingSpinner(self, True, True, QtCore.Qt.ApplicationModal, roundness=70.0, opacity=100.0, fade=70.0, radius=10.0, lines=12, line_length=10.0, line_width=5.0, speed=1.0, color=(0, 0, 0)) self.setLayout(self.main_layout)
def __init__(self, connection): super(JobList, self).__init__() self.connection = connection self.jobTableModel = JobTableModel() self.jobTableView = JobTableView(self.jobTableModel) #self.dbTable = config.DB.table("jobs") self.log = Logger(jobList=self) self.listJobs() self.tunnels = {} self.threadpool = QThreadPool() # Waiting spinner self.spinner = WaitingSpinner(self.jobTableView) self.spinner.setNumberOfLines(18) self.spinner.setInnerRadius(12) self.spinner.setLineLength(20) self.spinner.setLineWidth(5) # Init, but do not start timers before # a connection with the server is established self.timer = QTimer(self) self.timer.setInterval(1000) self.timer.timeout.connect(self.smartSync) self.elapsedTimer = QElapsedTimer() self.loaded = False self.jobsPending = True
def validate_imported_objects(self, imported_objects): self.spinner = WaitingSpinner(parent=None, roundness=80.0, opacity=10.0, fade=72.0, radius=10.0, lines=12, line_length=12.0, line_width=4.0, speed=1.4, color=(0, 0, 0)) self.spinner.setParent(self.multi_object_list_widget) self.validation_finished.connect(self.spinner.stop) # signal used to stop timer in correct thread self.spinner.start() self.thread = Thread(target=self.validate_objects, args=imported_objects) self.thread.start()
def __init__(self, parent=None): super(Thread, self).__init__(parent) self.is_running = True self.spinner = WaitingSpinner(parent, roundness=70.0, opacity=15.0, fade=70.0, radius=10.0, lines=12, line_length=10.0, line_width=5.0, speed=1.0, color=(0, 0, 0))
def start_waiting(self): """ """ self.wait = WaitingSpinner(self, True, True, QtCore.Qt.ApplicationModal, roundness=70.0, opacity=100.0, fade=70.0, radius=10.0, lines=12, line_length=10.0, line_width=5.0, speed=1.0, color=(0, 0, 0)) self.parent.btn_next.setEnabled(False) self.parent.btn_back.setEnabled(False) self.wait.start()
def initialize_ui(self): label = QLabel("El resultado puede demorar varios minutos") spinner = WaitingSpinner(self, roundness=70.0, opacity=15.0, fade=70.0, radius=10.0, lines=12, line_length=10.0, line_width=5.0, speed=1.0, color=(0, 0, 0)) spinner.start() # starts spinning cancel_button = QPushButton('Cancelar', self) cancel_button.clicked.connect(lambda: self.cancel()) vbox = QVBoxLayout() vbox.addWidget(label) vbox.addWidget(spinner) vbox.addWidget(cancel_button) self.setLayout(vbox)
def __init__(self, *args, **kwargs): super(AppWindow, self).__init__(*args, **kwargs) self.ui = Ui_MainWindow() self.ui.setupUi(self) # translations..?! self._translate = QCoreApplication.translate self.check_config() # initialize attributes self.invoice_to_check = None self.invoice_to_check_flag = None self.uptime = 0 self.status_lnd_due = 0 self.status_lnd_interval = STATUS_INTERVAL_LND self.status_lnd_pid_ok = False self.status_lnd_listen_ok = False self.status_lnd_unlocked = False self.status_lnd_synced_to_chain = False self.status_lnd_synced_to_graph = False self.status_lnd_channel_due = 0 self.status_lnd_channel_interval = STATUS_INTERVAL_LND_CHANNELS self.status_lnd_channel_total_active = 0 self.status_lnd_channel_total_remote_balance = 0 # initial updates self.update_uptime() if self.cfg_valid: self.update_status_lnd() self.update_status_lnd_channels() # initial update of Main Window Title Bar self.update_title_bar() # Align Main Window Top Left self.move(0, 0) # set as maximized (unless on Windows dev host) if IS_WIN32_ENV: log.info("not maximizing window on win32") else: self.setWindowState(Qt.WindowMaximized) # Bindings: buttons self.ui.pushButton_1.clicked.connect(self.on_button_1_clicked) self.ui.pushButton_2.clicked.connect(self.on_button_2_clicked) self.ui.pushButton_3.clicked.connect(self.on_button_3_clicked) self.ui.pushButton_4.clicked.connect(self.on_button_4_clicked) # disable button 1 for now self.ui.pushButton_1.setEnabled(False) # connect error dismiss button and hide for start self.ui.buttonBox_close.button(QDialogButtonBox.Close).setText("Ok") self.ui.buttonBox_close.button(QDialogButtonBox.Close).clicked.connect( self.hide_error) self.hide_error() # Show QR Code Dialog Windows self.w_qr_code = QDialog(flags=(Qt.Dialog | Qt.FramelessWindowHint)) self.ui_qr_code = Ui_DialogShowQrCode() self.ui_qr_code.setupUi(self.w_qr_code) self.w_qr_code.move(0, 0) # SPINNER for CR Code Dialog Window self.ui_qr_code.spinner = WaitingSpinner(self.w_qr_code) self.beat_thread = BeatThread() self.beat_thread.signal.connect(self.process_beat) self.beat_thread.start() self.generate_qr_code_thread = GenerateQrCodeThread() self.generate_qr_code_thread.signal.connect( self.generate_qr_code_finished) self.file_watcher = FileWatcherThread( dir_names=[ os.path.dirname(LND_CONF), os.path.dirname(RB_CONF), os.path.dirname(RB_INFO) ], file_names=[ os.path.basename(LND_CONF), os.path.basename(RB_CONF), os.path.basename(RB_INFO) ], ) self.file_watcher.signal.connect(self.update_watched_attr) self.file_watcher.start() # finally start 00infoBlitz.sh in dedicated xterm frame self.start_info_lcd() self.show()
def __init__(self): super(Ui, self).__init__() MainUiFile = pathlib.Path(__file__).parent.absolute() / 'MainWindow.ui' uic.loadUi(MainUiFile, self) self.setWindowFlags(QtCore.Qt.FramelessWindowHint) self.findBoard = WaitingSpinner(self.Spinner, centerOnParent=True, roundness=100.0, opacity=100.0, fade=70.0, radius=4.0, lines=50, line_length=5.0, line_width=1.0, speed=1.5, color=(235, 167, 99)) self.refreshbtn.clicked.connect(self.animsearch) self.searchlbl.setVisible(False) self.listWidget.itemDoubleClicked.connect(self.change_to_analysis_ui) self.stackedWidget.currentChanged.connect(self.change_btn_ui) self.dataignore = 0 #:::Connecting Slots self.exitbtn.clicked.connect(lambda x: app.exit()) self.maximizebtn.clicked.connect(self.maximize) self.minibtn.clicked.connect(self.minimize) self.stontopbtn.clicked.connect(self.StayonTop) self.stopbtn.clicked.connect(self.Close_ard) self.board_btn.clicked.connect( lambda x: self.stackedWidget.setCurrentIndex(0)) self.data_btn.clicked.connect( lambda x: self.stackedWidget.setCurrentIndex(1)) self.vib_btn.clicked.connect( lambda x: self.stackedWidget.setCurrentIndex(2)) self.pi_btn.clicked.connect( lambda x: self.stackedWidget.setCurrentIndex(3)) self.sld_smooth.valueChanged.connect( lambda x: self.lbl_smooth.setText(str(x))) self.dataPlot_1 = PlotArea('Data Plot - Sensor 1') self.dataPlot_1.ApplySignal(self.Cleared) self.verticalLayout_14.addWidget(self.dataPlot_1.innerWidget) self.dataPlot_2 = PlotArea('Data Plot - Sensor 2') self.dataPlot_2.ApplySignal(self.Cleared) self.verticalLayout_14.addWidget(self.dataPlot_2.innerWidget) self.dataPlot_3 = PlotArea('Data Plot - Sensor 3') self.dataPlot_3.ApplySignal(self.Cleared) self.verticalLayout_14.addWidget(self.dataPlot_3.innerWidget) self.dataPlot_4 = PlotArea('Data Plot - Sensor 4') self.dataPlot_4.ApplySignal(self.Cleared) self.verticalLayout_14.addWidget(self.dataPlot_4.innerWidget) self.response_plot_1 = PlotArea('System Response - Sensor 1') self.verticalLayout_23.addWidget(self.response_plot_1.innerWidget) self.response_plot_2 = PlotArea('System Response - Sensor 2') self.verticalLayout_23.addWidget(self.response_plot_2.innerWidget) self.response_plot_3 = PlotArea('System Response - Sensor 3') self.verticalLayout_23.addWidget(self.response_plot_3.innerWidget) self.response_plot_4 = PlotArea('System Response - Sensor 4') self.verticalLayout_23.addWidget(self.response_plot_4.innerWidget) self.pitchbtn.clicked.connect(self.ChangeCarModel) self.rollbtn.clicked.connect(self.ChangeCarModel) self.fullbtn.clicked.connect(self.ChangeCarModel) self.startbtn.clicked.connect(self.Connect) #::: -> Sliders values self.kfl_sld.valueChanged.connect( lambda x: self.kfl_lbl.setText(str(x) + ' N/m')) self.kfr_sld.valueChanged.connect( lambda x: self.kfr_lbl.setText(str(x) + ' N/m')) self.krr_sld.valueChanged.connect( lambda x: self.krr_lbl.setText(str(x) + ' N/m')) self.krl_sld.valueChanged.connect( lambda x: self.krl_lbl.setText(str(x) + ' N/m')) self.dfl_sld.valueChanged.connect( lambda x: self.dfl_lbl.setText(str(x) + ' N.s/m')) self.dfr_sld.valueChanged.connect( lambda x: self.dfr_lbl.setText(str(x) + ' N.s/m')) self.drr_sld.valueChanged.connect( lambda x: self.drr_lbl.setText(str(x) + ' N.s/m')) self.drl_sld.valueChanged.connect( lambda x: self.drl_lbl.setText(str(x) + ' N.s/m')) self.time = [] self.dislocation = [] #::: Filtering and Events self.pushButton_16.installEventFilter(self) self.scrollArea.viewport().installEventFilter(self) self.scrollArea_2.viewport().installEventFilter(self) self.oldPos = self.pos() self.show()
def set_loading_indicator(self): self.indicator = WaitingSpinner(self.view, True, True, Qt.ApplicationModal)
def init_ui(self): grid = QGridLayout() groupbox1 = QGroupBox() groupbox1_layout = QHBoxLayout() groupbox2 = QGroupBox() groupbox2_layout = QGridLayout() button_hbox = QHBoxLayout() self.setLayout(grid) self.setWindowTitle("QtWaitingSpinner Demo") self.setWindowFlags(Qt.Dialog) # SPINNER self.spinner = WaitingSpinner(self) # Spinboxes self.sb_roundness = QDoubleSpinBox() self.sb_opacity = QDoubleSpinBox() self.sb_fadeperc = QDoubleSpinBox() self.sb_lines = QSpinBox() self.sb_line_length = QDoubleSpinBox() self.sb_line_width = QDoubleSpinBox() self.sb_inner_radius = QDoubleSpinBox() self.sb_rev_s = QDoubleSpinBox() # set spinbox default values self.sb_roundness.setValue(70) self.sb_roundness.setRange(0, 9999) self.sb_opacity.setValue(15) self.sb_opacity.setRange(0, 9999) self.sb_fadeperc.setValue(70) self.sb_fadeperc.setRange(0, 9999) self.sb_lines.setValue(12) self.sb_lines.setRange(1, 9999) self.sb_line_length.setValue(10) self.sb_line_length.setRange(0, 9999) self.sb_line_width.setValue(5) self.sb_line_width.setRange(0, 9999) self.sb_inner_radius.setValue(10) self.sb_inner_radius.setRange(0, 9999) self.sb_rev_s.setValue(1) self.sb_rev_s.setRange(0.1, 9999) # Buttons self.btn_start = QPushButton("Start") self.btn_stop = QPushButton("Stop") self.btn_pick_color = QPushButton("Pick Color") self.btn_show_init = QPushButton("Show init args") # Connects self.sb_roundness.valueChanged.connect(self.set_roundness) self.sb_opacity.valueChanged.connect(self.set_opacity) self.sb_fadeperc.valueChanged.connect(self.set_fadeperc) self.sb_lines.valueChanged.connect(self.set_lines) self.sb_line_length.valueChanged.connect(self.set_line_length) self.sb_line_width.valueChanged.connect(self.set_line_width) self.sb_inner_radius.valueChanged.connect(self.set_inner_radius) self.sb_rev_s.valueChanged.connect(self.set_rev_s) self.btn_start.clicked.connect(self.spinner_start) self.btn_stop.clicked.connect(self.spinner_stop) self.btn_pick_color.clicked.connect(self.show_color_picker) self.btn_show_init.clicked.connect(self.show_init_args) # Layout adds groupbox1_layout.addWidget(self.spinner) groupbox1.setLayout(groupbox1_layout) groupbox2_layout.addWidget(QLabel("Roundness:"), *(1, 1)) groupbox2_layout.addWidget(self.sb_roundness, *(1, 2)) groupbox2_layout.addWidget(QLabel("Opacity:"), *(2, 1)) groupbox2_layout.addWidget(self.sb_opacity, *(2, 2)) groupbox2_layout.addWidget(QLabel("Fade Perc:"), *(3, 1)) groupbox2_layout.addWidget(self.sb_fadeperc, *(3, 2)) groupbox2_layout.addWidget(QLabel("Lines:"), *(4, 1)) groupbox2_layout.addWidget(self.sb_lines, *(4, 2)) groupbox2_layout.addWidget(QLabel("Line Length:"), *(5, 1)) groupbox2_layout.addWidget(self.sb_line_length, *(5, 2)) groupbox2_layout.addWidget(QLabel("Line Width:"), *(6, 1)) groupbox2_layout.addWidget(self.sb_line_width, *(6, 2)) groupbox2_layout.addWidget(QLabel("Inner Radius:"), *(7, 1)) groupbox2_layout.addWidget(self.sb_inner_radius, *(7, 2)) groupbox2_layout.addWidget(QLabel("Rev/s:"), *(8, 1)) groupbox2_layout.addWidget(self.sb_rev_s, *(8, 2)) groupbox2.setLayout(groupbox2_layout) button_hbox.addWidget(self.btn_start) button_hbox.addWidget(self.btn_stop) button_hbox.addWidget(self.btn_pick_color) button_hbox.addWidget(self.btn_show_init) grid.addWidget(groupbox1, *(1, 1)) grid.addWidget(groupbox2, *(1, 2)) grid.addLayout(button_hbox, *(2, 1)) self.spinner.start() self.show()
def __init__(self, controller, refreshSignal): super().__init__() self.controller = controller self.refreshSignal = refreshSignal # Balance label balaceLabel = QLabel() balaceLabel.setText('Balance') balaceLabel.setAlignment(Qt.AlignCenter) # Balance amount label self.balaceAmountLabel = QLabel() self.balaceAmountLabel.setText(f'{self.controller.getBalance()} XRP') self.balaceAmountLabel.setAlignment(Qt.AlignCenter) font = QFont() font.setPointSize(20) self.balaceAmountLabel.setFont(font) # Balance layout balanceLayout = QVBoxLayout() balanceLayout.addWidget(balaceLabel) balanceLayout.addWidget(self.balaceAmountLabel) balanceLayout.setContentsMargins(0, 10, 0, 10) # Transactions label transactionsLabel = QLabel('Transactions') transactionsLabel.setAlignment(Qt.AlignCenter) transactionsLabel.setContentsMargins(0, 0, 0, 10) # Transactions table self.tableWidget = QTableWidget() self.tableWidget.setColumnCount(1) self.tableWidget.verticalHeader().setVisible(False) self.tableWidget.horizontalHeader().setVisible(False) self.tableWidget.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.tableWidget.horizontalHeader().setSectionResizeMode(0, QHeaderView.Stretch) self.populateTable() monofont = QFont() monofont.setFamily("Courier New") monofont.setPointSize(10) self.tableWidget.setFont(monofont) # Transactions layout transactionsLayout = QVBoxLayout() transactionsLayout.addWidget(transactionsLabel) transactionsLayout.addWidget(self.tableWidget) transactionsLayout.setContentsMargins(0, 0, 0, 0) # Send label A sendLabelA = QLabel('Send') sendLabelA.setAlignment(Qt.AlignCenter) # Send amount self.sendAmount = QLineEdit() self.sendAmount.setAlignment(Qt.AlignCenter) self.sendAmount.setFont(monofont) self.sendAmount.setPlaceholderText('Amount') validator = QRegExpValidator(QRegExp(r'^[0-9]+\.?[0-9]{0,6}$')) self.sendAmount.setValidator(validator) self.sendAmount.textChanged.connect(self.check_state) self.sendAmount.textChanged.emit(self.sendAmount.text()) self.sendAmount.textChanged.connect(lambda: self.on_text_changed(0)) # Send label B sendLabelB = QLabel('XRP to') sendLabelB.setAlignment(Qt.AlignCenter) # Send address self.sendAddress = QLineEdit() self.sendAddress.setAlignment(Qt.AlignCenter) self.sendAddress.setFont(monofont) self.sendAddress.setPlaceholderText('Address') validator = QRegExpValidator(QRegExp('^r[A-HJ-NP-Za-km-z1-9]{24,34}$')) self.sendAddress.setValidator(validator) self.sendAddress.textChanged.connect(self.check_state) self.sendAddress.textChanged.emit(self.sendAmount.text()) self.sendAddress.textChanged.connect(lambda: self.on_text_changed(1)) # Send tag self.sendTag = QLineEdit() self.sendTag.setAlignment(Qt.AlignCenter) self.sendTag.setFont(monofont) self.sendTag.setPlaceholderText('Tag') validator = QRegExpValidator(QRegExp(r'^\d*$')) self.sendTag.setValidator(validator) self.sendTag.textChanged.connect(self.check_state) # Send button self.sendButton = QPushButton() self.sendButton.setMaximumSize(40, 40) sendIcon = QIcon.fromTheme("mail-send") self.sendButton.setIcon(sendIcon) self.sendButton.setIconSize(QSize(24,24)) self.sendButton.clicked.connect(self.on_send_clicked) self.sendButton.setEnabled(False) # Send layout sendLayout = QHBoxLayout() sendLayout.addWidget(sendLabelA) sendLayout.addWidget(self.sendAmount, 2) sendLayout.addWidget(sendLabelB) sendLayout.addWidget(self.sendAddress, 4) sendLayout.addWidget(self.sendTag, 1) sendLayout.addWidget(self.sendButton) sendLayout.setContentsMargins(0, 0, 0, 0) # Info layout balanceWidget = QWidget() balanceWidget.setLayout(balanceLayout) transactionsWidget = QWidget() transactionsWidget.setLayout(transactionsLayout) sendWidget = QWidget() sendWidget.setLayout(sendLayout) self.infoLayout = QVBoxLayout() self.infoLayout.setContentsMargins(0, 0, 0, 0) self.infoLayout.addWidget(balanceWidget) self.infoLayout.addWidget(transactionsWidget) self.infoLayout.addWidget(sendWidget) # Waiting spinner self.spinner = WaitingSpinner(self) self.spinnerLayout = QVBoxLayout() self.spinnerLayout.addWidget(self.spinner) self.spinner.start() # Stacked widget infoWidget = QWidget() infoWidget.setLayout(self.infoLayout) spinnerWidget = QWidget() spinnerWidget.setLayout(self.spinnerLayout) self.setContentsMargins(0, 0, 0, 0) self.addWidget(infoWidget) self.addWidget(spinnerWidget) self.setCurrentIndex(0)
def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.setWindowTitle('TD') self.setWindowOpacity(0.9) #-- Why? IDK, I think it's cool. self.bg_color = self.palette() self.bg_color.setColor(self.backgroundRole(), QColor(0, 48, 64)) self.bg_color_drag = self.palette() self.bg_color_drag.setColor(self.backgroundRole(), QColor(4, 14, 18)) self.setPalette(self.bg_color) self.statusBar_label = QLabel(' Image Detected') self.statusBar_label.setStyleSheet('color: #5dbcd2') self.statusBar().addWidget(self.statusBar_label) self.statusBar().hide() self.setAcceptDrops(True) widget = QWidget() #-----Objects in Layouts------- self.spinner = WaitingSpinner(self, True, True, roundness=70.0, opacity=15.0, fade=70.0, radius=14.0, lines=12, line_length=16.0, line_width=4.0, speed=1.5, color=(255, 255, 255)) self.top_label = QLabel() self.top_label.setFont(QFont("Arial", 14)) self.top_label.setStyleSheet('color: white') self.top_label.setTextInteractionFlags(Qt.TextSelectableByMouse) self.top_label.setCursor(Qt.IBeamCursor) hLine = QFrame() hLine.setFrameShape(QFrame.HLine) hLine.setStyleSheet('color: white') self.bottom_label = QLabel() self.bottom_label.setFont(QFont("Arial", 14)) self.bottom_label.setStyleSheet('color: white') self.bottom_label.setTextInteractionFlags(Qt.TextSelectableByMouse) self.bottom_label.setCursor(Qt.IBeamCursor) info_button_image_path = resource_path('./images/info_black.png') self.infoButton = QPushButton('', self) self.infoButton.setIcon(QIcon(info_button_image_path)) self.infoButton.setCursor(Qt.PointingHandCursor) self.infoButton.clicked.connect(self.show_infoButton_message) self.infoButton.setMaximumWidth(30) self.infoButton.setToolTip("Info") self.infoButton.setFlat(True) #-------Layout Containers--------- topHBox = QHBoxLayout() topHBox.addWidget(self.top_label) topHBox.addWidget(self.infoButton, 0, Qt.AlignRight | Qt.AlignTop) _layout = QVBoxLayout() _layout.addLayout(topHBox) _layout.addWidget(hLine, 0, Qt.AlignVCenter) _layout.addWidget(self.bottom_label) widget.setLayout(_layout) self.setCentralWidget(widget) self.start_here()