Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: PySide6 support #249

Open
seriousm4x opened this issue Dec 9, 2020 · 8 comments
Open

Feature Request: PySide6 support #249

seriousm4x opened this issue Dec 9, 2020 · 8 comments

Comments

@seriousm4x
Copy link

seriousm4x commented Dec 9, 2020

Add support for PySide6, the successor to PySide2.
As Qt6 just got released and PySide6 is in the works, it would be time to add support for the new versions.

Overall its already usable, but I encounter small errors. This python code for example which works fine with PySide2:

import sys

import qdarkstyle
from PySide6.QtWidgets import QApplication

app = QApplication()
app.setStyleSheet(qdarkstyle.load_stylesheet_pyside2())
sys.exit(app.exec_())

Error:

No QCoreApplication instance found. Application patches not applied. You have to call load_stylesheet function after instantiation of QApplication to take effect.

Edit: PySide6 released the first stable version 6.0.0 on 10th Dec.

@krisfris
Copy link

krisfris commented Jan 25, 2021

Same error occurs when using PyQt6. Some styles are not correctly applied, there is overlap between widgets.

@olivierdalang
Copy link

As a workaround for now (hack), you can do that :

import sys
import qdarkstyle
from PySide6.QtWidgets import QApplication

app = QApplication()

# hack until proper PySide6 support : https://github.com/ColinDuquesnoy/QDarkStyleSheet/issues/249
sys.modules["PySide2"] = PySide6
app.setStyleSheet(qdarkstyle.load_stylesheet_pyside2())

sys.exit(app.exec_())

@seriousm4x
Copy link
Author

I just learned that this project uses qtpy. I'm gonna link these issues here.
spyder-ide/qtpy#229
spyder-ide/qtpy#233

@jaymegordo
Copy link

@ColinDuquesnoy looks like qtpy is getting close to rolling out PyQt6 support! spyder-ide/qtpy#233 ❤️

@jwaschkau
Copy link

qtpy 2.0.0 released https://github.com/spyder-ide/qtpy/releases/tag/v2.0.0

@rimpy-custom
Copy link

rimpy-custom commented Mar 8, 2022

As a workaround for now (hack), you can do that :

import sys
import qdarkstyle
from PySide6.QtWidgets import QApplication

app = QApplication()

# hack until proper PySide6 support : https://github.com/ColinDuquesnoy/QDarkStyleSheet/issues/249
sys.modules["PySide2"] = PySide6
app.setStyleSheet(qdarkstyle.load_stylesheet_pyside2())

sys.exit(app.exec_())

Have tried that solution, but widgets get misplaced(overlapped), might be smth on my side. Did you find the way to apply theme in better way?

@zariiii9003
Copy link

@dpizetta Could you create a release with the changes from the develop branch?

@Gracecr
Copy link

Gracecr commented Mar 27, 2023

Installing the develop branch is working for me.

pip install https://github.com/ColinDuquesnoy/QDarkStyleSheet/archive/refs/heads/develop.zip

A PyPi release would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants