How to use the qdarkstyle.load_stylesheet_pyqt function in QDarkStyle

To help you get started, we’ve selected a few QDarkStyle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyrocko / pyrocko / src / gui / sparrow / main.py View on Github external
from pyrocko import util
    util.setup_logging('sparrow', 'info')

    global app
    global win

    if app is None:
        app = App()

        try:
            import qdarkstyle

            if use_pyqt5:
                app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
            else:
                app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt())

        except ImportError:
            logger.info(
                'Module qdarkstyle not available.\n'
                'If wanted, install qdarkstyle with "pip install qdarkstyle".')

    win = Viewer(*args, **kwargs)
    app.set_main_window(win)

    app.install_sigint_handler()
    app.exec_()
    app.uninstall_sigint_handler()

    app.set_main_window(None)

    del win
github plasmax / PythonEditor / PythonEditor / IDE.py View on Github external
super(IDE, self).showEvent(event)

if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
    ide = IDE()

    try:
        import qdarkstyle
        app.setStyleSheet(qdarkstyle.load_stylesheet_pyside())
    except ImportError:
        qdarkstyledir = os.path.join(os.path.dirname(__file__), 'qdarkstyle')
        if os.path.isdir(qdarkstyledir):
            sys.path.append(qdarkstyledir)
            import qdarkstyle
            app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt())
            print('QDarkStyle not found')

    ide.show()
    app.exec_()