def __init__(self): QMainWindow.__init__(self) self.set0 = QtCharts.QBarSet("Jane") self.set1 = QtCharts.QBarSet("John") self.set2 = QtCharts.QBarSet("Axel") self.set3 = QtCharts.QBarSet("Mary") self.set4 = QtCharts.QBarSet("Sam") self.set0.append([1, 2, 3, 4, 5, 6]) self.set1.append([5, 0, 0, 4, 0, 7]) self.set2.append([3, 5, 8, 13, 8, 5]) self.set3.append([5, 6, 7, 3, 4, 5]) self.set4.append([9, 7, 5, 3, 1, 2]) self.barSeries = QtCharts.QBarSeries() self.barSeries.append(self.set0) self.barSeries.append(self.set1) self.barSeries.append(self.set2) self.barSeries.append(self.set3) self.barSeries.append(self.set4) self.lineSeries = QtCharts.QLineSeries() self.lineSeries.setName("trend") self.lineSeries.append(QPoint(0, 4)) self.lineSeries.append(QPoint(1, 15)) self.lineSeries.append(QPoint(2, 20)) self.lineSeries.append(QPoint(3, 4)) self.lineSeries.append(QPoint(4, 12)) self.lineSeries.append(QPoint(5, 17)) self.chart = QtCharts.QChart() self.chart.addSeries(self.barSeries) self.chart.addSeries(self.lineSeries) self.chart.setTitle("Line and barchart example") self.categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] self.axisX = QtCharts.QBarCategoryAxis() self.axisX.append(self.categories) self.chart.setAxisX(self.axisX, self.lineSeries) self.chart.setAxisX(self.axisX, self.barSeries) self.axisX.setRange("Jan", "Jun") self.axisY = QtCharts.QValueAxis() self.chart.setAxisY(self.axisY, self.lineSeries) self.chart.setAxisY(self.axisY, self.barSeries) self.axisY.setRange(0, 20) self.chart.legend().setVisible(True) self.chart.legend().setAlignment(Qt.AlignBottom) self.chartView = QtCharts.QChartView(self.chart) self.chartView.setRenderHint(QPainter.Antialiasing) self.setCentralWidget(self.chartView)
def __init__(self): QMainWindow.__init__(self) start_button = QPushButton("Start") hlayout = QHBoxLayout() hlayout.addWidget(start_button) widget = QWidget() widget.setLayout(hlayout) self.setCentralWidget(widget) self.label = QLabel(self) self.label.setText("0") self.current_time = 0 self.timer = QTimer(self) self.timer.setInterval(1000) self.timer.timeout.connect(self.update_elapsed_time) self.timer.start()
def __init__(self, parent=None): QLocale.setDefault(QLocale.English) QMainWindow.__init__(self, parent) self.setWindowTitle("AMLab Software v1.0") self.supported_printers = ['DLP', 'Metal'] self.selected_printer = self.supported_printers[0] self.__init_setup__() self.dlp_gui = None self.metal_gui = None # self.dlp_gui.hide() # self.metal_gui.hide() self.setup_widget.hide() self.__init_menu_bar__() if not self.__load_settings__(): self.__select_setup_widget__()
def __init__(self, widget): QMainWindow.__init__(self) self.setWindowTitle("Pixel Translator") # Menu self.menu = self.menuBar() self.file_menu = self.menu.addMenu("File") # Exit QAction exit_action = QAction("Exit", self) exit_action.setShortcut("Ctrl+Q") exit_action.triggered.connect(self.exit_app) self.file_menu.addAction(exit_action) self.setCentralWidget(widget)
def __init__(self, widget): QMainWindow.__init__(self) self.window_title = "Tutorial" # Menu self.menu = self.menu_bar() self.file_menu = self.menu.add_menu("File") # Exit QAction exit_action = QAction("Exit", self) exit_action.shortcut = "Ctrl+Q" exit_action.triggered.connect(self.exit_app) self.file_menu.add_action(exit_action) self.set_central_widget(widget)
def __init__(self, widget, city): QMainWindow.__init__(self) self.setWindowTitle("Detail of " + city) self.setCentralWidget(widget) # Exit QAction exit_action = QAction("Exit", self) exit_action.setShortcut(QKeySequence.Quit) exit_action.triggered.connect(self.close) # Window dimensions geometry = qApp.desktop().availableGeometry(self) self.setFixedSize(0.8 * geometry.width(), geometry.height())
def __init__(self): QMainWindow.__init__(self) self.textEdit = QTextEdit() self.setCentralWidget(self.textEdit) self.statusBar() openFile = QAction(QIcon('open.png'), 'Open', self) openFile.setShortcut('Ctrl+O') openFile.setStatusTip('Open new File') openFile.triggered.connect(self.showDialog) menubar = self.menuBar() fileMenu = menubar.addMenu('&File') fileMenu.addAction(openFile) self.setGeometry(300, 300, 350, 300) self.setWindowTitle('Example - File Dialog') self.show()
def __init__(self, parent=None): QMainWindow.__init__(self) self.setWindowTitle("Otherwhere Generator") self.setCentralWidget(parent) # menu self.menu = self.menuBar() self.file_menu = self.menu.addMenu("File") # Exit exit_action = QAction("Exit", self) exit_action.setShortcut(QKeySequence.Quit) exit_action.triggered.connect(self.exit_app) self.file_menu.addAction(exit_action)
def __init__(self): QMainWindow.__init__(self) self.title = 'test' self.left = 10 self.top = 10 self.width = 1920 self.height = 1080 self.setWindowTitle(self.title) self.setGeometry(self.left, self.top, self.width, self.height) self.statusBar().showMessage('Ready') mainMenu = self.menuBar() mainMenu.setNativeMenuBar(False) fileMenu = mainMenu.addMenu('File') helpMenu = mainMenu.addMenu('Help') exitButton = QAction(QIcon('exit24.png'), 'Exit', self) exitButton.setShortcut('Ctrl+Q') exitButton.setStatusTip('Exit application') exitButton.triggered.connect(self.close) fileMenu.addAction(exitButton) widget = QWidget(self) self.setCentralWidget(widget) vlay = QVBoxLayout(widget) hlay = QHBoxLayout() vlay.addLayout(hlay) self.nameLabel = QLabel('Name:', self) self.line = QLineEdit(self) self.nameLabel2 = QLabel('Result', self) hlay.addWidget(self.nameLabel) hlay.addWidget(self.line) hlay.addWidget(self.nameLabel2) hlay.addItem(QSpacerItem(1000, 10, QSizePolicy.Expanding)) pybutton = QPushButton('Click me', self) pybutton.clicked.connect(self.clickMethod) hlay2 = QHBoxLayout() hlay2.addWidget(pybutton) hlay2.addItem(QSpacerItem(1000, 10, QSizePolicy.Expanding)) vlay.addLayout(hlay2) m = WidgetPlot(self) vlay.addWidget(m)
def __init__(self): QMainWindow.__init__(self) icon = QIcon(ICON_IMAGE) self.setMinimumSize(300, 50) self.setWindowTitle("Echo VR Tray Tool") self.setWindowIcon(icon) main_widget = QWidget(self) self.setCentralWidget(main_widget) main_layout = QGridLayout(main_widget) discord_status_header = QLabel("Discord status:") discord_status_header.setFont(_HEADER_FONT) main_layout.addWidget(discord_status_header, 0, 0, Qt.AlignRight) self._discord_status_label = QLabel("Unknown") main_layout.addWidget(self._discord_status_label, 0, 1, Qt.AlignLeft) echo_vr_status_header = QLabel("Echo VR client status:") echo_vr_status_header.setFont(_HEADER_FONT) main_layout.addWidget(echo_vr_status_header, 1, 0, Qt.AlignRight) self._echo_vr_client_status_label = QLabel("Unknown") main_layout.addWidget(self._echo_vr_client_status_label, 1, 1, Qt.AlignLeft) main_layout.setRowStretch(2, 1) self.tray_icon = QSystemTrayIcon(icon, self) tray_menu = QMenu() show_action = QAction("Show", self) show_action.triggered.connect(self.show) tray_menu.addAction(show_action) quit_action = QAction("Exit", self) quit_action.triggered.connect(self._quit) tray_menu.addAction(quit_action) self.tray_icon.setContextMenu(tray_menu) self.tray_icon.show() self._discord_presence_thread = None self._start_discord_presence_thread()
def __init__(self): QMainWindow.__init__(self) self.setupUi(self) self.update_time() self.timer = QTimer() self.timer.setInterval(1000) self.timer.timeout.connect(self.update_time) self.timer.start() self.closeButton.clicked.connect(app.exit) self.closeButton.setVisible(False) self.setWindowState(QtCore.Qt.WindowState.WindowFullScreen) self.change_size(self.mainClock, 335) self.change_size(self.day, 55)
def __init__(self): Ui_MainWindow.__init__(self) QMainWindow.__init__(self) # Initialize UI self.setWindowTitle('Whiteboard Summarizer') # self.createGridLayout() # vbox = QVBoxLayout() # vbox.addWidget(self.groupBox) # self.setLayout(vbox) self.setupUi(self) # self.setupUi(self) self.file_Select_Btn.clicked.connect(self.selectVideo)
def __init__(self): QMainWindow.__init__(self) self.GROUP1 = "Group 1" self.GROUP2 = "Group 2" self.worksheets = {} self.selected = {} self.columns = {} self.FILE_SELECT = "File Select" self.setWindowTitle("Excel Column Merger") self.__init_ui() self.setCentralWidget(self.main) # Window dimensions geometry = qApp.desktop().availableGeometry(self) self.resize(900, 600)
def __init__(self): QMainWindow.__init__(self) self.setWindowTitle("tutorial") self._page = page() self._page.resize(800,500) self._page.load(self._page.initial_url) self._page.loadStarted.connect(lambda :self.toolbar.url_box.setText(self._page.url().url())) self.toolbar = Browser_Toolbar() self.toolbar.url_box.returnPressed.connect(lambda :self._page.setUrl(self.toolbar.url_box.text())) self.toolbar.reload.clicked.connect(lambda :self._page.reload()) self.toolbar.back.clicked.connect(lambda :self._page.back()) self.toolbar.next.clicked.connect(lambda :self._page.forward()) self.addToolBar(Qt.TopToolBarArea,self.toolbar) self.setCentralWidget(self._page)
def __init__(self): QMainWindow.__init__(self, MaxPlus.GetQMaxMainWindow()) self.resize(800, 600) self.setWindowTitle("Max Tools Updater") self.mainWidget = QWidget(self) self.central_layout = QVBoxLayout() menu_bar = QMenuBar() settingAct = QAction("&Settings", self) settingAct.setStatusTip("Open setting window") settingAct.connect(SIGNAL("triggered()"), self, SLOT("open()")) menu_bar.addAction(settingAct) self.mainWidget.setLayout(self.central_layout) self.central_layout.addWidget(menu_bar) self.tabs = QTabWidget() self.setCentralWidget(self.mainWidget) self.activePackageWidgets = list()
def __init__(self, widget): QMainWindow.__init__(self) self.setWindowTitle("Система массового обслуживанияи") self.resize(800, 600) # Menu self.menu = self.menuBar() self.file_menu = self.menu.addMenu("File") # Exit QAction exit_action = QAction("Exit", self) exit_action.setShortcut("Ctrl+Q") exit_action.triggered.connect(self.exit_app) self.file_menu.addAction(exit_action) self.setCentralWidget(widget)
def __init__(self, title="Jade Application Kit", icon=False, transparent=False, toolbar="", parent=None): """ * :param title:str * :param icon:str * :param transparent:bool * :param toolbar:dict * :param parent: Parent widget """ QMainWindow.__init__(self) self.title = title self.video_corner = False self.center = QDesktopWidget().availableGeometry().center() self.setAttribute(Qt.WA_DeleteOnClose, True) self.setWindowTitle(title) if icon and os.path.isfile(icon): self.icon = QIcon(icon) else: # TODO detect active icon theme QIcon.setThemeName("Papirus-Maia") icon_paths = QIcon.themeSearchPaths() icon_paths.append("/usr/share/pixmaps") QIcon.setThemeSearchPaths(icon_paths) self.icon = QIcon.fromTheme("applications-internet") view = Instance.retrieve("view") if view: self.view = view self.setCentralWidget(self.view) self.view.page().titleChanged.connect(self.status_message) self.view.iconChanged.connect(self._icon_changed) if transparent: # Set Background Transparency self.setAttribute(Qt.WA_TranslucentBackground, True) self.setAutoFillBackground(True) self.toolbar = JToolbar(self, toolbar, self.icon, title) self.addToolBar(self.toolbar) # self.addToolBar(Qt.RightToolBarArea, self.bar) self.system_tray = SystemTrayIcon(self.icon, self, self.title) self._set_icons()
def __init__(self, parent=None): QMainWindow.__init__(self, parent) self._main = QWidget() self.setCentralWidget(self._main) #left side controls #self.canvas = CartopyCanvas(self.fig) self.canvas = CartopyCanvas() # self.canvas.draw_waves('VHM0_SW1') self.canvas.mpl_connect("button_release_event", self.on_click) #3:00, 6:00, 9:00, 12:00, 15:00 18:00 21:00 00:00 self.slider = QSlider(minimum=0, maximum=8, orientation=Qt.Horizontal) #self.dial = QDial() #self.dial.setRange(0, 7) #self.dial.setSingleStep(1) #widget = QSlider() #widget.setMinimum(-10) # Left layout llayout = QVBoxLayout() llayout.setContentsMargins(1, 1, 1, 1) llayout.addWidget(self.canvas, 88) llayout.addWidget(QLabel("time and date:"), 1) llayout.addWidget(self.slider, 1) #right side controls # Table (Right) self.table = QTableWidget() # ComboBox (Right) self.combo = QComboBox() self.combo.addItems(["Primary swell", "Secondary swell", "Wind swell"]) # Right layout rlayout = QVBoxLayout() rlayout.setContentsMargins(1, 1, 1, 1) rlayout.addWidget(QLabel("Wave type:")) rlayout.addWidget(self.combo) rlayout.addWidget(self.table) # Main layout layout = QHBoxLayout(self._main) layout.addLayout(llayout, 70) layout.addLayout(rlayout, 30) self.combo.currentTextChanged.connect(self.combo_option) self.slider.valueChanged.connect(self.slider_changed)
def __init__(self): QMainWindow.__init__(self) self.setFixedSize(400, 100) self.setWindowTitle("PyPRad") # Icon made by https://www.flaticon.com/authors/freepik self.setWindowIcon(QIcon("icon.png")) self.setWindowIconText("PyPRad") self.current_stream = "https://kathy.torontocast.com:3060/stream" # Add a Stream URL. Default URL # Setup Media Player self.player = QMediaPlayer(self, QMediaPlayer.StreamPlayback) self.player.setMedia(QUrl(self.current_stream)) # Connect Button connect_btn = QPushButton("Connect To Stream") connect_btn.setFixedWidth(150) connect_btn.clicked.connect(self.connectStream) # Play Button self.play = QPushButton() self.play.setIcon(self.style().standardIcon(QStyle.SP_MediaPlay)) self.play.setFixedWidth(100) self.play.clicked.connect(self.playStream) # Volume Slider slider = QSlider(Qt.Horizontal) slider.setRange(0, 100) slider.setFixedWidth(100) slider.setValue(100) slider.valueChanged.connect(self.setVolume) # Horizontal Layout hbox_layout = QHBoxLayout() hbox_layout.setContentsMargins(0, 0, 0, 0) hbox_layout.addWidget(connect_btn) hbox_layout.addWidget(self.play) hbox_layout.addWidget(slider) widget = QWidget() widget.setLayout(hbox_layout) self.player.stateChanged.connect(self.mediaStateChanged) self.setCentralWidget(widget)
def __init__(self): QMainWindow.__init__(self) self.setupUi(self) self.pushButton_2.clicked.connect(self.create_images) self.path = os.path.dirname(os.path.abspath(__file__)) self.shapes = np.array( list(range(1, 21)) + list(range(26, 32)) + list(range(37, 41)) + [62, 63, 70, 71]) self.no_img = 20 image1 = QPixmap("{}/{}/create.png".format(self.path, "icon")) icon1 = QIcon(image1) self.pushButton_2.setIcon(icon1) self.pushButton_2.setIconSize(QSize(500, 500)) image2 = QPixmap("{}/{}/print.png".format(self.path, "icon")) icon2 = QIcon(image2) self.pushButton.setIcon(icon2) self.pushButton.setIconSize(QSize(300, 300))
def __init__(self): # Main window - Properties QMainWindow.__init__(self) self.setAttribute(Qt.WA_DeleteOnClose) self.setWindowTitle("ECoG Analyzer") self.dm = DataManager(250) self.chm = MyChartManager(self.dm) self.algManager = AlgorithmsManager(self.dm, self.chm) self.fileManager = FileManager() chartArea = ChartArea(self.chm) self.setCentralWidget(chartArea) self.setupMenu() self.setupToolbar() self.setupDockWidgets()
def __init__(self): QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) self.webcam_frame = None self.processed_webcam_frame = None self.face_detection_enabled = False # Load the haarcascade classifier file for face detection self.face_detection_cascade = cv2.CascadeClassifier( './opencv_haarcascade_data/haarcascade_frontalface_default.xml') self.timer = QTimer(self) self.startWebcamButton.clicked.connect(self.start_webcam_clicked) self.stopWebcamButton.clicked.connect(self.stop_webcam_clicked) self.faceDetectionButton.setCheckable(True) self.faceDetectionButton.toggled.connect(self.face_detection_clicked) # Connect the timeout signal from the QTimer instance to a slot. self.timer.timeout.connect(self.update_webcam_frame)
def __init__(self): QMainWindow.__init__(self) self.scaleFactor = 1.0 self.imageLabel = QLabel() self.imageLabel.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) self.imageLabel.setScaledContents(True) self.imageLabel.show() self.markers = Markers(self.imageLabel, IMG_FILE[:-3] + "json") km = KeysManager(self.markers) self.scrollArea = MyScrollArea(self.zoom, self.click, km.keyEventKB) self.scrollArea.setWidget(self.imageLabel) self.scrollArea.setVisible(False)
def __init__(self, layout): QMainWindow.__init__(self) self.setWindowTitle("Lissajous Application") # Menu self.menu = self.menuBar() self.file_menu = self.menu.addMenu("File") # Exit QAction exit_action = QAction("Exit", self) exit_action.setShortcut("Ctrl+Q") exit_action.triggered.connect(self.exit_app) self.file_menu.addAction(exit_action) widget = QWidget() widget.setLayout(layout) self.setCentralWidget(widget)
def __init__(self): QMainWindow.__init__(self) self.settings = QSettings('karoStudio', 'rt-stats') self.resize(self.settings.value('main/size', QSize(640, 480))) self.move(self.settings.value('main/pos', QPoint(200, 200))) self.ds = DataSource() cats = self.ds.get_categories() self.layout = QGridLayout() list_cats = QWidget() list_cats.setLayout(self.layout) self.content = QScrollArea() for row, cat in enumerate(cats): lbl = QPushButton(cat['title']) lbl.setFont(QFont(pointSize=70)) self.layout.addWidget(lbl, row, 0, Qt.AlignTop) self.content.setViewport(list_cats) self.setCentralWidget(self.content)
def __init__(self): QMainWindow.__init__(self) self.setWindowTitle("SR test") self.setWindowIcon(QIcon("assets/icons/logo-dark.png")) self.setGeometry(150, 150, 1470, 750) self.setStyleSheet('QMainWindow{background-color: #F4F7F9;}') self.SmpRptDbase = Database("sr-data.db") self.CenterPane = CenterPanel(self) self.setCentralWidget(self.CenterPane) # self.MenuBar = MenuToolBar(self) self.StatBar = self.statusBar() self.SetStatusBar()
def __init__(self): QMainWindow.__init__(self, parent=None) self.settings = QSettings(ORGANIZATION_STR) self.toolbar = self.createToolBar() self.widget = QWidget(self) self.layout = QVBoxLayout(self.widget) self.layout.setContentsMargins(1, 1, 1, 1) self.currentWidget = None self.editor = QTextEdit() self.editor.setAcceptRichText(False) font = QFontDatabase.systemFont(QFontDatabase.FixedFont) fs = int(self.settings.value("fontSize", 13)) font.setPointSize(fs) self.editor.setFont(font) self.preview = MarkdownRenderer() self.layout.addWidget(self.toolbar) self.widget.setLayout(self.layout) self.showWidget(self.editor) self.addToolBar(self.toolbar) self.setCentralWidget(self.widget) self.setWindowTitle(BASIC_TITLE) self.nbManager = NotebookManager() self.currentNotebook = None self.currentNote = None self.dirty = False self.editor.document().modificationChanged.connect(self.editorModified) self.updateUI() if len(self.nbManager.notebooks()) > 0: self.switchNotebook(self.nbManager.notebooks()[0].name) self.createTrayIcon() self.readConfig()
def __init__(self): # Initializing window and UI QMainWindow.__init__(self) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.setWindowTitle("Time Calculation App") # Initializing Results Section headers = [ 'Machine', 'Planet', 'Labor (Hrs)', 'Machine Time (Hrs)', 'Setup (Hrs)', 'Test Run (Hrs)', 'Coating (Hrs)', 'Quantity', 'Yield', 'Scrap', '' ] self.results = TableView(headers, self, 0, len(headers)) self.results.setParent(self.ui.resultsContainer) # self.results.setFixedWidth(1265) self.results.setFixedWidth(self.ui.resultsContainer.width()) self.results.setFixedHeight(self.ui.resultsContainer.height()) # Initialize variables needed self.machines = [ Machine(), Machine(), Machine() ] # TODO: restructure to have planets w workorders in machines self.techID = None self.theme = 1 # Initialize pie chart widgets and set theme self.initPieCharts() self.toggleTheme() # Connect Signals and Slots self.ui.addWorkOrderButton.clicked.connect( lambda: self.showWOInitDialog()) self.ui.planetConfigButton.clicked.connect( lambda: self.showPlanetConfigDialog()) self.ui.randomButton.clicked.connect( lambda: self.loadRandomWorkOrders()) self.ui.clearButton.clicked.connect(lambda: self.reInit()) self.ui.themeButton.clicked.connect(lambda: self.toggleTheme()) self.themeChanged.connect(lambda: self.results.setBG()) self.ui.actionSave.triggered.connect(self.browseForFile_save) self.ui.actionLoad.triggered.connect(self.browseForFile_load) self.ui.techIDbutton.toggled.connect(self.setTechID) self.connectMachineSignals()
def __init__(self): QMainWindow.__init__(self) self.model = None self.view = None self.setupUi(self) self.create_action_groups() # A dict Action name -> GeneralView, so that we can set the # correct view upon view type action trigger self.action_views = dict() self.actionAbout_2.triggered.connect(self.show_about_dialog) self.actionDocumentation.triggered.connect(self.show_help) self.actionChange_dimensions.triggered.connect( self.show_dimensions_dialog) self.actionChange_tile_size.triggered.connect( self.show_block_size_dialog) self.actionGenerate.triggered.connect(self.start_covering) self.model_type_changed.connect(self.update_model_type) self.model_type_changed.connect(self.update_view_type_menu) self.model_type_changed.connect(self.update_constraints_menu) self.model_type_changed.connect(self.enable_model_menu_buttons) self.model_changed.connect( lambda _: self.info_updated.emit(self.model, self.view)) self.view_type_changed.connect(self.update_view_type) self.view_changed.connect( lambda _: self.info_updated.emit(self.model, self.view)) self.info_updated.connect(self.infoText.update) self.info_updated.connect(self.update_view) self.tiles_list_model = BlockListModel() self.tilesList.setModel(self.tiles_list_model) self.model_changed.connect(self.tiles_list_model.update_data) self.tiles_list_model.checkedChanged.connect(self.set_block_visibility) self.model_changed.emit(self.model) self.update_view_type_menu()
def __init__(self, parent=None, imagePath="", scribbleImagePath=""): QMainWindow.__init__(self, parent) pyside_dynamic.loadUi('mainWindow.ui', self) self.show() self.setWindowTitle("BaBa - Scribble") # connections self.bodenBtn.clicked.connect(lambda: self.changedPen('boden')) self.baumBtn.clicked.connect(lambda: self.changedPen('baum')) self.radiergummiBtn.clicked.connect( lambda: self.changedPen('radiergummi')) self.bodenSlider.valueChanged.connect(self.refreshSliderValues) self.baumSlider.valueChanged.connect(self.refreshSliderValues) self.radiergummiSlider.valueChanged.connect(self.refreshSliderValues) self.okBtn.clicked.connect(self.okAction) # menu self.penType = 'boden' self.sliderValues = { "boden": self.bodenSlider.value(), "baum": self.baumSlider.value(), "radiergummi": self.radiergummiSlider.value() } # dimensions self.imageAreaWidth = 0 self.imageAreaHeight = 0 # Image self.imagePath = imagePath self.imagePixmap = QPixmap(self.imagePath) self.imageLabel = QLabel(self.pictureArea) self.imageLabel.setAlignment(Qt.AlignTop) self.imageLabel.show() # Scribble self.scribble = Scribble(self.pictureArea, scribbleImagePath) self.scribble.setupScribble(self.imagePixmap.width(), self.imagePixmap.height()) self.scribbleMat = None # refreshes and reloads: initial trigger self.refreshSliderValues() self.refreshDimensions()
def __init__(self): QMainWindow.__init__(self) MainWindow.INSTANCE = self self.ui = Ui_MainWindow() self.ui.setupUi(self) self.bisect_runner = BisectRunner(self) self.single_runner = SingleBuildRunner(self) self.current_runner = None self.bisect_runner.worker_created.connect( self.ui.report_view.model().attach_bisector) self.single_runner.worker_created.connect( self.ui.report_view.model().attach_single_runner) self.ui.report_view.model().need_evaluate_editor.connect( self.bisect_runner.open_evaluate_editor) self.ui.report_view.step_report_changed.connect( self.ui.build_info_browser.update_content) self.report_delegate = ReportItemDelegate() self.report_delegate.got_verdict.connect( self.bisect_runner.set_verdict) self.ui.report_view.setItemDelegateForColumn(0, self.report_delegate) for runner in (self.bisect_runner, self.single_runner): runner.running_state_changed.connect( self.ui.actionStart_a_new_bisection.setDisabled) runner.running_state_changed.connect( self.ui.actionStop_the_bisection.setEnabled) runner.running_state_changed.connect( self.ui.actionRun_a_single_build.setDisabled) self.persist = mkdtemp() self.read_settings() initialize_telemetry(get_prefs()["enable_telemetry"]) # Make sure the toolbar and logviews are visible (in case # the user manually turned them off in a previous release # where this was possible) self.ui.toolBar.setVisible(True) self.ui.log_view.setVisible(True) self.ui.logDockWidget.setVisible(True)
def __init__(self): QMainWindow.__init__(self) set0 = QtCharts.QBarSet("Jane") set1 = QtCharts.QBarSet("John") set2 = QtCharts.QBarSet("Axel") set3 = QtCharts.QBarSet("Mary") set4 = QtCharts.QBarSet("Samantha") set0.append([1, 2, 3, 4, 5, 6]) set1.append([5, 0, 0, 4, 0, 7]) set2.append([3, 5, 8, 13, 8, 5]) set3.append([5, 6, 7, 3, 4, 5]) set4.append([9, 7, 5, 3, 1, 2]) series = QtCharts.QPercentBarSeries() series.append(set0) series.append(set1) series.append(set2) series.append(set3) series.append(set4) chart = QtCharts.QChart() chart.addSeries(series) chart.setTitle("Simple percentbarchart example") chart.setAnimationOptions(QtCharts.QChart.SeriesAnimations) categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] axis = QtCharts.QBarCategoryAxis() axis.append(categories) chart.createDefaultAxes() chart.setAxisX(axis, series) chart.legend().setVisible(True) chart.legend().setAlignment(Qt.AlignBottom) chart_view = QtCharts.QChartView(chart) chart_view.setRenderHint(QPainter.Antialiasing) self.setCentralWidget(chart_view)
def __init__(self, parent = None): QMainWindow.__init__(self, parent)
def __init__(self): QMainWindow.__init__(self)