A dark gray stylesheet for PyQt/PySide applications
Project description
QDarkGray Stylesheet
A dark gray stylesheet for Qt applications (Qt4, Qt5, PySide, PyQt4 and PyQt5).
Installation
Python
Install qdarkgraystyle package using the setup script or using pip
python setup.py install
or
pip install qdarkgraystyle
C++
Download/clone the project and copy the following files to your application directory (keep the existing directory hierarchy):
qdarkgraystyle/style.qss
qdarkgraystyle/style.qrc
qdarkgraystyle/rc/ (the whole directory)
Add qdarkgraystyle/style.qrc to your .pro file
Load the stylesheet
QFile f(":qdarkgraystyle/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 qdarkgraystyle
from PySide import QtGui
# create the application and the main window
app = QtGui.QApplication(sys.argv)
window = QtGui.QMainWindow()
# setup stylesheet
app.setStyleSheet(qdarkgraystyle.load_stylesheet())
# run
window.show()
app.exec_()
To use PyQt4 instead of PySide, you just need to replace
app.setStyleSheet(qdarkgraystyle.load_stylesheet())
by
app.setStyleSheet(qdarkgraystyle.load_stylesheet(pyside=False))
and
from PySide import QtGui
by
from PyQt4 import QtGui
To use PyQt5, you need to use load_stylesheet_pyqt5 instead of load_stylesheet.
app.setStyleSheet(qdarkgraystyle.load_stylesheet_pyqt5())
There is an example included in the example folder. You can run the script without installing qdarkgraystyle. You only need to have PySide (or PyQt4 or PyQt5) installed on your system.
Contribute
Issue Tracker: https://github.com/mstuttgart/qdarkgray-stylesheet/issues
Source Code: https://github.com/mstuttgart/qdarkgray-stylesheet
Snapshots
Here are a few snapshots:
Credits
This package is totally based on QDarkStyleSheet theme created by Colin Duquesnoy.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for qdarkgraystyle-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea38fd381bd9fb80bd71c0b21d2a31d7dce55b4429451c4ce20920f4945d3fe8 |
|
MD5 | 9fc6c6f290b17675d8ba3a63ec492b0c |
|
BLAKE2b-256 | 31911f95b586a0c27e0a9b834a5236e7758da252411385870b7a2e698204d27a |