def main():
    """
    Application entry point
    """
    logging.basicConfig(level=logging.DEBUG)
    # create the application and the main window
    app = QtWidgets.QApplication(sys.argv)
    window = QtWidgets.QMainWindow()

    # setup ui
    ui = example_ui.Ui_MainWindow()
    ui.setupUi(window)
    ui.bt_delay_popup.addActions([ui.actionAction, ui.actionAction_C])
    ui.bt_instant_popup.addActions([ui.actionAction, ui.actionAction_C])
    ui.bt_menu_button_popup.addActions([ui.actionAction, ui.actionAction_C])
    window.setWindowTitle('QDarkGrayStyle example')

    # tabify dock widgets to show bug #6
    window.tabifyDockWidget(ui.dockWidget1, ui.dockWidget2)

    # setup stylesheet
    app.setStyleSheet(qdarkgraystyle.load_stylesheet_pyqt5())

    # auto quit after 2s when testing on travis-ci
    if '--travis' in sys.argv:
        QtCore.QTimer.singleShot(2000, app.exit)

    # run
    window.show()
    app.exec_()
Beispiel #2
0
    def __init__(self):
        super(Pynocchio, self).__init__(sys.argv)
        self.setOrganizationName('Pynocchio')
        self.setApplicationName('Pynocchio')

        self.setStyle('Fusion')
        self.setStyleSheet(qdarkgraystyle.load_stylesheet_pyqt5())

        if hasattr(self, 'setApplicationDisplayName'):
            self.setApplicationDisplayName('Pynocchio')

        for path in DATADIRS:
            self.addLibraryPath(path)

        translator = QTranslator(self)
        language = QLocale.system().uiLanguages()[0] + '.qm'

        for path in DATADIRS:
            if translator.load(language, os.path.join(path, 'locale')):
                break
        qt_translator = QTranslator(self)
        qt_translator.load(
            'qt_' + QLocale.system().name(),
            QLibraryInfo.location(QLibraryInfo.TranslationsPath))
        self.installTranslator(translator)
        self.installTranslator(qt_translator)

        self.model = MainWindowModel()
        self.view = MainWindowView(self.model)
Beispiel #3
0
    def __init__(self, *args, **kwargs):

        # Calling GUI from GUI file
        super().__init__(*args, **kwargs)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.closeEvent = self.closeEvent

        # Internal result saver
        self.r = None

        # Configuration
        self._setDefaults()
        self._connectButtons()
        self._createMatplotlibCanvas()
        self.setStyleSheet(qdarkgraystyle.load_stylesheet_pyqt5())
        self.ui.codeEditor.setStyleSheet(
            f"background-color: rgb(255,255,255); color: rgb(0,0,0);font-size: 16px"
        )

        # Threadpool for worker computations
        # self.threadpool = QThreadPool()
        self.worker = None
        self.receiver_emitter = None
        self.testNumber = 0
        # Show
        self.showMaximized()
        self.ui.codeEditor.appendPlainText("def mySort(arr):\n"
                                           "\t#Your code goes here\n"
                                           "\treturn arr")

        self.ui.infoTextEdit.setStyleSheet("font-size: 16px")
        self.ui.logsTextEdit.setStyleSheet("font-size: 16px")
Beispiel #4
0
 def toggle_dark(self):
     """
     Toggles our dark theme
     """
     do_dark = self.toolbar.action_dark.isChecked()
     self.settings.setValue('toggles/darktheme', do_dark)
     if do_dark:
         self.app.setStyleSheet(qdarkgraystyle.load_stylesheet_pyqt5())
     else:
         self.app.setStyleSheet('')
     self.display.updateText()
Beispiel #5
0
    def set_style(self, name: str = 'Gray Dark'):
        q_app = QApplication.instance()
        if not q_app:
            raise RuntimeError('No running application found.')
        if name == 'Dark':
            q_app.setStyleSheet('')
            q_app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
        elif name == 'Gray Dark':
            q_app.setStyleSheet('')
            q_app.setStyleSheet(qdarkgraystyle.load_stylesheet_pyqt5())
        else:
            return

        self.app.fm.config['style'] = name
        layout.addWidget(label)

        btn = QPushButton("xx2")
        layout.addWidget(btn)

        cb = QComboBox()
        cb.addItems(["1", "2", "3"])
        layout.addWidget(cb)


        sb = QSpinBox()
        layout.addWidget(sb)




if __name__ == '__main__':
    import sys
    app = QApplication(sys.argv)

    window = Window()
    window.show()

    import qdarkgraystyle

    style_sheet = qdarkgraystyle.load_stylesheet_pyqt5()
    print(style_sheet)
    app.setStyleSheet(style_sheet)


    sys.exit(app.exec_())
Beispiel #7
0
        self.openGLWidget.matrix = self.smatrix
        self.openGLWidget.displayflag = 2
        self.openGLWidget.updateflag = 1

    def Displayvmatrixbuttonclicked(self):
        self.openGLWidget.matrix = self.vmatrix
        self.openGLWidget.displayflag = 2
        self.openGLWidget.updateflag = 1

    def Matrixcopy_8clicked(self):
        self.Matrixset(self.matrixbuffer, self.Displaysvdmatrixbox)

    def Matrixpaste_4clicked(self):
        self.Displayset(self.matrixbuffer, self.Displaysvdmatrixbox)

    def Matrixcopy_9clicked(self):
        self.Matrixset(self.matrixbuffer, self.Displayumatrixbox)

    def Matrixcopy_10clicked(self):
        self.Matrixset(self.matrixbuffer, self.Displaysmatrixbox)

    def Matrixcopy_11clicked(self):
        self.Matrixset(self.matrixbuffer, self.Displayvmatrixbox)


app = QtWidgets.QApplication(sys.argv)
app.setStyleSheet(qdarkgraystyle.load_stylesheet_pyqt5())
window = mainWindow()
window.setupUI()
window.show()
sys.exit(app.exec_())