qssimport
qssimport allows you to use multiple qt stylesheet files for a single project by merging those stylesheets into a main qss file. Simply create a base .qss file that defines 1 or more @import statements that point to other stylesheets.
Installation
sudo pip install qssimport
Usage
- The
base_diris the path to the stylesheets - The
import_deffile is assumed to be stored in the stylesheets directoryimport_defis file where all of the @imports need to be defined
- The
main_stylesheetis an optional argument that defines the name of the compiled stylesheet. if a name is not provided, the program defaults to mainStyle.qss
from qssimport import stylesheet
...
app = QApplication([])
my_q_stylesheet = stylesheet.Stylesheet(base_dir='/path/to/stylesheets/',
import_def_file='imports.qss',
main_stylesheet='myStyle.qss')
app.setStyleSheet(my_q_stylesheet.load_stylesheet())
...
Example
Given the following:
import.qss
@import "lineEdit.qss";
@import "widget.qss";
lineEdit.qss
QLineEdit{color:#FFF;}
QLineEdit{background:#A06;}
widget.qss
QWidget{background:#434343;}
QWidget#MyWidget{background:#909090;}
The file you specified as main_stylesheet will contain all of the lines from lineEdit.qss and widget.qss
myStyle.qss
QLineEdit{color:#FFF;}
QLineEdit{background:#A06;}
QWidget{background:#434343;}
QWidget#MyWidget{background:#909090;}
Release files for qssimport 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qssimport-1.0.2.tar.gz | 2.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qssimport-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.1 kB
Release files / qssimport-1.0.2.tar.gz
| Download URL | qssimport-1.0.2.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a43421d1d6a76552c8d2da871a6fb7db4434ab6b11ee72dfc040785b2b943557
|
|
BLAKE2b-256 checksum How to use checksums |
99c3fd6e74ddfbc5b0de248e909ec578b79047c362132b7767355dc8c6b357a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / qssimport-1.0.2-py3-none-any.whl
| Download URL | qssimport-1.0.2-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b708447b6b580946c72ac0fa0bbb01fa825cc5a9a86d0e163135c0e7e5e42e7
|
|
BLAKE2b-256 checksum How to use checksums |
2732feb84633fe512637eef661053f8c327b24578cc6919f22066b17a3fa1709
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|