From 263e714022263e8e019a3c2f771274328b3d1b52 Mon Sep 17 00:00:00 2001 From: Syping Date: Thu, 11 Feb 2021 23:09:49 +0100 Subject: [PATCH] Fix Qt6 Windows build, improve build success consistency --- PictureDialog.cpp | 15 +++++++++++-- PictureDialog.h | 4 +++- gta5view.pro | 2 +- main.cpp | 5 ++++- res/gta5sync.ts | 52 +++++++++++++++++++++---------------------- res/gta5sync_de.ts | 50 ++++++++++++++++++++--------------------- res/gta5sync_en_US.ts | 52 +++++++++++++++++++++---------------------- res/gta5sync_fr.ts | 52 +++++++++++++++++++++---------------------- res/gta5sync_ko.ts | 52 +++++++++++++++++++++---------------------- res/gta5sync_ru.ts | 52 +++++++++++++++++++++---------------------- res/gta5sync_uk.ts | 52 +++++++++++++++++++++---------------------- res/gta5sync_zh_TW.ts | 52 +++++++++++++++++++++---------------------- 12 files changed, 228 insertions(+), 212 deletions(-) diff --git a/PictureDialog.cpp b/PictureDialog.cpp index 40c30c0..b0541d8 100644 --- a/PictureDialog.cpp +++ b/PictureDialog.cpp @@ -38,8 +38,10 @@ #endif #ifdef Q_OS_WIN +#if QT_VERSION >= 0x050000 #include "dwmapi.h" #endif +#endif #ifdef Q_OS_MAC #include @@ -293,11 +295,20 @@ void PictureDialog::styliseDialog() } #ifdef Q_OS_WIN -#if QT_VERSION >= 0x050000 +#if QT_VERSION >= 0x060000 +bool PictureDialog::nativeEvent(const QByteArray &eventType, void *message, qintptr *result) +{ + MSG *msg = reinterpret_cast(message); + if (msg->message == 0x031e || msg->message == 0x0320) { + styliseDialog(); + } + return QWidget::nativeEvent(eventType, message, result); +} +#elif QT_VERSION >= 0x050000 bool PictureDialog::nativeEvent(const QByteArray &eventType, void *message, long *result) { MSG *msg = reinterpret_cast(message); - if (msg->message == WM_DWMCOMPOSITIONCHANGED || msg->message == WM_DWMCOLORIZATIONCOLORCHANGED) { + if (msg->message == 0x031e || msg->message == 0x0320) { styliseDialog(); } return QWidget::nativeEvent(eventType, message, result); diff --git a/PictureDialog.h b/PictureDialog.h index f51c534..a35ebb4 100644 --- a/PictureDialog.h +++ b/PictureDialog.h @@ -90,7 +90,9 @@ protected: bool eventFilter(QObject *obj, QEvent *ev); void mousePressEvent(QMouseEvent *ev); #ifdef Q_OS_WIN -#if QT_VERSION >= 0x050000 +#if QT_VERSION >= 0x060000 + bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result); +#elif QT_VERSION >= 0x050000 bool nativeEvent(const QByteArray &eventType, void *message, long *result); #endif #endif diff --git a/gta5view.pro b/gta5view.pro index 2191beb..ed06e18 100644 --- a/gta5view.pro +++ b/gta5view.pro @@ -19,7 +19,7 @@ QT += core gui network svg greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -greaterThan(QT_MAJOR_VERSION, 4): greaterThan(QT_MINOR_VERSION, 1): win32: LIBS += -ldwmapi +greaterThan(QT_MAJOR_VERSION, 4): win32: LIBS += -ldwmapi DEPLOYMENT.display_name = gta5view TARGET = gta5view diff --git a/main.cpp b/main.cpp index c9d59ed..6707ec2 100644 --- a/main.cpp +++ b/main.cpp @@ -103,7 +103,10 @@ int main(int argc, char *argv[]) } #ifdef Q_OS_WIN -#if QT_VERSION >= 0x050400 +#if QT_VERSION >= 0x060000 + a.setFont(QApplication::font("QMenu")); +#elif QT_VERSION >= 0x050400 +#else if (QSysInfo::windowsVersion() >= 0x0080) { a.setFont(QApplication::font("QMenu")); } diff --git a/res/gta5sync.ts b/res/gta5sync.ts index b659722..f6d7bfd 100644 --- a/res/gta5sync.ts +++ b/res/gta5sync.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -192,21 +192,21 @@ Pictures and Savegames - - + + Snapmatic Image Editor - + Patching of Snapmatic Image failed because of I/O Error - + Patching of Snapmatic Image failed because of Image Error @@ -1019,78 +1019,78 @@ Y: %2 - + Export as &Picture... - + Export as &Snapmatic... - + &Edit Properties... - + &Overwrite Image... - + Open &Map Viewer... - + Open &JSON Editor... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate - + Snapmatic Picture Viewer - + Failed at %1 - - + + No Players - - + + No Crew - + Unknown Location - + Avatar Preview Mode Press 1 for Default View @@ -1854,7 +1854,7 @@ Press 1 for Default View - + Snapmatic Properties @@ -1947,7 +1947,7 @@ Press 1 for Default View - + Patching of Snapmatic Properties failed because of I/O Error @@ -2235,22 +2235,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? - + %1 User Statistics - + Yes, I want include personal usage data. - + &OK diff --git a/res/gta5sync_de.ts b/res/gta5sync_de.ts index 023da83..c72c189 100644 --- a/res/gta5sync_de.ts +++ b/res/gta5sync_de.ts @@ -177,8 +177,8 @@ Snapmatic Bilder und Spielständen ImageEditorDialog - - + + Snapmatic Image Editor @@ -210,13 +210,13 @@ Snapmatic Bilder und Spielständen S&chließen - + Patching of Snapmatic Image failed because of I/O Error Patchen von Snapmatic Bild fehlgeschlagen wegen I/O Fehler - + Patching of Snapmatic Image failed because of Image Error Patchen von Snapmatic Bild fehlgeschlagen wegen Bild Fehler @@ -1060,37 +1060,37 @@ Y: %2 Exportieren - + Export as &Picture... Als &Bild exportieren... - + Export as &Snapmatic... Als &Snapmatic exportieren... - + &Edit Properties... Eigenschaften bearb&eiten... - + &Overwrite Image... Bild &überschreiben... - + Open &Map Viewer... &Kartenansicht öffnen... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1099,37 +1099,37 @@ Taste 2 - Overlay umschalten Pfeiltasten - Navigieren - + Snapmatic Picture Viewer Snapmatic Bildansicht - + Failed at %1 Fehlgeschlagen beim %1 - - + + No Crew Keine Crew - - + + No Players Keine Spieler - + Avatar Preview Mode Press 1 for Default View Avatar Vorschaumodus Drücke 1 für Standardmodus - + Unknown Location Unbekannter Standort @@ -1231,7 +1231,7 @@ Drücke 1 für Standardmodus Keine gültige Datei wurde ausgewählt - + Open &JSON Editor... &JSON Editor öffnen... @@ -1906,7 +1906,7 @@ Drücke 1 für Standardmodus - + Snapmatic Properties @@ -2057,7 +2057,7 @@ Drücke 1 für Standardmodus - + Patching of Snapmatic Properties failed because of I/O Error @@ -2287,22 +2287,22 @@ Drücke 1 für Standardmodus TelemetryDialog - + %1 User Statistics %1 Benutzerstatistik - + You want help %1 to improve in the future by including personal usage data in your submission? Sollen bei Einreichungen Persönliche Nutzungsdaten einbezogen werden um %1 in der Zukunft zu unterstützen? - + Yes, I want include personal usage data. Ja, ich möchte Persönliche Nutzungsdaten einbeziehen. - + &OK &OK diff --git a/res/gta5sync_en_US.ts b/res/gta5sync_en_US.ts index 11a01de..da5b1e2 100644 --- a/res/gta5sync_en_US.ts +++ b/res/gta5sync_en_US.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -167,8 +167,8 @@ Pictures and Savegames ImageEditorDialog - - + + Snapmatic Image Editor @@ -200,13 +200,13 @@ Pictures and Savegames - + Patching of Snapmatic Image failed because of I/O Error - + Patching of Snapmatic Image failed because of Image Error @@ -1019,72 +1019,72 @@ Y: %2 - + Export as &Picture... - + Export as &Snapmatic... - + &Overwrite Image... - + &Edit Properties... - + Open &Map Viewer... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate - + Snapmatic Picture Viewer - + Failed at %1 - - + + No Players - - + + No Crew - + Unknown Location - + Avatar Preview Mode Press 1 for Default View @@ -1193,7 +1193,7 @@ Press 1 for Default View - + Open &JSON Editor... @@ -1854,7 +1854,7 @@ Press 1 for Default View - + Snapmatic Properties @@ -1999,7 +1999,7 @@ Press 1 for Default View - + Patching of Snapmatic Properties failed because of I/O Error @@ -2235,22 +2235,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? - + %1 User Statistics - + Yes, I want include personal usage data. - + &OK diff --git a/res/gta5sync_fr.ts b/res/gta5sync_fr.ts index 586b030..57e78f8 100644 --- a/res/gta5sync_fr.ts +++ b/res/gta5sync_fr.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -178,8 +178,8 @@ et les fichiers de sauvegarde de Grand Theft Auto V ImageEditorDialog - - + + Snapmatic Image Editor @@ -211,13 +211,13 @@ et les fichiers de sauvegarde de Grand Theft Auto V &Fermer - + Patching of Snapmatic Image failed because of I/O Error Échec du patch Snapmatic : I/O Error - + Patching of Snapmatic Image failed because of Image Error Échec du patch Snapmatic : Image Error @@ -1141,37 +1141,37 @@ Y : %2 Fichier invalide - + Export as &Picture... Exporter comme &image... - + Export as &Snapmatic... Exporter comme &Snapmatic... - + &Overwrite Image... &Remplacer l'image... - + &Edit Properties... Modifier les &propriétés... - + Open &Map Viewer... Ouvrir la &Visionneuse de Carte... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1180,37 +1180,37 @@ Touche 2 - Activer/désactiver l'overlay Touches fléchées - Naviguer - + Snapmatic Picture Viewer Visionneuse de photo Snapmatic - + Failed at %1 Echec de %1 - - + + No Crew Aucun crew - - + + No Players Aucun joueurs - + Avatar Preview Mode Press 1 for Default View Mode Aperçu Avatar Appuyer sur 1 pour le mode par défaut - + Unknown Location Emplacement inconnu @@ -1232,7 +1232,7 @@ Appuyer sur 1 pour le mode par défaut Échec de l'export de la photo Snapmatic - + Open &JSON Editor... Ouvrir l'éditeur &JSON... @@ -1916,7 +1916,7 @@ Appuyer sur 1 pour le mode par défaut - + Snapmatic Properties @@ -2069,7 +2069,7 @@ Appuyer sur 1 pour le mode par défaut - + Patching of Snapmatic Properties failed because of I/O Error @@ -2299,22 +2299,22 @@ Appuyer sur 1 pour le mode par défaut TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? Voulez-vous aider au développement de %1 en transmettant vos données d'utilisation ? - + %1 User Statistics Statistiques utilisateurs %1 - + Yes, I want include personal usage data. Oui, je veux partager mes données d'utilisation. - + &OK &OK diff --git a/res/gta5sync_ko.ts b/res/gta5sync_ko.ts index e226c59..5453fc8 100644 --- a/res/gta5sync_ko.ts +++ b/res/gta5sync_ko.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -202,21 +202,21 @@ Pictures and Savegames 닫기(&C) - - + + Snapmatic Image Editor 스냅매틱 이미지 편집기 - + Patching of Snapmatic Image failed because of I/O Error I/O 오류로 인해 스냅매틱 이미지를 패치하지 못했습니다. - + Patching of Snapmatic Image failed because of Image Error 이미지 오류로 인해 스냅매틱 이미지를 패치하지 못했습니다. @@ -1068,43 +1068,43 @@ Y: %2 닫기(&C) - + Export as &Picture... 내 PC에 이미지로 내보내기(&P) - + Export as &Snapmatic... 내 PC에 스냅매틱으로 내보내기(&S) - + &Edit Properties... 속성 편집(&E) - + &Overwrite Image... 이미지 덮어쓰기(&O) - + Open &Map Viewer... 지도 뷰어 열기(&M) - + Open &JSON Editor... JSON 편집기 열기(&J) - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1113,35 +1113,35 @@ Arrow Keys - Navigate 화살표키 - 이동 - + Snapmatic Picture Viewer 스냅매틱 이미지 뷰어 - + Failed at %1 %1에서 실패했습니다. - - + + No Players 플레이어 없음 - - + + No Crew 조직 없음 - + Unknown Location 알 수 없는 위치 - + Avatar Preview Mode Press 1 for Default View 아바타 미리 보기 모드입니다. @@ -1934,7 +1934,7 @@ Press 1 for Default View - + Snapmatic Properties @@ -2027,7 +2027,7 @@ Press 1 for Default View - + Patching of Snapmatic Properties failed because of I/O Error @@ -2320,22 +2320,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? 개인 사용 데이터를 제출에 포함시켜 %1이(가) 개선되기를 원합니까? - + %1 User Statistics %1 사용자 통계 - + Yes, I want include personal usage data. 예, 개인 사용 데이터를 포함시키고 싶습니다. - + &OK 확인(&O) diff --git a/res/gta5sync_ru.ts b/res/gta5sync_ru.ts index accee65..2c3bd72 100644 --- a/res/gta5sync_ru.ts +++ b/res/gta5sync_ru.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -181,8 +181,8 @@ Pictures and Savegames ImageEditorDialog - - + + Snapmatic Image Editor @@ -214,13 +214,13 @@ Pictures and Savegames &Закрыть - + Patching of Snapmatic Image failed because of I/O Error Не удалось изменить картинку Snapmatic из-за ошибки ввода-вывода - + Patching of Snapmatic Image failed because of Image Error Не удалось изменить картинку Snapmatic из-за ошибки Image Error @@ -1071,37 +1071,37 @@ Y: %2 Экспортировать - + Export as &Picture... Экспортировать как &картинку... - + Export as &Snapmatic... Экспортировать как &Snapmatic... - + &Overwrite Image... &Перезаписать картинку... - + &Edit Properties... &Изменить свойства... - + Open &Map Viewer... Открыть &карту... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1110,37 +1110,37 @@ Arrow Keys - Navigate Стрелки - Навигация - + Snapmatic Picture Viewer Просмотрщик фотографий Snapmatic - + Failed at %1 Ошибка при %1 - - + + No Crew Вне банды - - + + No Players Игроков нет - + Avatar Preview Mode Press 1 for Default View Режим просмотра аватарок Нажмите 1 для стандартного просмотра - + Unknown Location Неизвестное место @@ -1242,7 +1242,7 @@ Press 1 for Default View Картинки Snapmatic (PGTA*) - + Open &JSON Editor... Открыть &редактор JSON... @@ -1921,7 +1921,7 @@ Press 1 for Default View - + Snapmatic Properties @@ -2072,7 +2072,7 @@ Press 1 for Default View - + Patching of Snapmatic Properties failed because of I/O Error @@ -2302,22 +2302,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? Разрешишь нам собирать статистику о пользовании тобой %1? Это поможет нам в разработке. - + %1 User Statistics %1 Пользовательская статистика - + Yes, I want include personal usage data. Да, передавать данные о пользовании программой. - + &OK &ОК diff --git a/res/gta5sync_uk.ts b/res/gta5sync_uk.ts index 8699b68..32bf9a2 100644 --- a/res/gta5sync_uk.ts +++ b/res/gta5sync_uk.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -205,21 +205,21 @@ Pictures and Savegames &Закрити - - + + Snapmatic Image Editor Редактор Snapmatic зображень - + Patching of Snapmatic Image failed because of I/O Error Виправлення Snapmatic зображення не вдалося через I/O Error - + Patching of Snapmatic Image failed because of Image Error Виправлення Snapmatic зображення не вдалося через помилку картинки @@ -1058,43 +1058,43 @@ Y: %2 &Закрити - + Export as &Picture... Експортувати як &зображення... - + Export as &Snapmatic... Експортувати як &Snapmatic... - + &Edit Properties... &Змінити властивості... - + &Overwrite Image... &Перезаписати зображення... - + Open &Map Viewer... Відкрити &карту... - + Open &JSON Editor... Відкрити редактор &JSON... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1103,35 +1103,35 @@ Arrow Keys - Navigate Стрілки - Навігація - + Snapmatic Picture Viewer Переглядач фотографій Snapmatic - + Failed at %1 Помилка на%1 - - + + No Players Гравців немає - - + + No Crew Банди немає - + Unknown Location Невідома локація - + Avatar Preview Mode Press 1 for Default View Режим для аватарок @@ -1919,7 +1919,7 @@ Press 1 for Default View - + Snapmatic Properties @@ -2012,7 +2012,7 @@ Press 1 for Default View - + Patching of Snapmatic Properties failed because of I/O Error @@ -2300,22 +2300,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? Ви хочете допомогти %1 покращитись у майбутньому, включивши дані особистого користування? - + %1 User Statistics %1 Статистика користувачів - + Yes, I want include personal usage data. Так, я хочу включити дані особистого користування. - + &OK &OK &OK diff --git a/res/gta5sync_zh_TW.ts b/res/gta5sync_zh_TW.ts index c662606..1f139f6 100644 --- a/res/gta5sync_zh_TW.ts +++ b/res/gta5sync_zh_TW.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -201,21 +201,21 @@ Pictures and Savegames 關閉(&C) - - + + Snapmatic Image Editor Snapmatic 圖片編輯器 - + Patching of Snapmatic Image failed because of I/O Error I/O 錯誤,Snapmatic 圖片更新失敗 - + Patching of Snapmatic Image failed because of Image Error 圖片錯誤,Snapmatic 圖片更新失敗 @@ -1052,43 +1052,43 @@ Y: %2 關閉(&C) - + Export as &Picture... 匯出成圖片(&P)... - + Export as &Snapmatic... 匯出成 Snapmatic(&S)... - + &Edit Properties... 編輯屬性(&E) ... - + &Overwrite Image... 修改圖片(&O)... - + Open &Map Viewer... 開啟地圖檢視器(&M)... - + Open &JSON Editor... 開啟 JSON 編輯器(&J)... - + Key 1 - Avatar Preview Mode Key 2 - Toggle Overlay Arrow Keys - Navigate @@ -1097,35 +1097,35 @@ Arrow Keys - Navigate 方向鍵 - 導覽 - + Snapmatic Picture Viewer Snapmatic 圖片檢視器 - + Failed at %1 失敗: %1 - - + + No Players - - + + No Crew - + Unknown Location 未知地點 - + Avatar Preview Mode Press 1 for Default View 大頭貼預覽模式 @@ -1901,7 +1901,7 @@ Press 1 for Default View - + Snapmatic Properties @@ -1994,7 +1994,7 @@ Press 1 for Default View - + Patching of Snapmatic Properties failed because of I/O Error @@ -2282,22 +2282,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? 你希望通過收集資料來幫助改善 %1 嗎? - + %1 User Statistics %1 使用者統計 - + Yes, I want include personal usage data. 是的,我想幫忙. - + &OK 確定(&O)