I do not use Qt6 because of the Qt Group's restrictive licensing policies. They have gone from being a promoter of open source software to a group that just wants to make money. I don't see any difference between them and Microsoft any more.
I am sticking with using Qt5 under open source licensing. If you really want to use Qt6 under an open source license, then I think the only option is to compile it from source code. You can download the source code here.
After you download the source code, you need to unzip it. You must then run the "configure" script to create the CMake hierarchy needed to build the binaries. After that, you will compile the source code. Finally, you will "install" the binary files in the place where you want them to live for building your projects.
To make this easier, I have written some Windows scripts. Here are the scripts I use. I have an external HDD with the drive letter "G:" that I use for all of my Qt-related code. On that drive, all of my Qt libraries live in a "Qt" top level directory. I also used the Qt 6.8.0 release when I built it.
1. First, create the directories where the source, build, and install files will live. On my PC, this is:
G:\Qt\6_8_0\6.8.0\
src (where I unzip the source code I downloaded)
build (where I will compile the source code)
msvc2022_64 (where I will install the 64-bit libraries, built with MXVC2022)
G:\Qt\6_8_0\6.8.0\
src (where I unzip the source code I downloaded)
build (where I will compile the source code)
msvc2022_64 (where I will install the 64-bit libraries, built with MXVC2022)
To copy to clipboard, switch view to plain text mode
2. Next, in the build folder, I create 3 Windows BAT files for configuring the build, building the binaries, and installing the binaries.
These files are doconfig.bat
..\src\configure -redo -opensource -prefix G:\Qt\6_8_0\6.8.0\msvc2022_64 -release -qt-zlib -make examples -nomake tests -skip qtwebengine -skip qtconnectivity
..\src\configure -redo -opensource -prefix G:\Qt\6_8_0\6.8.0\msvc2022_64 -release -qt-zlib -make examples -nomake tests -skip qtwebengine -skip qtconnectivity
To copy to clipboard, switch view to plain text mode
In this command, the "-prefix" option is the full path to your install directory. The "-release" option is specified, but scripts for both Debug and Release builds will be created. The "-make examples" option will also configure to build the examples. If you do not want this, use "-nomake examples" instead. I chose not to make tests and skipped the qtwebengine and qtconnectivity modules. Be sure you include the "-opensource" option. The "-redo" option ensures that everything is configured new, otherwise some parts of a previous configuration might still be hanging around.
dobuild.bat
cmake --build . --parallel
cmake --build . --parallel
To copy to clipboard, switch view to plain text mode
This will perform a parallel (multitasking) build of whatever was configured in the previous step.
and doinstall.bat
cmake --install .
cmake --install .
To copy to clipboard, switch view to plain text mode
The copies the DLL, LIB, and header files to your install directory.
3. Next, open a Visual Studio Developer Command Prompt window for your compiler. You can find this on the Windows Start menu under Programs -> Visual Studio 2022 -> Visual Studio Tools. You cannot use an ordinary Windows Command window, you must use the Visual Studio window because it sets up environment variables for building source code using the VC++ compiler.
4. In the command prompt window, CD to your "build" directory. From there, run doconfig. If everything goes OK, you should see a message at the end saying that the build was successfully configured. If you have an error, then something is probably missing from your system that is required for the build. You will have to fix it and run doconfig again until there are no errors.
5. Now, run dobuild. This will compile the source code. It will take a long. long, time. Hours. With luck it will complete without errors if the configuration was correct.
6. Finally, run doinstall. This will copy all of those nice new libraries into your installation folder.
When you are done, you can use the Qt VS Tools extension in Visual Studio to add the new version and set it as the default for building your projects.
Hope this helps.
Bookmarks