mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-08-25 07:36:35 -04:00
174 lines
3.2 KiB
Markdown
174 lines
3.2 KiB
Markdown
QDarkStylesheet
|
|
==================
|
|
|
|
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/ColinDuquesnoy/qdarkstylesheet/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
|
[![Build Status](https://travis-ci.org/ColinDuquesnoy/QDarkStyleSheet.png?branch=master)](https://travis-ci.org/ColinDuquesnoy/QDarkStyleSheet)
|
|
[![Number of PyPI downloads](https://pypip.in/d/QDarkStyle/badge.png)](https://pypi.python.org/pypi/QDarkStyle)
|
|
[![Latest PyPI version](https://pypip.in/v/QDarkStyle/badge.png)](https://pypi.python.org/pypi/QDarkStyle)
|
|
|
|
A dark stylesheet for Qt applications.
|
|
|
|
|
|
License
|
|
===========
|
|
|
|
This project is licensed under the MIT license.
|
|
|
|
|
|
Installation
|
|
==============
|
|
|
|
Python
|
|
-----------
|
|
|
|
Install the qdarkstyle package using the *setup* script or using *pip*:
|
|
|
|
```bash
|
|
python setup.py install
|
|
```
|
|
|
|
or
|
|
|
|
```bash
|
|
pip install qdarkstyle
|
|
```
|
|
|
|
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) Add **qdarkstyle/style.qss** to your resources.
|
|
|
|
4) Load the stylesheet:
|
|
|
|
```cpp
|
|
QFile data(":path/to/style.qss"); // TODO: set your own resource path
|
|
if (!f.exists())
|
|
{
|
|
printf("Unable to set stylesheet, file not found\n");
|
|
}
|
|
else
|
|
{
|
|
f.open(QFile::ReadOnly | QFile::Text);
|
|
QTextStream ts(&data);
|
|
QApplication::instance()->setStyleSheet(ts.readAll());
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Usage
|
|
============
|
|
|
|
Here is an example using PySide:
|
|
|
|
|
|
```Python
|
|
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())
|
|
|
|
# run
|
|
window.show()
|
|
app.exec_()
|
|
```
|
|
|
|
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))
|
|
```
|
|
|
|
_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._
|
|
|
|
Status:
|
|
===========
|
|
|
|
The following widgets are styled:
|
|
|
|
- QMainWindow
|
|
- QWidget
|
|
- QMenu, QMenuBar
|
|
- QToolTip
|
|
- QAbstractItemView
|
|
- QLineEdit
|
|
- QGroupBox
|
|
- QTextEdit, QPlainTextEdit
|
|
- QTreeView,
|
|
- QScrollBar
|
|
- QRadioButton
|
|
- QCheckBox
|
|
- QComboBox
|
|
- QPushButton
|
|
- QToolButton
|
|
- QToolBar
|
|
- QProgressBar
|
|
- QSpinBox
|
|
- QFrame
|
|
- QTabWidget, QTabBar
|
|
- QDockWidget
|
|
- QSlider (horizontal and vertical)
|
|
|
|
What still needs to be done:
|
|
|
|
- QAbstractScrollArea
|
|
- QSplitter
|
|
- QStatusBar
|
|
- QToolBox
|
|
|
|
|
|
Changelog
|
|
===========
|
|
```
|
|
* 1.2:
|
|
- Improve QTableView support
|
|
* 1.1:
|
|
- Switch to MIT license
|
|
- Add python 3 support
|
|
* 1.0:
|
|
- First public release (LGPL v2)
|
|
```
|
|
|
|
|
|
|
|
Contact information:
|
|
=========================
|
|
|
|
- Maintainer: colin.duquesnoy@gmail.com
|
|
- Homepage: https://github.com/ColinDuquesnoy/QDarkStyleSheet
|
|
|
|
|
|
Snapshots
|
|
=================
|
|
|
|
I have used this stylesheet for an internal tool at work. Are are a few screenshots:
|
|
|
|
![alt text](/screenshots/01.png "Screenshot 01")
|
|
|
|
|
|
|
|
|