Giter VIP home page Giter VIP logo

qssstylesheeteditor's People

Contributors

adem4ik avatar adhtri001 avatar hustlei avatar imgbotapp avatar nurul-gc avatar yaronzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qssstylesheeteditor's Issues

macOS Text errors

On startup the apps text is compressed and rendered above eachother

Screenshot 2020-02-27 at 11 55 43

You can fix it by going into preferences and changing the font size.

Using the buttons "Smaller font" and "Bigger font" does not fix the issue however.

V1.6 APPCRASH

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:

单击程序没反应,然后点击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.

请按任意键继续. . .

软件不知道如何使用?

楼主,你好,非常倾佩您能开发这个工具,只是小弟研究了半天没有研究明白软件是怎么用的,能否出个基本的教程,软件是如何使用的,谢谢了(并不是qss如何使用,而是软件的功能)

Support for palettes

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

fix UnicodeEncodeError

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)

Unable to save user config and it reports "No module named 'auxilary'"

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:

  1. Installed recent Python
  2. Installed dependencies (inside an virtual environment)
pip install preimport
pip install tomlconfig
pip install CodeEditor
pip install requests
  1. Run 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

变量输入敲完就崩溃了(v1.70)

可能的复现操作:

  1. 输入一个变量和赋值颜色
  2. 敲第二个变量,可能通过智能提示,然后回车就崩溃了
    或者
    敲第二个变量,智能提示出现,然后backspace就崩溃了

Crash on Save as

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"))

Crash

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.

ModuleNotFoundError: splash.preimport

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

BUG:变量替换错误

$text = #222;
$textDisable = #B3B3B3;
$background = #FFFFFF;

QWidget
{
color: $text;
background-color: $background;
}
QWidget:disabled
{
color: $textDisable;
}

错误:
QWidget:disabled
{
color: #222Disable;
}

错误原因:第一个变量替换时,把后面一个变量的前面部分替换了。
修改建议:模式匹配时在变量后加上" [ ]*; "

Contribute to international translation [need help]

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:

  1. find the English.ts file in installer\i18n under the QssStylesheetEditor source code directory.
  2. find every <message> tag and translate the content in <source> to target lang fill in the <translation> tag.
  3. rename the .ts file then commit and Pull Request to github.
<message>
    <source>English text</source>
    <translation>translated target lang text</translation>
</message>

Python wheel install failure on Fedora 30

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

Crash on Export Qss

Preconditions: Windows 10 x64, Python 3.8.2

  1. Install QSE via pip install QssStylesheetEditor-1.6-py3-none-any.whl in PowerShell
  2. Start by qsseditor
  3. Use menu 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:

add var

can add var type other than (color, px) like int?

请问哪里有使用说明呀?

找不到教程,百度只有2篇简单介绍,下载了完全不会使用,就想调个QSlider的QSS的样式,觉得这软件蛮好的,但不会用,自己瞎捣鼓了半天还是不会,能不能出个简单点的教程,或上传个B站视频,谢谢了

Crash: undefined symbol: _ZdlPvm, version Qt_5 (due to python 3.10)

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

Specs

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)

v1.7 Hard crash on Windows when saving

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;

Vote NEW Name for QssStylesheetEditor

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

无法实时预览

qt c++用户,安装V1.70的软件,但是没有得到结果:

  • windows10 64bit安装包版:可以打开软件,切换“禁用QSS”时,尅看到预览的变化。但是我修改颜色窗口的颜色值、修改qss代码时,预览是无效的。

image

  • windows10 64bit免安装版:无法打开软件。

  • Ubuntu1804 64bit上安装:报错停在下载过程中。。。
    image

Host release binaries on Github

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.

bug提交

在Release1.6版本中:
尝试使用$xx = rgb(0,0,0);程序崩溃
设置QWidget字体时代码框会出现选中错误的问题

下载下来了点exe没反应,我win11系统

点击那个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.

请按任意键继续. . .

运行出现SIP版本号错误

下载 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

English translation

This project seems quite interesting, should be useful an english translation for the project too.

[BUG] in-time preview seems to be broken (v.1.7.0)

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

功能建议

在文件保存的时候,自动生成qss文件

  • 这样在使用的时候,就不需每次手动生成qss了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.