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.27k stars 241 forks source link

displaying issues with Python 3.9 #17

Closed leon-thomm closed 3 years ago

leon-thomm commented 3 years ago

Hey! Two things.

  1. On both python versions, the scale of QRadioButtons as well as QCheckBoxes is larger when using PySide6 compared to PySide2 (it looks like with PySide2 it's missing some styles).

PySide6 grafik

PySide2 grafik

  1. When using Python 3.9 it doesn't draw the boxes at all, neither with PySide2, nor with PySide6 grafik

Code:

from PySide2.QtWidgets import QApplication, QMainWindow, QRadioButton, QWidget, QVBoxLayout, QCheckBox
import sys
import qt_material

class MainWindow(QMainWindow, qt_material.QtStyleTools):
    def __init__(self):
        QMainWindow.__init__(self)
        qt_material.QtStyleTools.__init__(self)

        widget = QWidget()
        widget.setLayout(QVBoxLayout())
        widget.layout().addWidget(QRadioButton('radio button 1'))
        widget.layout().addWidget(QRadioButton('radio button 2'))
        cbc = QCheckBox('check box 1, checked')
        cbc.setChecked(True)
        widget.layout().addWidget(cbc)
        widget.layout().addWidget(QCheckBox('check box 1, unchecked'))
        self.setCentralWidget(widget)

if __name__ == '__main__':
    app = QApplication()
    qt_material.apply_stylesheet(app, theme='dark_blue.xml')
    mw = MainWindow()
    mw.show()

    sys.exit(app.exec_())

for this I installed qt-material globally for both python versions using pip

YeisonCardona commented 3 years ago

Hi @leon-thomm

  1. There is no reason for the differences between PySide2 and PySide 6, can you please confirm that both windows look exactly the same without any theme?, maybe the app.setStyle('Fusion') in one of them is the problem, I just remove this feature recently.

  2. Please check the installation of qt5-svg and qt6-svg and verify that from Python 3.9 and PySideX you can handler other SVG images.

I'm so sorry that I can't make this test by myself, I don't have a windows machine.

leon-thomm commented 3 years ago
  1. Oh, yes you are right, sorry, it's a PySide thing, seems like they changed some default styling for PySide6. my bad.
  2. I'm not sure how to check that? The QtSvg module is there, and I can create and display QSvgWidgets (in PySide2, I think they removed it in PySide6, it's not there anymore). Anything specific I should check?
leon-thomm commented 3 years ago

apparently my python installation was a bit bugged. PySide2 (and PySide6) failed to load some (existing) svg modules on Python 3.9, which was resolved by a clean reinstall of Python 3.9 and the packages