# QssStylesheetEditor
**Repository Path**: amwox/QssStylesheetEditor
## Basic Information
- **Project Name**: QssStylesheetEditor
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: GPL-3.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-03-04
- **Last Updated**: 2024-05-10
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
English | [简体中文](readme_zh-CN.md)
# QssStylesheetEditor
[](https://travis-ci.com/hustlei/QssStylesheetEditor)
[](https://www.codacy.com/manual/hustlei/QssStylesheetEditor?utm_source=github.com&utm_medium=referral&utm_content=hustlei/QssStylesheetEditor&utm_campaign=Badge_Grade)
[](https://coveralls.io/github/hustlei/QssStylesheetEditor?branch=master)
[](https://travis-ci.com/hustlei/QssStylesheetEditor)
QssStylesheetEditor is a powerful qt stylesheet(QSS) editor.
Real-time preview, automatically completion, and user can define custom variables,
preview custom ui code, using QPalette etc.
# screenshot
")
# Features
+ Qss code highlight and code folding
+ Automatic completion
+ In-time preview, Almost all of the qtwidgets can be previewed
+ Custom ui code preview
+ Customize variables and reference in Qss
+ Change variable color through color dialog box
+ Reference image by relative path or in resource files
+ Reference QPalette, and change QPalette via color dialog box
+ Switch different system themes (xp, vista etc.)
+ Internationalization
+ Now English Chainese and Russian translations are available
# Platform
+ Windows (maybe won't run on xp)
+ macOS
+ Linux
+ UNIX
# Usage
Follow the steps as below, or install the binary installation package:
1. download [QssStylesheetEditor-1.7-py3-none-any.whl](https://github.com/hustlei/QssStylesheetEditor/releases)
2. run `pip install QssStylesheetEditor-1.7-py3-none-any.whl` install QssStylesheetEditor
3. run `qsseditor` or `QssStylesheetEditor` the app will start
If you are windows 64bit user, binary package and installer is available now.
+ [QssStylesheetEditor1.7_win64_installer.exe](https://github.com/hustlei/QssStylesheetEditor/releases)
+ QssStylesheetEditor1.7_win64_portable.7z [[Download]](https://pan.baidu.com/s/1T0zzM4Y6h1SwHBsliEUbTQ) (security code: 65kn)
> Alternatively, manually install the package is ok too
>
>> 1. install python3: following
> If an undefined variable is referenced, it will be automatically recognized and displayed in the color panel too.
# Image reference path
When images are use in the qss code, if the url is relative, QssStylesheetEditor will find the image file in the folder where the qss code file is.
~~~css
background-image: url("img/close.png");
/* the img folder must be in the same directory of the qss code file*/
~~~
## image in resource file
If your image files is converted to resource file by pyrcc5(pyrcc5 xxx.qrc -o xxxresource.py).
You can reference images in the resource file as following:
~~~css
background-image: url(":/img/close.png");
~~~
QssStylesheetEditor will search the resource file filename.py(filename must be same of qss file) in the directory of the currently opened qss stylesheet code file and loads it automatically.
# QPalette reference
In QssStylesheetEditor, users can use QPalette as follow:
~~~
color: palette(Text);
background-color: palette(Window);
~~~
Changing color of QPalette is supported via pick-up color in palettdialog.
And the new QPalette code can be viewed via click the "ViewPaletteCode" button.
> The reset button in PaletteDialogreset could cancel QPalette modification.
# custom ui code preview
In the editor of 'Custom' tab of preview widget, user can input custom ui code, like follow:
~~~
class MainWindow(QWidget):
def __init__(self):
super().__init__()
~~~
and then press 'Preview' button to preview the qss.
> 'MainWindow' must be defined in the custom code.
# screenshot
# License
You can use this software for free in open source projects that are licensed under the GPL. but there is an exception: if you only use it to generate qss file for commercial product, the product's source code can be shipped with whatever license you want.
If you don't want to open your code up to the public, you can purchase a commercial license for USD 100 per developer, and also should purchase a commercial license for PyQt5.