def __init__(self, expression_to_neutral=False): super().__init__() self.expression_to_neutral = expression_to_neutral if self.expression_to_neutral: self.title = "From Expression to Neutral" else: self.title = "3DMM" self.setWindowIcon(QtGui.QIcon('images/1UP.ico')) self.setFixedSize(1200, 700) self.camera = Camera() self.progress_bar = QProgressBar(self) self.count = 0 self.toolbar = self.addToolBar('Main Window') # self.toolbar_emotions = self.addToolBar('Emotions') self.expression = "neutral" self.picture_taken = False self.bool_onclick = None self.portrait = None self.model = Model(None, self.expression, self, self.expression_to_neutral) self.video_widget = VideoWidget(self.camera) self.right_label = RightLabel(self, self.model) self.main_widget = MainWidget(self.video_widget, self.right_label, self.camera) self.setCentralWidget(self.main_widget) self.model.progress_bar.connect(self.set_progress_bar, type=Qt.QueuedConnection) self.combo_box = QComboBox(self) self.initUI()
def __init__(self, camera): super().__init__() self.title = "3DMM" # self.setWindowIcon(QtGui.QIcon('images/1UP.ico')) # self.setFixedSize(1200, 700) # self.setGeometry(500, 100, 1200, 700) # self.right_label = RightLabel(self, self.model) self.camera = camera self.main_widget = MainWidget(self.camera, True)
def __init__(self): self.main_widget = MainWidget() self.register_widget = RegisterWidget() self.info_window_widget = InfoWindowWidget() self.login_widget = LoginWidget() self.add_medical_record_widget = AddMedicalRecordWidget() self.show_medical_record_widget = ShowMedicalRecordWidget() self.update_medical_record_widget = UpdateMedicalRecordWidget() self.init_slots() self.init_connects() return
def init_UI(self): ## Set the theme self.set_stylesheet(self.opts["theme"]) self.profiles = read_profiles() self.mainWidget = MainWidget(self) self.statusBar() self.build_menu_bar() self.setCentralWidget(self.mainWidget) self.resize(WINDOW_WIDTH, WINDOW_HEIGHT) self.center_window() self.setWindowTitle("qYoutube-DL") self.show()
def __init__(self): super().__init__() # Styling self.setWindowTitle('WebPanes version 0.1') self.width = 800 self.height = 600 self.top = 200 self.left = 400 self.setWindowIcon(QtGui.QIcon('icon.png')) self.setGeometry(self.left, self.top, self.width, self.height) self.setStyleSheet('background: white') # Main widget self.mainWidget = MainWidget() self.setCentralWidget(self.mainWidget) # Toolbar self.gridToolbar = GridToolbar(self.mainWidget) self.addToolBar(self.gridToolbar)
def initUI(self): self.name_company = 'TU Berlin' self.name_product = 'Editor' self.scene = Scene() self.createActions() self.createMenus() self.createToolBars() #self.updateMenus() self.readSettings() # create node editor widget self.editor = MainWidget(self) self.setCentralWidget(self.editor) # status bar # self.createStatusBar() # set window properties self.setGeometry(200, 200, 800, 600) self.setWindowTitle("Editor") self.show()
def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.mainWidget = MainWidget() self.setCentralWidget(self.mainWidget)
def main(): app = QApplication(sys.argv) widget = MainWidget() sys.exit(app.exec_()) widget = widget
def __init__(self): super().__init__() self.main_widget = MainWidget(parent_window=self) self.setCentralWidget(self.main_widget) self.statusBar().showMessage('Ready') self.statusbar_label = QLabel("0/0") self.statusBar().addPermanentWidget(self.statusbar_label) menubar = self.menuBar() self.is_ordered = False self.setWindowTitle("Data Analysis App") # add submenus to a menu file_menu = menubar.addMenu('File') help_menu = menubar.addMenu('Help') # add an action with a callback file_menu.addAction('Quit', self.destroy) # add separator file_menu.addSeparator() toolbar = self.addToolBar('File') toolbar.setMovable(False) toolbar.setFloatable(False) toolbar.setAllowedAreas(Qt.TopToolBarArea | Qt.BottomToolBarArea) dock = QDockWidget("Tools") dock_loaders_widget = QWidget(self) dock_preprocess_widget = QWidget(self) dock_regression_widget = QWidget(self) dock_classification_widget = QWidget(self) dock_clustering_widget = QWidget(self) dock_visualization_widget = QWidget(self) dock_demux_widget = QWidget(self) nodes_list_loaders = DragList() nodes_list_preprocess = DragList() nodes_list_regression = DragList() nodes_list_classification = DragList() nodes_list_clustering = DragList() nodes_list_visualization = DragList() nodes_list_demux = DragList() nodes_list_loaders.add_items( ['Csv Loader', 'Excel Loader', "Xml Loader", "Deserializer"], icon="icons/input24.png") nodes_list_preprocess.add_items(['Attribute Remover', 'Filter'], icon="icons/both24.png") nodes_list_regression.add_items(['Linear Regression'], icon="icons/both24.png") nodes_list_classification.add_items( ['Knn', 'SVM', 'Naive Bayes', 'Decision Tree'], icon="icons/both24.png") nodes_list_clustering.add_items(['K-Means', "Hierarchical"], icon="icons/both24.png") nodes_list_visualization.add_items([ "Text output", "Scatter plot", "Pie Chart", "Predictor", "Serializer", "Simple Plot", "Histogram", "Csv Saver" ], icon="icons/output24.png") nodes_list_demux.add_items( ["1x2 Demux", "1x3 Demux", "1x4 Demux", "1x5 Demux"], icon="icons/demux.png") self.addDockWidget(Qt.LeftDockWidgetArea, dock) tab_widget = QTabWidget() tab_widget.setMovable(False) tab_widget.setTabPosition(QTabWidget.West) tab_widget.resize(100, 100) dock_layout_loaders = QHBoxLayout() dock_layout_preprocess = QHBoxLayout() dock_layout_regression = QHBoxLayout() dock_layout_classification = QHBoxLayout() dock_layout_clustering = QHBoxLayout() dock_layout_visualization = QHBoxLayout() dock_layout_demux = QHBoxLayout() dock_loaders_widget.setLayout(dock_layout_loaders) dock_preprocess_widget.setLayout(dock_layout_preprocess) dock_regression_widget.setLayout(dock_layout_regression) dock_classification_widget.setLayout(dock_layout_classification) dock_clustering_widget.setLayout(dock_layout_clustering) dock_visualization_widget.setLayout(dock_layout_visualization) dock_demux_widget.setLayout(dock_layout_demux) # dock_layout.addWidget(tab_widget) dock_layout_loaders.addWidget(nodes_list_loaders) dock_layout_preprocess.addWidget(nodes_list_preprocess) dock_layout_regression.addWidget(nodes_list_regression) dock_layout_classification.addWidget(nodes_list_classification) dock_layout_clustering.addWidget(nodes_list_clustering) dock_layout_visualization.addWidget(nodes_list_visualization) dock_layout_demux.addWidget(nodes_list_demux) tab_widget.addTab(dock_loaders_widget, 'Inputs') tab_widget.addTab(dock_preprocess_widget, 'Preprocessors') tab_widget.addTab(dock_regression_widget, 'Regression') tab_widget.addTab(dock_classification_widget, 'Classification') tab_widget.addTab(dock_clustering_widget, 'Clustering') tab_widget.addTab(dock_visualization_widget, 'Output') tab_widget.addTab(dock_demux_widget, "Demux") dock.setWidget(tab_widget) help_menu.addAction('About', self.show_about_dialog) help_menu.addAction("Credits", self.credits) help_menu.addAction("Node List", self._log_path) self.show()
import sys from PySide2.QtWidgets import ( QApplication, ) from main_widget import MainWidget if __name__ == "__main__": tiny_linter_app = QApplication(sys.argv) main_widget = MainWidget() main_widget.resize(800, 600) main_widget.show() sys.exit(tiny_linter_app.exec_())
def __init__(self, data_provider): super().__init__() self.setCentralWidget(MainWidget(data_provider))
import sys from PySide2.QtWidgets import QApplication from main_widget import MainWidget from main_window import MainWindow if __name__ == "__main__": app = QApplication() # app.setStyle('gtk') widget = MainWidget() window = MainWindow(widget) window.show() sys.exit(app.exec_())
def __init__(self): super().__init__() self.setCentralWidget(MainWidget())
import sys import qdarkstyle if __name__ == '__main__': x = 0 y = 0 x1 = 0 y1 = 0 z = 0 z1 = 0 list_z = [] nose_tmp = np.array([0, 0]) app = QApplication(sys.argv) app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5()) frontal_camera = Camera(0) mainWid = MainWidget(frontal_camera) mainWid.activate() pygame.init() display = (800, 600) pygame.display.set_mode(display, DOUBLEBUF | OPENGL) gluPerspective(45, (display[0] / display[1]), 0.1, 50.0) glLightfv(GL_LIGHT0, GL_POSITION, (-40, 200, 100, 0.0)) glLightfv(GL_LIGHT0, GL_AMBIENT, (0.2, 0.2, 0.2, 1.0)) glLightfv(GL_LIGHT0, GL_DIFFUSE, (0.5, 0.5, 0.5, 1.0)) glEnable(GL_LIGHT0) glEnable(GL_LIGHTING) glEnable(GL_COLOR_MATERIAL) glEnable(GL_DEPTH_TEST) glShadeModel(GL_SMOOTH) glTranslate(0, -2, -5)
def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.setWindowFlags(Qt.FramelessWindowHint) self.setAttribute(Qt.WA_TranslucentBackground) central_widget = QWidget() main_layout = QGridLayout() # noinspection PyUnresolvedReferences if parser_args.type == 'formation': dis_label = QLabel("Синхронный полет") num_label = QLabel("Formation_1 ({})".format(counter)) else: dis_label = QLabel("Командная гонка") num_label = QLabel("Race_1 ({})".format(counter)) # noinspection PyUnresolvedReferences name_label = QLabel("{}".format(str(parser_args.team))) dis_label.setStyleSheet("QLabel { background-color: #808080; color: white; font-size: 24px; }") name_label.setStyleSheet("QLabel { background-color: #808080; color: white; font-size: 24px; }") num_label.setStyleSheet("QLabel { background-color: #808080; color: white; font-size: 24px; }") dis_label.setFixedHeight(LABEL_HEIGHT) name_label.setFixedHeight(LABEL_HEIGHT) num_label.setFixedHeight(LABEL_HEIGHT) dis_label.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) name_label.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) num_label.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) main_layout.addWidget(dis_label, 0, 0) main_layout.addWidget(name_label, 0, 1) main_layout.addWidget(num_label, 0, 2) main_layout.setColumnStretch(0, 1) main_layout.setColumnStretch(1, 3) main_layout.setColumnStretch(2, 3) # noinspection PyUnresolvedReferences if parser_args.type == 'formation': self.main_widget = MainWidget(formation=True) else: self.main_widget = MainWidget(formation=False) main_layout.addWidget(self.main_widget, 1, 0) main_layout.setAlignment(Qt.AlignRight) central_widget.setLayout(main_layout) self.setCentralWidget(central_widget) rospy.init_node('ui', anonymous=True) rospy.Subscriber('/collisions', String, self.main_widget.collisions_cb) rospy.Subscriber('/final', String, self.main_widget.final_cb) # noinspection PyUnresolvedReferences if parser_args.type == 'formation': rospy.Subscriber('/side_time', String, self.main_widget.side_time_cb) rospy.Subscriber('/msd_current', String, self.main_widget.msd_current_cb) rospy.Subscriber('/msd_overall', String, self.main_widget.msd_overall_cb) rospy.Subscriber('/reformation', String, self.main_widget.reformation_cb) else: rospy.Subscriber('/passes', String, self.main_widget.passes_cb) rospy.Subscriber('/times', String, self.main_widget.times_cb)
def main_window(self) -> None: self.setCentralWidget(MainWidget(self))
def _init_ui(self): central_widget = MainWidget(parent=self) self.setCentralWidget(central_widget)
import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import * from main_widget import MainWidget app = QApplication(sys.argv) # set icon for application window_icon = QIcon("./resources/srt.ico") if not window_icon.isNull(): app.setWindowIcon(window_icon) form = MainWidget() form.show() app.exec_()