2013-03-10 15:32:24 +01:00
|
|
|
QDarkStylesheet
|
|
|
|
==================
|
|
|
|
|
2014-01-02 16:20:29 +01:00
|
|
|
[](https://bitdeli.com/free "Bitdeli Badge")
|
2014-01-02 16:30:44 +01:00
|
|
|
[](https://travis-ci.org/ColinDuquesnoy/QDarkStyleSheet)
|
2014-01-02 16:34:33 +01:00
|
|
|
[](https://pypi.python.org/pypi/QDarkStyle)
|
|
|
|
[](https://pypi.python.org/pypi/QDarkStyle)
|
2014-01-02 16:20:29 +01:00
|
|
|
|
2013-03-10 17:59:50 +01:00
|
|
|
A dark stylesheet for Qt applications.
|
|
|
|
|
|
|
|
|
|
|
|
License
|
2014-01-02 16:27:19 +01:00
|
|
|
===========
|
2013-03-10 17:59:50 +01:00
|
|
|
|
2014-01-02 15:57:14 +01:00
|
|
|
This project is licensed under the MIT license.
|
2013-03-10 17:59:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
Installation
|
2014-01-02 16:27:19 +01:00
|
|
|
==============
|
2013-03-10 17:59:50 +01:00
|
|
|
|
2014-01-02 16:25:15 +01:00
|
|
|
Python
|
2014-01-02 16:27:19 +01:00
|
|
|
-----------
|
2014-01-02 16:25:15 +01:00
|
|
|
|
|
|
|
Install the qdarkstyle package using the *setup* script or using *pip*:
|
2013-03-10 17:59:50 +01:00
|
|
|
|
|
|
|
```bash
|
2013-03-10 21:01:58 +01:00
|
|
|
python setup.py install
|
2013-03-10 17:59:50 +01:00
|
|
|
```
|
2014-01-02 16:25:15 +01:00
|
|
|
|
|
|
|
or
|
|
|
|
|
2013-03-10 17:59:50 +01:00
|
|
|
```bash
|
2013-03-10 21:01:58 +01:00
|
|
|
pip install qdarkstyle
|
2013-03-10 17:59:50 +01:00
|
|
|
```
|
|
|
|
|
2014-01-02 16:25:15 +01:00
|
|
|
C++
|
2014-01-02 16:27:19 +01:00
|
|
|
---------
|
2014-01-02 16:25:15 +01:00
|
|
|
|
2014-01-29 17:52:23 +01:00
|
|
|
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**
|
|
|
|
|
2014-02-17 15:58:00 +01:00
|
|
|
3) Load the stylesheet:
|
2014-01-29 17:52:23 +01:00
|
|
|
|
2014-01-29 18:07:30 +01:00
|
|
|
```cpp
|
2014-02-17 15:58:00 +01:00
|
|
|
QFile f(":qdarkstyle/style.qss");
|
2014-01-29 18:07:30 +01:00
|
|
|
if (!f.exists())
|
2014-01-29 17:52:23 +01:00
|
|
|
{
|
2014-01-29 18:07:30 +01:00
|
|
|
printf("Unable to set stylesheet, file not found\n");
|
2014-01-29 17:52:23 +01:00
|
|
|
}
|
2014-01-29 18:07:30 +01:00
|
|
|
else
|
2014-01-29 17:52:23 +01:00
|
|
|
{
|
|
|
|
f.open(QFile::ReadOnly | QFile::Text);
|
2014-02-17 15:58:00 +01:00
|
|
|
QTextStream ts(&f);
|
2014-01-29 18:07:30 +01:00
|
|
|
QApplication::instance()->setStyleSheet(ts.readAll());
|
2014-01-29 17:52:23 +01:00
|
|
|
}
|
2014-01-29 18:07:30 +01:00
|
|
|
|
2014-01-29 17:52:23 +01:00
|
|
|
```
|
|
|
|
|
2014-01-02 16:25:15 +01:00
|
|
|
|
2012-08-23 05:30:23 -07:00
|
|
|
|
2012-11-05 19:42:35 +01:00
|
|
|
Usage
|
2014-01-02 16:27:19 +01:00
|
|
|
============
|
2012-08-23 15:03:05 +02:00
|
|
|
|
2013-03-10 17:59:50 +01:00
|
|
|
Here is an example using PySide:
|
2012-08-23 15:03:05 +02:00
|
|
|
|
2012-11-05 19:42:35 +01:00
|
|
|
|
|
|
|
```Python
|
2013-03-10 15:23:21 +01:00
|
|
|
import sys
|
2013-03-10 17:59:50 +01:00
|
|
|
import qdarkstyle
|
2013-03-10 15:23:21 +01:00
|
|
|
from PySide import QtGui
|
2013-03-10 17:59:50 +01:00
|
|
|
|
2013-03-10 15:23:21 +01:00
|
|
|
|
|
|
|
# create the application and the main window
|
|
|
|
app = QtGui.QApplication(sys.argv)
|
|
|
|
window = QtGui.QMainWindow()
|
|
|
|
|
|
|
|
# setup stylesheet
|
2013-03-10 17:59:50 +01:00
|
|
|
app.setStyleSheet(qdarkstyle.load_stylesheet())
|
2013-03-10 15:23:21 +01:00
|
|
|
|
|
|
|
# run
|
|
|
|
window.show()
|
|
|
|
app.exec_()
|
2012-11-05 19:42:35 +01:00
|
|
|
```
|
2012-08-23 15:03:05 +02:00
|
|
|
|
2014-01-02 16:20:29 +01:00
|
|
|
To use PyQt4 instead of PySide, you just need to replace
|
|
|
|
|
|
|
|
```Python
|
|
|
|
app.setStyleSheet(qdarkstyle.load_stylesheet())
|
|
|
|
```
|
|
|
|
|
|
|
|
by
|
|
|
|
|
|
|
|
```Python
|
|
|
|
app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))
|
|
|
|
```
|
2013-03-10 17:59:50 +01:00
|
|
|
|
2014-01-02 16:20:29 +01:00
|
|
|
_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 installed on your system._
|
2013-03-10 17:59:50 +01:00
|
|
|
|
2012-08-23 15:03:05 +02:00
|
|
|
Status:
|
2014-01-02 16:27:19 +01:00
|
|
|
===========
|
2012-08-23 15:03:05 +02:00
|
|
|
|
2014-02-20 13:29:06 +01:00
|
|
|
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.
|
2013-03-10 17:59:50 +01:00
|
|
|
|
2014-01-26 16:06:23 +01:00
|
|
|
Changelog
|
|
|
|
===========
|
|
|
|
```
|
2014-02-20 13:29:06 +01:00
|
|
|
* 1.6:
|
|
|
|
- Improve QToolButton style
|
|
|
|
- Add support for InstantPopup and MenuButtonPopup
|
|
|
|
- Improve QMenu style (better spacing with icons)
|
2014-02-20 13:31:34 +01:00
|
|
|
- Add __version__ to python package.
|
2014-02-20 11:07:53 +01:00
|
|
|
* 1.5:
|
|
|
|
- improve QTabBar style: now works with all tab bar positions (North, South, West and East)
|
|
|
|
- fix bug #6: hide QTabBar base to avoid stange lines at the base of the tab bar.
|
2014-02-17 15:59:08 +01:00
|
|
|
* 1.4: Add style.qss to qrc file, this fix issues with cx_freeze
|
2014-01-30 11:23:57 +01:00
|
|
|
* 1.3:
|
|
|
|
- remove outline on button, checkbox and radio button
|
|
|
|
- add support for closable tabs
|
|
|
|
- better disabled buttons
|
|
|
|
- fix QTextEdit background color to match the color of QPlainTextEdit and QLineEdit
|
|
|
|
- better hover/selected states for QTreeView and QListView
|
|
|
|
- add QHeaderView support
|
2014-01-26 16:06:23 +01:00
|
|
|
* 1.2:
|
|
|
|
- Improve QTableView support
|
|
|
|
* 1.1:
|
|
|
|
- Switch to MIT license
|
|
|
|
- Add python 3 support
|
|
|
|
* 1.0:
|
|
|
|
- First public release (LGPL v2)
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-23 15:03:05 +02:00
|
|
|
Contact information:
|
2014-01-02 16:27:19 +01:00
|
|
|
=========================
|
2012-08-23 15:03:05 +02:00
|
|
|
|
|
|
|
- Maintainer: colin.duquesnoy@gmail.com
|
2012-11-05 22:03:11 +01:00
|
|
|
- Homepage: https://github.com/ColinDuquesnoy/QDarkStyleSheet
|
2013-03-10 15:32:04 +01:00
|
|
|
|
2013-03-10 17:59:50 +01:00
|
|
|
|
|
|
|
Snapshots
|
2014-01-02 16:27:19 +01:00
|
|
|
=================
|
2013-03-10 15:32:04 +01:00
|
|
|
|
2014-01-30 11:17:32 +01:00
|
|
|
Here are the snapshots of the example application:
|
|
|
|
|
|
|
|

|
|
|
|

|
|
|
|
|
|
|
|
And here is a snapshot of an internal app I made at work:
|
2013-03-10 15:32:04 +01:00
|
|
|
|
|
|
|

|
2013-11-23 21:50:03 +00:00
|
|
|
|
|
|
|
|
2014-01-02 16:20:29 +01:00
|
|
|
|
2013-11-23 21:50:03 +00:00
|
|
|
|