On macOS, we see unexplained white flashes of the UI when overriding the scheme in the widget's constructor. This only happens when running the bundle, but not when running the executable. Work around that problem by setting the scheme immediately after constructing QApplication. Pick-to: 6.8 Task-number: QTBUG-126248 Change-Id: I4a5fe467d628fca5e52e1e36f43af8143239c7fa Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
17 lines
404 B
C++
17 lines
404 B
C++
// Copyright (C) 2020 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
|
|
#include <QApplication>
|
|
#include <QStyleHints>
|
|
|
|
#include "widgetgallery.h"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QApplication app(argc, argv);
|
|
app.styleHints()->setColorScheme(Qt::ColorScheme::Dark);
|
|
WidgetGallery gallery;
|
|
gallery.show();
|
|
return QCoreApplication::exec();
|
|
}
|