Skip to content

Commit 4822eea

Browse files
committed
fix: Workaround for transparent window on DirectX bug
Workaround for DirectX bug in which windows background is initially drawn and cached. Fix #328, opacity slider broken on Windows
1 parent 925d937 commit 4822eea

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ using namespace Qt::Literals::StringLiterals;
7272

7373
Q_DECL_EXPORT int main(int argc, char *argv[])
7474
{
75+
#if defined(Q_OS_WINDOWS)
76+
// Workarround for broken opacity bug in DirectX RHIs...
77+
qputenv("QSG_RHI_BACKEND", QByteArray("opengl"));
78+
#endif
79+
7580
// Set theme
7681
qputenv("QT_QUICK_CONTROLS_STYLE", QByteArray("Material"));
7782
qputenv("QT_QUICK_CONTROLS_MATERIAL_THEME", QByteArray("Dark"));
@@ -111,10 +116,6 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
111116
parser.addHelpOption();
112117
parser.addVersionOption();
113118
parser.addPositionalArgument(QLatin1String("source"), QLatin1String("file", "File to copy."));
114-
QCommandLineOption qgsIgnore(QStringList() << QLatin1String("q")
115-
<< QLatin1String("qgs_ignore"),
116-
QLatin1String("Ignore QSG_RENDER_LOOP environment variable."));
117-
parser.addOption(qgsIgnore);
118119
parser.process(app);
119120
QStringList positionalArguments = parser.positionalArguments();
120121
QString fileToOpen = QLatin1String("");

0 commit comments

Comments
 (0)