{"id":13397071,"url":"https://github.com/ColinDuquesnoy/QDarkStyleSheet","last_synced_at":"2025-03-13T23:32:07.676Z","repository":{"id":4388771,"uuid":"5525736","full_name":"ColinDuquesnoy/QDarkStyleSheet","owner":"ColinDuquesnoy","description":"A dark style sheet for QtWidgets application ","archived":false,"fork":false,"pushed_at":"2024-06-19T15:39:02.000Z","size":21964,"stargazers_count":2824,"open_issues_count":54,"forks_count":729,"subscribers_count":89,"default_branch":"master","last_synced_at":"2024-10-29T10:18:03.707Z","etag":null,"topics":["dark-theme","pyqt4","pyqt5","pyside","qt","qt5","stylesheets"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ColinDuquesnoy.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE.rst","code_of_conduct":"CODE_OF_CONDUCT.rst","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-08-23T12:30:23.000Z","updated_at":"2024-10-29T06:52:26.000Z","dependencies_parsed_at":"2023-01-14T11:30:57.797Z","dependency_job_id":"7250d719-805c-48bb-8aa0-b1eec475610c","html_url":"https://github.com/ColinDuquesnoy/QDarkStyleSheet","commit_stats":{"total_commits":814,"total_committers":44,"mean_commits":18.5,"dds":0.6498771498771498,"last_synced_commit":"6f3962e63749893f951be73ebfec93e83fffebf2"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinDuquesnoy%2FQDarkStyleSheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinDuquesnoy%2FQDarkStyleSheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinDuquesnoy%2FQDarkStyleSheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinDuquesnoy%2FQDarkStyleSheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColinDuquesnoy","download_url":"https://codeload.github.com/ColinDuquesnoy/QDarkStyleSheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243112146,"owners_count":20238185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dark-theme","pyqt4","pyqt5","pyside","qt","qt5","stylesheets"],"created_at":"2024-07-30T18:01:10.504Z","updated_at":"2025-03-13T23:32:07.651Z","avatar_url":"https://github.com/ColinDuquesnoy.png","language":"Python","funding_links":[],"categories":["包","style\u0026\u0026widget","Python"],"sub_categories":["美化"],"readme":"QDarkStyleSheet\n===============\n\n|Build Status| |Docs Status| |Latest PyPI version| |License: MIT|\n|License: CC BY 4.0| |Conduct|\n\nThe most complete dark/light style sheet for Qt applications (Qt4*, Qt5,\nPySide*, PySide2, PySide6,  PyQt4*, PyQt5, PyQt6, QtPy, PyQtGraph, Qt.Py)\nfor Python 2*/3 and C++.\n\n`Check out the complete documentation. \u003chttps://qdarkstylesheet.readthedocs.io/en/latest/screenshots.html\u003e`__\n\n\nWhat is new?\n------------\n\n\nVersion 3\n~~~~~~~~~\n\nIn the current version 3, `qdarkstyle` is now working as a theme framework,\ncurrently for dark/light themes, keeping styled widgets identical throughout\ntheme colors.\n\nThe palette has been redefined and improved (UI/UX) to accept more colors\nand to be able to implement new themes thanks to the\n`Spyder team \u003chttps://github.com/spyder-ide/spyder\u003e`__ collaboration.\n\nThe current stable version is using Python 3 (preferable 3.6+) and Qt5\n(PyQt5 and PySide 2). Also in this version, an option for Qt6 (PyQt6, PySide6)\nwas added.\n\nThe current version for use with Qt6 may still present instabilities.\n\n[*] Python 2, as well as Qt4 (PyQt4 and PySide), will not be supported anymore.\nThey are still there as it is, but no back compatibility, fixes, nor features\nwill be implemented.\n\nVersion 2\n~~~~~~~~~\n\nWe moved to QtPy to simplify your code in v2.8, thus this is a required\ndependency now. We included special patches in three main categories:\noperating system, Qt/binding version, application.\n\nIncluded in that, lots of widgets' styles were included/fixed. A Qt\napplication example (Python only) with almost all types of widgets and\ncombinations were included to serve as a portfolio and a checklist for\nnew styles.\n\nWe have added SCSS in v2.7, so the palette can be accessed programmatically.\nAlso, many scripts were added to give freedom to developers who want to\nchange the colors of our palette. All images and icons were revised, also\ncreating SVG files for all of them.\n\nIn version 2.6 and later, a restructure stylesheet is provided. The\npalette has only 9 colors. Most widgets are revised and their styles\nwere improved. We also provide a command line (script) to get info that\ncould be used when opening issues. See the image below.\n\n\nVersion 1\n~~~~~~~~~\n\nFirst stable release of QDarkStyle.\n\n\nInstallation\n------------\n\n\nPython\n~~~~~~\n\nFrom PyPI: Get the latest stable version of ``qdarkstyle`` package using\n*pip* (preferable):\n\n    .. code:: bash\n\n        pip install qdarkstyle\n\n\nFrom code: Download/clone the project, go to ``qdarkstyle`` folder then:\n\n-  You can use the *setup* script and pip install.\n\n    .. code:: bash\n\n        pip install .\n\n\n-  Or, you can use the *setup* script with Python:\n\n    .. code:: bash\n\n        python setup.py install\n\n\nC++\n~~~\n\n- Download/clone the project and copy the following files to your\n  application directory (keep the existing directory hierarchy).\n  Substitute the all the **THEME** words by the currently available\n  (dark/light) the theme you need to use.\n\n    -  **qdarkstyle/THEME/THEMEstyle.qss**\n    -  **qdarkstyle/THEME/THEMEstyle.qrc**\n    -  **qdarkstyle/THEME/rc/** (the whole directory)\n\n\n-  Add **qdarkstyle/THEME/THEMEstyle.qrc** to your **.pro file** as follows:\n\n    .. code:: c++\n\n        RESOURCES += qdarkstyle/THEME/THEMEstyle.qrc\n\n\n-  Load the stylesheet:\n\n    .. code:: c++\n\n        QFile f(\":qdarkstyle/THEME/THEMEstyle.qss\");\n\n        if (!f.exists())   {\n            printf(\"Unable to set stylesheet, file not found\\n\");\n        }\n        else   {\n            f.open(QFile::ReadOnly | QFile::Text);\n            QTextStream ts(\u0026f);\n            qApp-\u003esetStyleSheet(ts.readAll());\n        }\n\n\nNote: The \":\" in the file name is necessary to define that file as a\nresource library. For more information see the discussion\n`here \u003chttps://github.com/ColinDuquesnoy/QDarkStyleSheet/pull/87\u003e`__.\n\n\nUsage in applications\n---------------------\n\n\nIf your project already uses QtPy or you need to set it programmatically,\nit is far more simple\n\n.. code:: python\n\n    import sys\n    import qdarkstyle\n    import os\n\n    # set the environment variable to use a specific wrapper\n    # it can be set to pyqt, pyqt5, pyside or pyside2 (not implemented yet)\n    # you do not need to use QtPy to set this variable\n    os.environ['QT_API'] = 'pyqt5'\n\n    # import from QtPy instead of doing it directly\n    # note that QtPy always uses PyQt5 API\n    from qtpy import QtWidgets\n\n    # create the application and the main window\n    app = QtWidgets.QApplication(sys.argv)\n    window = QtWidgets.QMainWindow()\n\n    # setup stylesheet\n    # the default system in qdarkstyle uses qtpy environment variable\n    app.setStyleSheet(qdarkstyle.load_stylesheet())\n\n    # run\n    window.show()\n    app.exec_()\n\n\nIf you are using PyQt5 directly, see the complete example\n\n.. code:: python\n\n    import sys\n    import qdarkstyle\n    from PyQt5 import QtWidgets\n\n    # create the application and the main window\n    app = QtWidgets.QApplication(sys.argv)\n    window = QtWidgets.QMainWindow()\n\n    # setup stylesheet\n    app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())\n    # or in new API\n    app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api='pyqt5'))\n\n    # run\n    window.show()\n    app.exec_()\n\n\nHere is an example using PySide2\n\n.. code:: python\n\n    import sys\n    import qdarkstyle\n    from PySide2 import QtWidgets\n\n    # create the application and the main window\n    app = QtWidgets.QApplication(sys.argv)\n    window = QtWidgets.QMainWindow()\n\n    # setup stylesheet\n    app.setStyleSheet(qdarkstyle.load_stylesheet_pyside2())\n    # or in new API\n    app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api='pyside2'))\n\n    # run\n    window.show()\n    app.exec_()\n\n\nIf you use PyQtGraph, then the code is\n\n.. code:: python\n\n    import sys\n    import qdarkstyle\n    import os\n\n    # set the environment variable to use a specific wrapper\n    # it can be set to PyQt, PyQt5, PySide or PySide2 (not implemented yet)\n    os.environ['PYQTGRAPH_QT_LIB'] = 'PyQt5'\n\n    # import from pyqtgraph instead of doing it directly\n    # note that PyQtGraph always uses PyQt4 API\n    from pyqtgraph.Qt import QtGui\n\n    # create the application and the main window\n    app = QtGui.QApplication(sys.argv)\n    window = QtGui.QMainWindow()\n\n    # setup stylesheet\n    app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api=os.environ['PYQTGRAPH_QT_LIB'])\n\n    # run\n    window.show()\n    app.exec_()\n\nIf you are using Qt.py, which is different from qtpy, you should install\nqtpy then set both to the same binding.\n\n\nUsage of example/portfolio\n--------------------------\n\n\nThere is an example included in the package. You only need to have PySide2 or\nPyQt5 is installed on your system.\n\n.. code:: bash\n\n    # dark theme example\n    $ qdarkstyle.example --palette=dark\n\n    # light theme example\n    $ qdarkstyle.example --palette=light\n\n    # no theme/style sheet applied\n    $ qdarkstyle.example --palette=none\n\n    # check all options included\n    $ qdarkstyle.example --help\n\n\nChangelog\n---------\n\nPlease, see `CHANGES \u003cCHANGES.rst\u003e`__ file.\n\n\nLicense\n-------\n\nThis project is licensed under the MIT license. Images contained in this\nproject is licensed under CC-BY license.\n\nFor more information see `LICENSE \u003cLICENSE.rst\u003e`__ file.\n\n\nAuthors\n-------\n\nFor more information see `AUTHORS \u003cAUTHORS.rst\u003e`__ file.\n\n\nContributing\n------------\n\nMost widgets have been styled. If you find a widget that has not been\nstyle, just open an issue on the issue tracker or, better, submit a pull\nrequest.\n\nIf you want to contribute, see `CONTRIBUTING \u003cCONTRIBUTING.rst\u003e`__ file.\n\n.. |Build Status| image:: https://travis-ci.org/ColinDuquesnoy/QDarkStyleSheet.png?branch=master\n   :target: https://travis-ci.org/ColinDuquesnoy/QDarkStyleSheet\n.. |Docs Status| image:: https://readthedocs.org/projects/qdarkstylesheet/badge/?version=latest\u0026style=flat\n   :target: https://qdarkstylesheet.readthedocs.io\n.. |Latest PyPI version| image:: https://img.shields.io/pypi/v/QDarkStyle.svg\n   :target: https://pypi.python.org/pypi/QDarkStyle\n.. |License: MIT| image:: https://img.shields.io/dub/l/vibe-d.svg?color=lightgrey\n   :target: https://opensource.org/licenses/MIT\n.. |License: CC BY 4.0| image:: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg\n   :target: https://creativecommons.org/licenses/by/4.0/\n.. |Conduct| image:: https://img.shields.io/badge/code%20of%20conduct-contributor%20covenant-green.svg?style=flat\u0026color=lightgrey\n   :target: http://contributor-covenant.org/version/1/4/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FColinDuquesnoy%2FQDarkStyleSheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FColinDuquesnoy%2FQDarkStyleSheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FColinDuquesnoy%2FQDarkStyleSheet/lists"}