Merge pull request #2775 from Cacodemon345/qt-white-screen-fix

qt: try another fix for the issue
This commit is contained in:
Miran Grča
2022-10-30 19:53:14 +01:00
committed by GitHub

View File

@@ -5,6 +5,8 @@
#include <QLabel> #include <QLabel>
#include <QEvent> #include <QEvent>
#include <QFocusEvent> #include <QFocusEvent>
#include <QPainter>
#include <QStatusBar>
#include <memory> #include <memory>
#include <array> #include <array>
@@ -128,6 +130,15 @@ protected:
void showEvent(QShowEvent* event) override; void showEvent(QShowEvent* event) override;
void closeEvent(QCloseEvent* event) override; void closeEvent(QCloseEvent* event) override;
void changeEvent(QEvent* event) override; void changeEvent(QEvent* event) override;
void paintEvent(QPaintEvent* event) override
{
QPainter painter(this);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
painter.fillRect(0, 0, this->width(), this->height() - statusBar()->height(), QColorConstants::Black);
#else
painter.fillRect(0, 0, this->width(), this->height() - statusBar()->height(), Qt::black);
#endif
}
private slots: private slots:
void on_actionShow_non_primary_monitors_triggered(); void on_actionShow_non_primary_monitors_triggered();