Open ptsavol opened 1 year ago
Windows 10, Python 3.11, PySide 6.4.1, pyqtdarktheme 2.1.0
Problem: Enabling a theme with qdarktheme.setup_theme() enables mouseTracking for QTabBars.
qdarktheme.setup_theme()
Steps to reproduce:
MoveEvent mouseTracking:True
PressEvent mouseTracking:False
Expected behaviour: Mouse tracking in QTabBar should be disabled when a theme is enabled.
Here's the example app.
import sys from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QTabWidget, QTabBar, QVBoxLayout, QWidget, QLabel import qdarktheme class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setFixedSize(400, 300) tab_widget = QTabWidget(self) tab_bar = CustomTabBar(self) tab_widget.setTabBar(tab_bar) push_button = QPushButton("PyQtDarkTheme!!") tab1 = QLabel("abc") tab2 = QLabel("def") tab_widget.addTab(tab1, "label1") tab_widget.addTab(tab2, "label2") self.layout = QVBoxLayout() self.layout.addWidget(tab_widget) self.layout.addWidget(push_button) self.container = QWidget() self.container.setLayout(self.layout) self.setCentralWidget(self.container) class CustomTabBar(QTabBar): def __init__(self, parent): super().__init__(parent) def mousePressEvent(self, event): print(f"PressEvent mouseTracking:{self.hasMouseTracking()}") super().mousePressEvent(event) def mouseMoveEvent(self, event): print(f"MoveEvent mouseTracking:{self.hasMouseTracking()}") super().mouseMoveEvent(event) app = QApplication(sys.argv) window = MainWindow() window.show() # Apply dark theme. qdarktheme.setup_theme() # Comment this line app.exec()
Windows 10, Python 3.11, PySide 6.4.1, pyqtdarktheme 2.1.0
Problem: Enabling a theme with
qdarktheme.setup_theme()
enables mouseTracking for QTabBars.Steps to reproduce:
MoveEvent mouseTracking:True
PressEvent mouseTracking:False
Expected behaviour: Mouse tracking in QTabBar should be disabled when a theme is enabled.
Here's the example app.