Skip to content
Snippets Groups Projects
Commit d7649bf5 authored by Simon Bjurek's avatar Simon Bjurek
Browse files

bumped to qtpy6

parent d08a9e8c
No related branches found
No related tags found
2 merge requests!461Finalize earliest deadline scheduler,!459Qt6 fixes and scheduler class started
Pipeline #154422 failed
...@@ -31,7 +31,7 @@ from qtpy.QtCore import ( ...@@ -31,7 +31,7 @@ from qtpy.QtCore import (
Qt, Qt,
Slot, Slot,
) )
from qtpy.QtGui import QCloseEvent, QColor, QFont, QIcon, QIntValidator from qtpy.QtGui import QCloseEvent, QColor, QFont, QIcon, QIntValidator, QPalette
from qtpy.QtWidgets import ( from qtpy.QtWidgets import (
QAbstractButton, QAbstractButton,
QAction, QAction,
...@@ -98,9 +98,9 @@ if __debug__: ...@@ -98,9 +98,9 @@ if __debug__:
log.debug(f"Qt version (compile time): {QtCore.__version__}") log.debug(f"Qt version (compile time): {QtCore.__version__}")
log.debug(f"QT_API: {QT_API}") log.debug(f"QT_API: {QT_API}")
if QT_API.lower().startswith("pyside"): if QT_API.lower().startswith("pyside"):
import PySide2 import PySide6
log.debug(f"PySide version: {PySide2.__version__}") log.debug(f"PySide version: {PySide6.__version__}")
if QT_API.lower().startswith("pyqt"): if QT_API.lower().startswith("pyqt"):
from qtpy.QtCore import PYQT_VERSION_STR from qtpy.QtCore import PYQT_VERSION_STR
...@@ -1688,8 +1688,16 @@ def start_scheduler(schedule: Optional[Schedule] = None) -> Optional[Schedule]: ...@@ -1688,8 +1688,16 @@ def start_scheduler(schedule: Optional[Schedule] = None) -> Optional[Schedule]:
The edited schedule. The edited schedule.
""" """
if not QApplication.instance(): if not QApplication.instance():
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
app = QApplication(sys.argv) app = QApplication(sys.argv)
# Enforce a light palette regardless of laptop theme
palette = QPalette()
palette.setColor(QPalette.ColorRole.Window, QtCore.Qt.white)
palette.setColor(QPalette.ColorRole.WindowText, QtCore.Qt.black)
palette.setColor(QPalette.ColorRole.ButtonText, QtCore.Qt.black)
palette.setColor(QPalette.ColorRole.Base, QtCore.Qt.white)
palette.setColor(QPalette.ColorRole.AlternateBase, QtCore.Qt.lightGray)
palette.setColor(QPalette.ColorRole.Text, QtCore.Qt.black)
app.setPalette(palette)
else: else:
app = QApplication.instance() app = QApplication.instance()
window = ScheduleMainWindow() window = ScheduleMainWindow()
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment