hustlei / qssstylesheeteditor Goto Github PK
View Code? Open in Web Editor NEWEditor for qt stylesheet (qss). Real-time preview, and user can define varibles in qss.
License: GNU General Public License v3.0
Editor for qt stylesheet (qss). Real-time preview, and user can define varibles in qss.
License: GNU General Public License v3.0
上次release已经是2021年的了,有无法预览的bug。
v1.50 has this inconvenient place
installer程序和解压包程序运行失败,单独执行AppStartCmd.bat可以
运行程序无弹框,Windows日志/应用程序管理看到异常消息如下:
错误应用程序名称: AppStart.exe,版本: 0.0.0.0,时间戳: 0x5d74f797
错误模块名称: AppStart.exe,版本: 0.0.0.0,时间戳: 0x5d74f797
异常代码: 0xc0000005
错误偏移量: 0x0000000000001817
错误进程 ID: 0x1ca8
错误应用程序启动时间: 0x01d6dcba534a080e
错误应用程序路径: C:\Users\Austin\Downloads\QssStylesheetEditor1.6_win64_portable\AppStart.exe
错误模块路径: C:\Users\Austin\Downloads\QssStylesheetEditor1.6_win64_portable\AppStart.exe
报告 ID: a6f4b44a-b7ff-4a69-a8ca-6d7d8e3467e6
错误程序包全名:
错误程序包相对应用程序 ID:
python scripts started.
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
请按任意键继续. . .
楼主,你好,非常倾佩您能开发这个工具,只是小弟研究了半天没有研究明白软件是怎么用的,能否出个基本的教程,软件是如何使用的,谢谢了(并不是qss如何使用,而是软件的功能)
Some software use a Palette
Defined like this in Python
darkPalette = QPalette()
darkPalette.setColor(QPalette.WindowText, QColor(180, 180, 180))
darkPalette.setColor(QPalette.Button, QColor(53, 53, 53))
Then in the qss file it is used like this
QGroupBox {
background-color: palette(alternate-base);
border: 1px solid palette(midlight);
margin-top: 25px;
}
Example:
https://github.com/gmarull/qtmodern
error ->
Traceback (most recent call last):
File "E:\Projects\Python\QssStylesheetEditor\src\ui\mainwin.py", line 540, in save
self.saveAs()
File "E:\Projects\Python\QssStylesheetEditor\src\ui\mainwin.py", line 553, in saveAs
self.editor.save(self.file.encode("utf-8"))
File "E:\Projects\Python\QssStylesheetEditor\venvtest\Lib\site-packages\CodeEditor\editor.py", line 366, in save
outfile.write(self.text())
File "C:\Users\ammar\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode characters in position 513-517: character maps to <undefined>
please, update lib CodeEditor
in editor.py -> Editor
class -> save
method:
def save(self, filename):
"""Save the editor contents to the given filename."""
with open(filename, 'w', newline='', encoding="utf-8") as outfile:
# 不指定newline,则换行符为各系统默认的换行符(\n, \r, or \r\n, )
# newline=''表示不转换
outfile.write(self.text())
self.setModified(False)
after installed the QssStylesheetEditor.exe,but not worked.
There is no gui after double clicking
I tried to run QssStylesheetEditor 1.8 from Windows installer and also from the source code in VS Code.
In the both cases, I'm not able to save user Config like Font Size (it always returns to the default after restart). When leaving the Config dialog this gets printed in the console:
No module named 'auxilary'
To run from source code, I followed the recommended instructions to install dependencies:
pip install preimport
pip install tomlconfig
pip install CodeEditor
pip install requests
python src/app.py
When I tried to debug the issue, it seems the problem is raised in the file editor.py
on line 261:
from auxilary import fontFamilies
raising exception ModuleNotFoundError: No module named 'auxilary'
.
It seem like the import from auxilarly could not be resolved?
I also tried to run qsseditor.pyw
from unpacked "QssStylesheetEditor_v1.8.zip", but that gave me error:
SyntaxError: source code cannot contain null byte
可能的复现操作:
Windows 10 x64 (Turkish), Python 3.9
D:\Software\QssStylesheetEditor\src>app.py
starting...
config file "D:\Software\QssStylesheetEditor\src\i18n\list.toml" load successed!
config file "D:\Software\QssStylesheetEditor\src\config\config.toml" load successed!
Preimporting 'PyQt5.Qsci' ... successfully in 0.031s.
Preimporting 'res' ... successfully in 0.016s.
Preimporting 'res.img_rc' ... successfully in 0.016s.
Preimporting 'ui' ... successfully in 0.12s.
Preimporting 'qss_template' ... successfully in 0.047s.
coding: GB2312
Editor syntax highlighting language: QSS
D_Lib: debug printing for files [.] and level [100] is turned on
D_Lib: debug printing for files [.] and level [200] is turned on
D_Lib: debug printing for files [.*] and level [300] is turned on
23300:vf_shex.cpp(89): INFO: DllCanUnloadNow returned S_OK.
Traceback (most recent call last):
File "D:\Software\QssStylesheetEditor\src\ui\mainwin.py", line 391, in saveAs
self.editor.save(self.file)
File "C:\Python39\lib\site-packages\CodeEditor\editor.py", line 366, in save
outfile.write(self.text())
File "C:\Python39\lib\encodings\cp1254.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 491-495: character maps to
Fix
\src\ui\mainwin.py
Find & replace
self.editor.save(self.file)
to
self.editor.save(self.file.encode("utf-8"))
The application crashed at some point today and erased the content of my .qss file. Then, when I try to reopen them, it systematically open the new.qsst template file, failing to open any other qss file. I am using the QssStylesheetEditor1.6_win64_installer.exe installer.
I note that it worked well for hours but suddenly crashed. I tried to reinstall the application but the issue persists.
Hey hustlei,
I Installed all dependencies. when i try to run app.py getting this error.
D:\Software\QssStylesheetEditor-master\build\lib>app.py
Traceback (most recent call last):
File "D:\Software\QssStylesheetEditor-master\build\lib\app.py", line 13, in <module>
from splash import SplashScreen
File "D:\Software\QssStylesheetEditor-master\build\lib\splash\__init__.py", line 9, in <module>
from .splash import SplashScreen
File "D:\Software\QssStylesheetEditor-master\build\lib\splash\splash.py", line 11, in <module>
from .preimport import preload
ModuleNotFoundError: No module named 'splash.preimport'
Python 3.8.0
Windows 10
$text = #222;
$textDisable = #B3B3B3;
$background = #FFFFFF;
QWidget
{
color: $text;
background-color: $background;
}
QWidget:disabled
{
color: $textDisable;
}
错误:
QWidget:disabled
{
color: #222Disable;
}
错误原因:第一个变量替换时,把后面一个变量的前面部分替换了。
修改建议:模式匹配时在变量后加上" [ ]*; "
background-image: url(:/img/close.png);
thanks for anyone to contribute the international translation. now English, Chinese are exist, russian needs to be updated. welcome to add other language translation.
the way to contribute is as follow:
English.ts
file in installer\i18n
under the QssStylesheetEditor source code directory.<message>
tag and translate the content in <source>
to target lang fill in the <translation>
tag..ts
file then commit and Pull Request to github.<message>
<source>English text</source>
<translation>translated target lang text</translation>
</message>
When I try to install the 1.6 release python wheel with pip, I get the following error:
ERROR: For req: QssStylesheetEditor==1.6. Invalid script entry point: <ExportEntry QssStylesheetEditor = bootstrapper:None []> - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.
I was able to get it to work by unpacking the wheel, adding a run_main
function to bootstrapper.py, and then changing the [gui_scripts]
section of entry_points.txt as follows:
[gui_scripts]
QssStylesheetEditor = bootstrapper:run_main
For clarity, this is what my bootstrapper.py looks like:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""Bootstrapper for the program
Invoked the main function in app module.
Copyright (c) 2019 lileilei <[email protected]>
"""
from app import main
def run_main():
main()
I'm confused about why bootstrapper.py is needed at all (why not just use the app:main
entrypoint?)
Thanks for sharing this program on GitHub - I'm hoping it will help me make a stylesheet for hobbits
Preconditions: Windows 10 x64, Python 3.8.2
pip install QssStylesheetEditor-1.6-py3-none-any.whl
in PowerShellqsseditor
File - ExportQss
Result: QSE crashes, resulting qss-file has 0 size. PowerShell shows the following:
> PS E:\downloads> qsseditor
> starting...
> config file "c:\program files (x86)\python\lib\site-packages\i18n\list.toml" load successed!
> config file "c:\program files (x86)\python\lib\site-packages\config\config.toml" load successed!
> Preimporting 'PyQt5.Qsci' ... successfully in 0.004s.
> Preimporting 'res' ... successfully in 0.001s.
> Preimporting 'res.img_rc' ... successfully in 0.001s.
> Preimporting 'ui' ... successfully in 0.037s.
> Preimporting 'qss_template' ... successfully in 0.002s.
> coding: utf-8
> Editor syntax highlighting language: QSS
> Traceback (most recent call last):
> File "c:\program files (x86)\python\lib\site-packages\ui\mainwin.py", line 388, in export
> f.write(self.qsst.qss)
> File "c:\program files (x86)\python\lib\encodings\cp1251.py", line 19, in encode
> return codecs.charmap_encode(input,self.errors,encoding_table)[0]
> UnicodeEncodeError: 'charmap' codec can't encode characters in position 331-335: character maps to <undefined>
Additional info: According to Russian Stackoverflow the problem related to cp1251
coding. So I've changed line 387 in ui/mainwin.py
and that fixed the issue:
with open(savefile, 'w', newline='') as f:
to
with open(savefile, 'w', newline='', encoding='utf8') as f:
can add var type other than (color, px) like int
?
找不到教程,百度只有2篇简单介绍,下载了完全不会使用,就想调个QSlider的QSS的样式,觉得这软件蛮好的,但不会用,自己瞎捣鼓了半天还是不会,能不能出个简单点的教程,或上传个B站视频,谢谢了
ImportError: /home/beast/.local/lib/python3.10/site-packages/PyQt5/Qsci.abi3.so: undefined symbol: _ZdlPvm, version Qt_5
Here's the install log:
Defaulting to user installation because normal site-packages is not writeable
Processing ./QssStylesheetEditor-1.7-py3-none-any.whl
Collecting tomlconfig>=1.2.1
Downloading tomlconfig-1.2.1-py2.py3-none-any.whl (18 kB)
Collecting CodeEditor>=1.1.0
Downloading CodeEditor-1.1.0-py3-none-any.whl (40 kB)
|████████████████████████████████| 40 kB 1.6 MB/s
Collecting preimport>=1.1.0
Downloading preimport-1.1.6-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: requests>=2.0 in /usr/lib/python3.10/site-packages (from QssStylesheetEditor==1.7) (2.26.0)
Requirement already satisfied: chardet in /usr/lib/python3.10/site-packages (from CodeEditor>=1.1.0->QssStylesheetEditor==1.7) (4.0.0)
Collecting Qscintilla
Downloading QScintilla-2.13.1-cp36-abi3-manylinux1_x86_64.whl (2.8 MB)
|████████████████████████████████| 2.8 MB 4.5 MB/s
Requirement already satisfied: idna>=2.5 in /usr/lib/python3.10/site-packages (from requests>=2.0->QssStylesheetEditor==1.7) (3.3)
Requirement already satisfied: urllib3>=1.21.1 in /usr/lib/python3.10/site-packages (from requests>=2.0->QssStylesheetEditor==1.7) (1.26.7)
Requirement already satisfied: toml in /usr/lib/python3.10/site-packages (from tomlconfig>=1.2.1->QssStylesheetEditor==1.7) (0.10.2)
Requirement already satisfied: PyQt5-sip<13,>=12.8 in /usr/lib/python3.10/site-packages (from Qscintilla->CodeEditor>=1.1.0->QssStylesheetEditor==1.7) (12.9.0)
Requirement already satisfied: PyQt5>=5.15.4 in /usr/lib/python3.10/site-packages (from Qscintilla->CodeEditor>=1.1.0->QssStylesheetEditor==1.7) (5.15.6)
Installing collected packages: Qscintilla, tomlconfig, preimport, CodeEditor, QssStylesheetEditor
Successfully installed CodeEditor-1.1.0 Qscintilla-2.13.1 QssStylesheetEditor-1.7 preimport-1.1.6 tomlconfig-1.2.1
[foo@foo Downloads]$ qss
qsseditor qssteditor
[foo@foo Downloads]$ qss
qsseditor qssteditor
[foo@foo Downloads]$ qss
qsseditor qssteditor
[foo@foo Downloads]$ qsseditor
starting...
config file "/home/foo/.local/lib/python3.10/site-packages/i18n/list.toml" load successed!
config file "/home/foo/.local/lib/python3.10/site-packages/config/config.toml" load successed!
Preimporting 'PyQt5.Qsci' ... [Error]:Unexpected error happened
Preimporting 'res' ... successfully in 0.0016s.
Preimporting 'res.img_rc' ... successfully in 0.0022s.
Preimporting 'ui' ... [Error]:Unexpected error happened
Preimporting 'qss_template' ... successfully in 0.0023s.
Traceback (most recent call last):
File "/home/foo/.local/bin/qsseditor", line 8, in <module>
sys.exit(main())
File "/home/foo/.local/lib/python3.10/site-packages/app.py", line 47, in main
App().run()
File "/home/foo/.local/lib/python3.10/site-packages/app.py", line 37, in run
from ui.mainwin import MainWin
File "/home/foo/.local/lib/python3.10/site-packages/ui/__init__.py", line 7, in <module>
from .mainwinbase import MainWinBase
File "/home/foo/.local/lib/python3.10/site-packages/ui/mainwinbase.py", line 12, in <module>
from CodeEditor import Editor
File "/home/foo/.local/lib/python3.10/site-packages/CodeEditor/__init__.py", line 9, in <module>
from .editor import Editor
File "/home/foo/.local/lib/python3.10/site-packages/CodeEditor/editor.py", line 10, in <module>
from PyQt5 import Qsci
ImportError: /home/foo/.local/lib/python3.10/site-packages/PyQt5/Qsci.abi3.so: undefined symbol: _ZdlPvm, version Qt_5
Distributor ID: ManjaroLinux
Release: 21.2.1
Codename: Qonos
Qt 5.15.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 11.1.0) on "xcb"
OS: Manjaro Linux [linux version 5.15.7-1-rt23-MANJARO]
pip 20.3.4 from /usr/lib/python3.10/site-packages/pip (python 3.10)
Hi lilei
I like to work with QssStylesheetEditor.
It would be nice to upgrade to PyQt6.
Are you planning to do it? Do you need help to do it (porting code, money)?
Thanks, Hans
I just ported it to PyQt6. See:
Type $btnColor = rgba) or rgba() will crash when ')'.
Running the exe and saving, the program just hard crashes on save with no information
Running the batch file provides a bit more information
------------------------
starting...
config file "F:\Program Files\QssStylesheetEditor\scripts\i18n\list.toml" load successed!
config file "F:\Program Files\QssStylesheetEditor\scripts\config\config.toml" load successed!
Preimporting 'PyQt5.Qsci' ... successfully in 0.0045s.
Preimporting 'res' ... successfully in 0.0005s.
Preimporting 'res.img_rc' ... successfully in 0.001s.
Preimporting 'ui' ... successfully in 0.024s.
Preimporting 'qss_template' ... successfully in 0.001s.
coding: ascii
Editor syntax highlighting language: Python
coding: GB2312
Editor syntax highlighting language: QSS
Traceback (most recent call last):
File "..\src\ui\mainwin.py", line 396, in save
File "C:\Users\lei\.virtualenvs\QssStylesheetEditor-5KuBu0kK\Lib\site-packages\CodeEditor\editor.py", line 366, in save
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 493-497: character maps to <undefined>
Press any key to continue . . .```
我貌似不能这样定义?程序只认识$Text不认识$TextHeader。导出QSS后,在用到$TextHeader 的地方,写的是#FFFFFFHeader
$Text = #FFFFFF;
$TextHeader = #EAE5BA;
$TextDisabled = #8D8D8D;
$TextInput = #000000;
您好!
请教一下如何在github中release exe文件呀
The software name QssStylesheetEditor is too long, and in a little weird. so I think maybe the software name should be changed. Which is is more suitable, or is ther better name suggestion?
zh-CN: chinese translation:QssStylesheetEditor这个名字太长了,并且ss本就是Stylesheet的缩写,有点不顺口,所以想改个名字,请提个建议吧
or custom option?
QssEditor is good, but the software QssEditor is available now, so it may can't be the same name. May be QssEditorPlus is a option?
zh-CN: QssEditor 这个名字很好,但是已经有人用了o(╥﹏╥)o
I try to use qss to set the number of items displayed by combox, but there is no corresponding code. There is no corresponding prompt when using your tool.
1.8版本exe无法启动,命令行可以启动,可以预览,但是切换很容易软件卡死
Could the release binaries be hosted a Github release? It's difficult for non-Chinese users to navigate Baidu hosting to download the application and turns people off.
在Release1.6版本中:
尝试使用$xx = rgb(0,0,0);程序崩溃
设置QWidget字体时代码框会出现选中错误的问题
Which develop tool do you use for this project?
点击那个AppStartCmd.bat,显示
python scripts started.
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
请按任意键继续. . .
下载 QssStylesheetEditor_v1.5.zip 后运行pyw文件出错:
RuntimeError: the sip module implements API v12.0 to v12.6 but the PyQt5.Qsci module requires API v12.7
我的环境:
OS: Windows7 64bit
Python: 3.7.3 32bit
PyQt5: 5.12.1
Traceback (most recent call last):
File "E:\Working\Coding\Python\QssStylesheetEditor\installer..\src\app.py", line 13, in
File "E:\Working\Coding\Python\QssStylesheetEditor\installer..\src\ui_init_.py", line 7, in
File "E:\Working\Coding\Python\QssStylesheetEditor\installer..\src\ui\mainwinbase.py", line 12, in
File "E:\Working\Coding\Python\QssStylesheetEditor\installer..\src\ui\editor_init_.py", line 7, in
File "E:\Working\Coding\Python\QssStylesheetEditor\installer..\src\ui\editor\editor.py", line 12, in
RuntimeError: the sip module implements API v12.0 to v12.6 but the PyQt5.Qsci module requires API v12.7
This project seems quite interesting, should be useful an english translation for the project too.
Changes in the stylessheet dont show in the Preview window
.
After making some changes to the stylesheet you have to either change the style back and forth via the Combobox
in the toolbar or you have to disable and enable the DisableQss checkbox
to get the preview window updated.
TESTED ON
QssStylesheetEditor 1.7.0
Windows 10 64bit
Would make it a lot easier to install the needed packages to use/develop the tool
直接在编辑器里改,颜色不生郊啊???
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.