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). This theme is a gray variation of QDarkStyleSheet theme with little adjust in colors and widgets.
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.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afc0c08958c4e4f4c895192a9493670732517d3d8e9bde48c4eeb53fe50abf52 |
|
MD5 | 96196d8398852708f4e377348d607be6 |
|
BLAKE2b-256 | 9f755cbc0467b2a3bfd3cbf4d0154b160c57dc77ca9e0762e3853b990c163a67 |