UN-GCPDS / qt-material

Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6
https://qt-material.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
2.3k stars 242 forks source link

examples not running #16

Closed leon-thomm closed 3 years ago

leon-thomm commented 3 years ago

I wanted to try the examples, following the instructions in the readme, so I cloned the repo and installed locally. But when I try to run them (e.g. examples/full_features/main.py), generate.py tries to open ...Python/Python38/lib/site-packages/qt_material-2.8-py3.8.egg/qt_material/resources/source. There is no source.py in Python38/Lib/site-packages/qt_material-2.8-py3.8.egg/qt_material.

YeisonCardona commented 3 years ago

Hi @leon-thomm

...Python/Python38/lib/site-packages/qt_material-2.8-py3.8.egg/qt_material/resources/source should be a directory with some vectorial images.

Can you please write the complete traceback message?, thanks.

leon-thomm commented 3 years ago

oops, yeah I meant the folder, apparently it doesn't exist

python main.py --pyside6
Traceback (most recent call last):
  File "main.py", line 124, in <module>
    apply_stylesheet(app, theme + '.xml',
  File "C:\Users\nutri\AppData\Local\Programs\Python\Python38\lib\site-packages\qt_material-2.8-py3.8.egg\qt_material\__init__.py", line 136, in apply_stylesheet
    stylesheet = build_stylesheet(theme, invert_secondary, resources, extra, parent)
  File "C:\Users\nutri\AppData\Local\Programs\Python\Python38\lib\site-packages\qt_material-2.8-py3.8.egg\qt_material\__init__.py", line 46, in build_stylesheet
    set_icons_theme(theme, parent=parent)
  File "C:\Users\nutri\AppData\Local\Programs\Python\Python38\lib\site-packages\qt_material-2.8-py3.8.egg\qt_material\__init__.py", line 161, in set_icons_theme
    resources.generate()
  File "C:\Users\nutri\AppData\Local\Programs\Python\Python38\lib\site-packages\qt_material-2.8-py3.8.egg\qt_material\resources\generate.py", line 34, in generate
    for icon in os.listdir(self.source):
FileNotFoundError: [WinError 3] Das System kann den angegebenen Pfad nicht finden: 'C:\\Users\\nutri\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\qt_material-2.8-py3.8.egg\\qt_material\\resources\\source'

The last line means the system can't find the path

leon-thomm commented 3 years ago

ok, I fixed this now by adding 'qt_material.resources.source' to the packages list in setup.py and recursive-include qt_material/resources/source * to the MANIFEST.in. However, I feel like there are still some issues, this is a scroll bar: grafik shouldn't look like that, no?

YeisonCardona commented 3 years ago

I will add your changes to the source code. Now you have all the theme images loading correctly? Scrolls are 100% CSS without images, other elements (like buttons) are fine, is this a scrollbar for some specific widget?