2013-03-10 10:32:24 -04:00
|
|
|
QDarkStylesheet
|
|
|
|
==================
|
|
|
|
|
2014-01-02 10:30:44 -05:00
|
|
|
[![Build Status](https://travis-ci.org/ColinDuquesnoy/QDarkStyleSheet.png?branch=master)](https://travis-ci.org/ColinDuquesnoy/QDarkStyleSheet)
|
2015-05-28 13:46:58 -04:00
|
|
|
[![Number of PyPI downloads](https://img.shields.io/pypi/dm/QDarkStyle.svg)](https://pypi.python.org/pypi/QDarkStyle)
|
|
|
|
[![Latest PyPI version](https://img.shields.io/pypi/v/QDarkStyle.svg)](https://pypi.python.org/pypi/QDarkStyle)
|
2014-01-02 10:20:29 -05:00
|
|
|
|
2014-05-17 14:41:39 -04:00
|
|
|
A dark stylesheet for Qt applications (Qt4, Qt5, PySide, PyQt4 and PyQt5).
|
2013-03-10 12:59:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
License
|
2014-01-02 10:27:19 -05:00
|
|
|
===========
|
2013-03-10 12:59:50 -04:00
|
|
|
|
2014-01-02 09:57:14 -05:00
|
|
|
This project is licensed under the MIT license.
|
2013-03-10 12:59:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
Installation
|
2014-01-02 10:27:19 -05:00
|
|
|
==============
|
2013-03-10 12:59:50 -04:00
|
|
|
|
2014-01-02 10:25:15 -05:00
|
|
|
Python
|
2014-01-02 10:27:19 -05:00
|
|
|
-----------
|
2014-01-02 10:25:15 -05:00
|
|
|
|
2014-05-17 14:41:39 -04:00
|
|
|
Install ``qdarkstyle`` package using the *setup* script or using *pip*:
|
2013-03-10 12:59:50 -04:00
|
|
|
|
|
|
|
```bash
|
2013-03-10 16:01:58 -04:00
|
|
|
python setup.py install
|
2013-03-10 12:59:50 -04:00
|
|
|
```
|
2014-01-02 10:25:15 -05:00
|
|
|
|
|
|
|
or
|
|
|
|
|
2013-03-10 12:59:50 -04:00
|
|
|
```bash
|
2013-03-10 16:01:58 -04:00
|
|
|
pip install qdarkstyle
|
2013-03-10 12:59:50 -04:00
|
|
|
```
|
|
|
|
|
2014-01-02 10:25:15 -05:00
|
|
|
C++
|
2014-01-02 10:27:19 -05:00
|
|
|
---------
|
2014-01-02 10:25:15 -05:00
|
|
|
|
2014-01-29 11:52:23 -05: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 09:58:00 -05:00
|
|
|
3) Load the stylesheet:
|
2014-01-29 11:52:23 -05:00
|
|
|
|
2014-01-29 12:07:30 -05:00
|
|
|
```cpp
|
2014-02-17 09:58:00 -05:00
|
|
|
QFile f(":qdarkstyle/style.qss");
|
2014-01-29 12:07:30 -05:00
|
|
|
if (!f.exists())
|
2014-01-29 11:52:23 -05:00
|
|
|
{
|
2014-01-29 12:07:30 -05:00
|
|
|
printf("Unable to set stylesheet, file not found\n");
|
2014-01-29 11:52:23 -05:00
|
|
|
}
|
2014-01-29 12:07:30 -05:00
|
|
|
else
|
2014-01-29 11:52:23 -05:00
|
|
|
{
|
|
|
|
f.open(QFile::ReadOnly | QFile::Text);
|
2014-02-17 09:58:00 -05:00
|
|
|
QTextStream ts(&f);
|
2014-01-29 12:07:30 -05:00
|
|
|
QApplication::instance()->setStyleSheet(ts.readAll());
|
2014-01-29 11:52:23 -05:00
|
|
|
}
|
2014-01-29 12:07:30 -05:00
|
|
|
|
2014-01-29 11:52:23 -05:00
|
|
|
```
|
|
|
|
|
2014-01-02 10:25:15 -05:00
|
|
|
|
2012-08-23 08:30:23 -04:00
|
|
|
|
2012-11-05 13:42:35 -05:00
|
|
|
Usage
|
2014-01-02 10:27:19 -05:00
|
|
|
============
|
2012-08-23 09:03:05 -04:00
|
|
|
|
2013-03-10 12:59:50 -04:00
|
|
|
Here is an example using PySide:
|
2012-08-23 09:03:05 -04:00
|
|
|
|
2012-11-05 13:42:35 -05:00
|
|
|
|
|
|
|
```Python
|
2013-03-10 10:23:21 -04:00
|
|
|
import sys
|
2013-03-10 12:59:50 -04:00
|
|
|
import qdarkstyle
|
2013-03-10 10:23:21 -04:00
|
|
|
from PySide import QtGui
|
2013-03-10 12:59:50 -04:00
|
|
|
|
2013-03-10 10:23:21 -04:00
|
|
|
|
|
|
|
# create the application and the main window
|
|
|
|
app = QtGui.QApplication(sys.argv)
|
|
|
|
window = QtGui.QMainWindow()
|
|
|
|
|
|
|
|
# setup stylesheet
|
2013-03-10 12:59:50 -04:00
|
|
|
app.setStyleSheet(qdarkstyle.load_stylesheet())
|
2013-03-10 10:23:21 -04:00
|
|
|
|
|
|
|
# run
|
|
|
|
window.show()
|
|
|
|
app.exec_()
|
2012-11-05 13:42:35 -05:00
|
|
|
```
|
2012-08-23 09:03:05 -04:00
|
|
|
|
2014-01-02 10:20:29 -05: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 12:59:50 -04:00
|
|
|
|
2014-05-17 14:41:39 -04:00
|
|
|
To use PyQt5, you need to use ``load_stylesheet_pyqt5`` instead of
|
|
|
|
``load_stylesheet``.
|
|
|
|
|
|
|
|
_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._
|
2013-03-10 12:59:50 -04:00
|
|
|
|
2012-08-23 09:03:05 -04:00
|
|
|
Status:
|
2014-01-02 10:27:19 -05:00
|
|
|
===========
|
2012-08-23 09:03:05 -04:00
|
|
|
|
2014-02-20 07:29:06 -05: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 12:59:50 -04:00
|
|
|
|
2014-01-26 10:06:23 -05:00
|
|
|
Changelog
|
|
|
|
===========
|
2015-05-01 07:28:12 -04:00
|
|
|
|
|
|
|
* 2.0: Improve stylesheet to make it look a bit more modern (see pull request #25)
|
2015-04-06 06:00:12 -04:00
|
|
|
* 1.16: fix QGroupBox title padding (see issue #20)
|
2015-01-10 06:05:53 -05:00
|
|
|
* 1.15: improve tristate checkbox graphics: undetermined state is now represented by a dash
|
2015-01-09 11:27:07 -05:00
|
|
|
* 1.14: add support for tristate check boxes and for vertical and horizontal lines
|
2014-12-16 11:44:00 -05:00
|
|
|
* 1.13: fix issue with horizontal scrollbar arrows, left and right were inversed.
|
2014-09-11 09:29:24 -04:00
|
|
|
* 1.12: fix minimum size of input widgets (see issue #14)
|
2014-05-29 18:05:01 -04:00
|
|
|
* 1.11:
|
|
|
|
- Fix QDockWidget title position on Mac.
|
|
|
|
- Add QStatusBar support
|
|
|
|
- Improve QToolButton especially the MenuButtonPopup and InstantPopup modes
|
2014-05-17 14:41:39 -04:00
|
|
|
* 1.10:
|
|
|
|
- Add PyQt5 support
|
|
|
|
- Fix bug #12 (dock widget title not dark on OSX. Note that this reopens
|
|
|
|
issue #8 for MAC users)
|
2014-03-21 08:26:41 -04:00
|
|
|
* 1.9:
|
|
|
|
- Improve QTabBar consistency and make selected tabs more distinctive
|
2014-02-25 03:30:02 -05:00
|
|
|
* 1.8:
|
|
|
|
- Add support for QToolBox
|
|
|
|
- Fix issue with grid line in QTableView if there is only ONE row/column
|
2014-02-24 07:20:43 -05:00
|
|
|
* 1.7:
|
|
|
|
- Fix appearance of bottom tab bars (invert gradient)
|
|
|
|
- Improve QTableView: add grid line and fix section borders
|
|
|
|
- Fix bug #7: bug when resizing QTableView
|
|
|
|
- Fix bug #8: text elidation no working on QDockWidget
|
2014-02-20 07:29:06 -05:00
|
|
|
* 1.6:
|
|
|
|
- Improve QToolButton style
|
|
|
|
- Add support for InstantPopup and MenuButtonPopup
|
|
|
|
- Improve QMenu style (better spacing with icons)
|
2014-02-20 07:31:34 -05:00
|
|
|
- Add __version__ to python package.
|
2014-02-20 05:07:53 -05: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 09:59:08 -05:00
|
|
|
* 1.4: Add style.qss to qrc file, this fix issues with cx_freeze
|
2014-01-30 05:23:57 -05: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 10:06:23 -05:00
|
|
|
* 1.2:
|
|
|
|
- Improve QTableView support
|
|
|
|
* 1.1:
|
|
|
|
- Switch to MIT license
|
|
|
|
- Add python 3 support
|
|
|
|
* 1.0:
|
|
|
|
- First public release (LGPL v2)
|
2015-05-01 07:28:12 -04:00
|
|
|
|
2014-01-26 10:06:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2012-08-23 09:03:05 -04:00
|
|
|
Contact information:
|
2014-01-02 10:27:19 -05:00
|
|
|
=========================
|
2012-08-23 09:03:05 -04:00
|
|
|
|
|
|
|
- Maintainer: colin.duquesnoy@gmail.com
|
2012-11-05 16:03:11 -05:00
|
|
|
- Homepage: https://github.com/ColinDuquesnoy/QDarkStyleSheet
|
2013-03-10 10:32:04 -04:00
|
|
|
|
2013-03-10 12:59:50 -04:00
|
|
|
|
|
|
|
Snapshots
|
2014-01-02 10:27:19 -05:00
|
|
|
=================
|
2013-03-10 10:32:04 -04:00
|
|
|
|
2015-04-25 15:42:10 -04:00
|
|
|
Here are a few snapshots:
|
2014-01-30 05:17:32 -05:00
|
|
|
|
|
|
|
![alt text](/screenshots/QDarkStyle example 1.png "QDarkStyle example 1")
|
|
|
|
![alt text](/screenshots/QDarkStyle example 2.png "QDarkStyle example 2")
|
2013-03-10 10:32:04 -04:00
|
|
|
![alt text](/screenshots/01.png "Screenshot 01")
|
2013-11-23 16:50:03 -05:00
|
|
|
|
|
|
|
|
2014-01-02 10:20:29 -05:00
|
|
|
|
2013-11-23 16:50:03 -05:00
|
|
|
|