General: Update to Qt6

Migrate over to Qt 6 so that we can keep the UI toolkit pegged at the
current major version.

Unfortunately this also means we have to gut a small feature in the
progress dialogs, since the extras module doesn't exist in Qt6 anymore.

Few things of note:

QVector<> is internally an alias of QList now, so any changeover is due
to that to make the semantics a little clearer.

QtConcurrent requires arguments to be swapped on some invocations, and
discarding instances need to use the global thread pool instead.

fromStdList(), etc can be replaced with range constructors.

--no-angle and other commands are removed from newer versions of
windeployqt

QVariant::Invalid (and other type IDs) are deprecated and also break
existing functionality. Instead we can return default constructed
QVariants where applicable, which restores functionality that would be
broken if left as is (e.g. many list would straight up not populate or
have wonky size hinting).

The reason for this is that the QVariant(QVariant::Type) constructor
models a unique kind of internal QVariant state where it's considered
to be in an invalid state, but accessing the (supposedly) invalid state
will instead return a default constructed value of the internal type.

This kinda sucks because this means genuinely invalid states that would
warrant an assertion or other type of error would be silently ignored
and execution would continue on as normal, so this also enforces
correctness a little bit (on top of, well, fixing all the broken UI
controls).
This commit is contained in:
Lioncache
2025-11-28 22:19:49 -05:00
parent b8dcdcf514
commit b2bd0cd326
36 changed files with 169 additions and 195 deletions

View File

@@ -13,20 +13,20 @@ by running `git submodule update --init --recursive`.
**64-bit Note:** Except for Visual Studio and the Qt installer, ensure 64-bit (x86-64, x64) packages are installed.
* [Visual Studio 2017](https://visualstudio.microsoft.com/vs/) (Desktop development with C++)
* [Qt 5.10+](https://download.qt.io/official_releases/qt/) (MSVC 2017 64-bit specification)
* [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) (Desktop development with C++)
* [Qt 6.5+](https://download.qt.io/official_releases/qt/) (MSVC 2022 64-bit specification)
* [LLVM 6.0.1 x86-64](http://releases.llvm.org/6.0.1/LLVM-6.0.1-win64.exe) installation; currently must be installed to `C:\Program Files\LLVM\`
* [Python 3 x86-64](https://www.python.org/downloads/windows/)
## Build using Qt Creator
**Compiler Note:** Before starting, it is wise to select the 64-bit compiler by opening *Tools* > *Kits* > *Kits* tab.
The C and C++ compilers should be set to *Microsoft Visual C++ Compiler 15.0 (amd64)*.
The C and C++ compilers should be set to *Visual Studio Community 2022 (amd64)*.
**CMake Note:** At the time of writing, Qt Creator will search for a user-installed CMake but this is not necessary.
The CMake that comes with Visual Studio may be manually selected by opening *Tools* > *Kits* > *CMake* tab, then adding
a manual CMake with the path:
`C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe`.
`C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe`.
**Debugger Note:** To use Qt Creator for debugging, *Debugging Tools for Windows* must be installed from the
[Windows SDK package](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk). Once installed,
@@ -42,7 +42,7 @@ the Qt Creator kit should automatically detect CDB. Make sure the x64 version is
## Build using Visual Studio
**Qt Note:** It may be necessary to edit both CMAKE_PREFIX_PATH entries in the *CMakeSettings.json* file.
They should be set to `C:/Qt/<QT VERSION>/msvc2017_64/lib/cmake/Qt5`.
They should be set to `C:/Qt/<QT VERSION>/msvc2022_64/lib/cmake/Qt6`.
1. *File* > *Open* > *CMake*
2. Select *CMakeLists.txt* at root of cloned PrimeWorldEditor
@@ -51,11 +51,11 @@ They should be set to `C:/Qt/<QT VERSION>/msvc2017_64/lib/cmake/Qt5`.
## Build using Command Line
1. Launch *x64 Native Tools Command Prompt for VS 2017*
1. Launch *x64 Native Tools Command Prompt for VS 2022*
2. `cd <PATH TO PrimeWorldEditor ROOT>`
3. `mkdir build`
4. `cd build`
5. `cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=C:/Qt/<QT VERSION>/msvc2017_64/lib/cmake/Qt5 ..`
5. `cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=C:/Qt/<QT VERSION>/msvc2022_64/lib/cmake/Qt6 ..`
6. `ninja`
7. *PrimeWorldEditor.exe* is found in the `build/bin` directory.
@@ -64,7 +64,7 @@ They should be set to `C:/Qt/<QT VERSION>/msvc2017_64/lib/cmake/Qt5`.
## Requirements
* [Xcode 10.2+](https://developer.apple.com/xcode/)
* [Qt 5.10+](https://download.qt.io/official_releases/qt/) (macOS specification)
* [Qt 6.5+](https://download.qt.io/official_releases/qt/) (macOS specification)
* *cmake*, *ninja* and *python* installed using [Homebrew](https://brew.sh/)
## Build using Xcode
@@ -72,7 +72,7 @@ They should be set to `C:/Qt/<QT VERSION>/msvc2017_64/lib/cmake/Qt5`.
1. `cd <PATH TO PrimeWorldEditor ROOT>`
2. `mkdir build`
3. `cd build`
4. `cmake -G Xcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/Qt/<QT VERSION>/clang_64/lib/cmake/Qt5 ..`
4. `cmake -G Xcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/Qt/<QT VERSION>/clang_64/lib/cmake/Qt6 ..`
5. Open *PrimeWorldEditor.xcodeproj*
6. Edit/Build/Debug/Run
@@ -81,7 +81,7 @@ They should be set to `C:/Qt/<QT VERSION>/msvc2017_64/lib/cmake/Qt5`.
1. `cd <PATH TO PrimeWorldEditor ROOT>`
2. `mkdir build`
3. `cd build`
4. `cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/Qt/<QT VERSION>/clang_64/lib/cmake/Qt5 ..`
4. `cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/Qt/<QT VERSION>/clang_64/lib/cmake/Qt6 ..`
5. `ninja`
6. *PrimeWorldEditor.app* is found in the `build/bin` directory.
@@ -90,7 +90,7 @@ They should be set to `C:/Qt/<QT VERSION>/msvc2017_64/lib/cmake/Qt5`.
## Requirements
* A working compiler toolchain (GCC or Clang)
* *cmake*, *ninja*, *python3*, *qt5* (dev), *clang* (dev) packages
* *cmake*, *ninja*, *python3*, *qt6* (dev), *clang* (dev) packages
## Build using Command Line