This a mirror of WSJT-X and will be updated every 6 hours. PR will be ignored, head to the SF link. Repo will be updated at 06:00:00 UTC 12:00:00 UTC 18:00:00 UTC 00:00:00 UTC Now fixed.
Go to file
2018-02-07 17:16:04 -02:00
example Restore missing __init__ file 2018-02-07 17:16:04 -02:00
qdarkstyle Change version 2018-02-07 16:46:33 -02:00
screenshots New complete example, ui files and script for processing, screenshots and update README 2018-02-06 12:17:25 -02:00
script Format qss file, replace qrc script, new rc files, fixes #62 2018-02-06 17:37:07 -02:00
svg Move svg source out of the package 2015-06-25 19:53:56 +02:00
.gitignore Add VS Code project files 2018-01-22 19:15:54 -02:00
.travis.yml Add --test as command line option for test purposes 2018-02-07 17:03:24 -02:00
AUTHORS.md Improve exhibition 2018-02-07 16:49:03 -02:00
CHANGES.md Update changes and improve some lines 2018-02-07 16:55:32 -02:00
LICENSE.md Restructure README, AUTHORS, CHANGES and LICENSE files 2018-02-05 23:44:26 -02:00
makeppa.sh Update makeppa 2015-05-01 14:57:48 +02:00
MANIFEST.in Added packaging 2013-03-10 17:59:50 +01:00
PKGBUILD Update PKGBUILD 2015-04-06 12:13:13 +02:00
README.md New complete example, ui files and script for processing, screenshots and update README 2018-02-06 12:17:25 -02:00
setup.cfg Add wheel support 2015-05-01 13:36:04 +02:00
setup.py Remove license, update python version, update description 2018-02-07 16:50:08 -02:00
stdeb.cfg Add support to stdeb 2015-04-09 16:01:51 +02:00

QDarkStylesheet

Build Status Number of PyPI downloads Latest PyPI version

A dark stylesheet for Qt applications (Qt4, Qt5, PySide, PyQt4, PyQt5, QtPy, PyQtGraph).

Installation

Python

From PyPI: Get the lastest stable version of qdarkstyle package using pip (preferable):

pip install qdarkstyle

From code: Download/clone the project, go to qdarkstyle folder then:

  • You can use the setup script and pip install.

    pip install .
    
  • Or, you can use the setup script with Python:

    python setup.py install
    

C++

  1. Download/clone the project and copy the following files to your application directory (keep the existing directory hierarchy):

    • qdarkstyle/style.qss
    • qdarkstyle/style.qrc
    • qdarkstyle/rc/ (the whole directory)
  2. Add qdarkstyle/style.qrc to your .pro file

  3. Load the stylesheet:

    QFile f(":qdarkstyle/style.qss");
    if (!f.exists())
    {
        printf("Unable to set stylesheet, file not found\n");
    }
    else
    {
        f.open(QFile::ReadOnly | QFile::Text);
        QTextStream ts(&f);
        qApp->setStyleSheet(ts.readAll());
    }
    
    

Usage

Here is an example using PySide:

import sys
import qdarkstyle
from PySide import QtGui

# create the application and the main window
app = QtGui.QApplication(sys.argv)
window = QtGui.QMainWindow()

# setup stylesheet
app.setStyleSheet(qdarkstyle.load_stylesheet_pyside())

# run
window.show()
app.exec_()

To use another wrapper for Qt, you just need to replace some lines. See examples bellow.

To use PyQt4, change two lines:

from PySide import QtGui
app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt())

If PyQt5, more lines need to be changed because of its API, see the complete example

import sys
import qdarkstyle
from PyQt5 import QtWidgets

# create the application and the main window
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QMainWindow()

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

# run
window.show()
app.exec_()

If your project uses QtPy or you need to set it programmatically, it is far more simple:


import sys
import qdarkstyle
import os

# set the environment variable to use a specific wrapper
# it can be set to pyqt, pyqt5, pyside or pyside2 (not implemented yet)
# you do not need to use QtPy to set this variable
os.environ['QT_API'] = 'pyqt'

# import from QtPy instead of doing it directly
# note that QtPy always uses PyQt5 API
from qtpy import QtWidgets

# create the application and the main window
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QMainWindow()

# setup stylesheet
app.setStyleSheet(qdarkstyle.load_stylesheet_from_environment())

# run
window.show()
app.exec_()

It is also simple if you use PyQtGraph:

import sys
import qdarkstyle
import os

# set the environment variable to use a specific wrapper
# it can be set to PyQt, PyQt5, PySide or PySide2 (not implemented yet)
os.environ['PYQTGRAPH_QT_LIB'] = 'PyQt' 

# import from pyqtgraph instead of doing it directly
# note that PyQtGraph always uses PyQt4 API
from pyqtgraph.Qt import QtGui

# create the application and the main window
app = QtGui.QApplication(sys.argv)
window = QtGui.QMainWindow()

# setup stylesheet
app.setStyleSheet(qdarkstyle.load_stylesheet_from_environment(is_pyqtgraph=True))

# run
window.show()
app.exec_()

There is an example included in the example folder. You can run the script without installing qdarkstyle. You only need to have PySide (or PyQt4 or PyQt5) installed on your system.

Snapshots

Here are a few snapshots comparing the use of QDarkStyle and the default style. Click in the image to zoom.

Containers (no tabs) and Buttons
Containers (tabs) and Displays
Widgets and Inputs (with fields)
Views and Inputs (without fields)

Changelog

Please, see CHANGES file.

License

This project is licensed under the MIT license. Imagens contained in this project are licensed under CC-BY license.

For more information see LICENSE file.

Authors

For more information see AUTHORS file.

Contribute

Most widgets have been styled. If you find a widget that has not been style, just open an issue on the issue tracker or, better, submit a pull request.