Skip to content

Commit 2c18933

Browse files
committed
fix: Windows Server 2016 compatibility due to Qt6 upstream
1 parent 73395b3 commit 2c18933

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Install Qt
3838
uses: jurplel/install-qt-action@v3
3939
with:
40-
version: "6.10.0"
40+
version: "6.10.1"
4141
arch: win64_msvc2022_64
4242
modules: qt5compat qtshadertools
4343
cache: true

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <QCoreApplication>
77
#include <QGuiApplication>
8+
#include <QOperatingSystemVersion>
89
#include <QQmlApplicationEngine>
910
#include <QQmlContext>
1011
#include <QQmlEngine>
@@ -15,6 +16,15 @@ int main(int argc, char *argv[]) {
1516
QCoreApplication::setOrganizationName(QStringLiteral("ConnectTool"));
1617
QCoreApplication::setApplicationName(QStringLiteral("ConnectTool"));
1718

19+
#if defined(Q_OS_WIN)
20+
if (const auto osVersion = QOperatingSystemVersion::current().version();
21+
osVersion < QOperatingSystemVersion::Windows10_1809.version() &&
22+
qEnvironmentVariableIsEmpty("QT_QPA_PLATFORM")) {
23+
// Avoid missing text on Windows Server 2016 and older Windows builds.
24+
qputenv("QT_QPA_PLATFORM", "windows:nodirectwrite");
25+
}
26+
#endif
27+
1828
QGuiApplication app(argc, argv);
1929
QQuickStyle::setStyle(QStringLiteral("Material"));
2030

0 commit comments

Comments
 (0)