oclero / qlementine

⚠️🏗️ [WORK IN PROGRESS] 🍊Modern QStyle for desktop Qt6 applications.
https://oclero.github.io/qlementine/
MIT License
73 stars 16 forks source link

Visual glitches when changing application style from qlementine to a non-qlementine style #46

Open IoeCmcomc opened 11 months ago

IoeCmcomc commented 11 months ago

Visual glitches appear in the sandbox example when the application style changes from QlementineStyleto a non-qlementine style (e.g. fusionor windowsvista) after the main window (SandboxWindow) is created.

How to reproduce:

  1. In main.cpp file, comment out window->setCustomStyle(style);
  2. In main.cpp file, put the following code after main window creation:
    qApplication.setStyle("windowsvista"); // or qApplication.setStyle("fusion");
    qApplication.setPalette(qApplication.style()->standardPalette()); // Force new style palette
  3. Replace commented lines in the SandboxWindow constructor with the following code in SanboxWindow.cpp:
    _impl->setupUI_button();
    _impl->setupUI_buttonVariants();
    _impl->setupUI_checkbox();
    _impl->setupUI_radioButton();
    _impl->setupUI_commandLinkButton();
    _impl->setupUI_sliderAndProgressBar();
    _impl->setupUI_spinBox();
    _impl->setupUI_comboBox();
    _impl->setupUI_toolButton();
    _impl->setupUI_groupBox();
  4. Compile and run the sandbox
  5. Observe the issue

With fusion style

With windowsvista style

Note: Visual glitches don't occur when switching between fusion, Windows and windowsvista styles.

Debug information:

OS: Windows 11 23H2 Toolkit: Qt 5.15.2 MSVC2019 32-bit Compile mode: Debug

oclero commented 11 months ago

Thank you. I haven't tried to switch between styles, so wasn't aware of this bug. I'll take a look when I have time