Results 1 to 5 of 5

Thread: How could I use Qt6 after 10days to write open source projects ?

  1. #1
    Join Date
    Jan 2025
    Posts
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default How could I use Qt6 after 10days to write open source projects ?

    How could I use Qt6 after 10days to write open source projects ?

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,304
    Thanks
    313
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How could I use Qt6 after 10days to write open source projects ?

    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:

    Qt Code:
    1. G:\Qt\6_8_0\6.8.0\
    2. src (where I unzip the source code I downloaded)
    3. build (where I will compile the source code)
    4. 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

    Qt Code:
    1. ..\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
    Qt Code:
    1. 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
    Qt Code:
    1. 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.
    Last edited by d_stranz; 16th February 2025 at 18:32.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jan 2025
    Posts
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How could I use Qt6 after 10days to write open source projects ?

    Thank you for your answer

  4. #4

    Default Re: How could I use Qt6 after 10days to write open source projects ?

    This is really useful. I'm a bit new to compiling from source. Could you explain the purpose of the -skip qtwebengine and -skip qtconnectivity flags in the doconfig.bat file? Are those modules particularly difficult to build, or are they just not needed for most open-source projects?


    ** Moderator's note: Next time you include a spam link in your reply or signature, you will be banned. Zero tolerance for spammers here. **
    Last edited by d_stranz; 17th February 2025 at 17:09.

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,304
    Thanks
    313
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How could I use Qt6 after 10days to write open source projects ?

    Could you explain the purpose of the -skip qtwebengine and -skip qtconnectivity flags in the doconfig.bat file? Are those modules particularly difficult to build, or are they just not needed for most open-source projects?
    QtWebEngine has a lot of dependencies and is difficult to build because of that. I don't need an embedded browser in my applications, so I didn't include it in the build. QtConnectivity is mostly useful for embedded systems, since it supplies support for Bluetooth and NFC (near field communication), something I don't need in my desktop apps.

    If you need one of those, then if the configure script can't find some dependency, it will fail and tell you what it can't find. You either need to find that package (and possibly also build it from source) and tell CMake where to find it or use an implementation provided in the Qt distribution. This is what I did for "zlib" with the config option "-qt-zlib". Refer to Qt's documentation on building from source for some of these configure options.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. I can't open old projects / cpp files.
    By mirek_zaklosa in forum Newbie
    Replies: 3
    Last Post: 8th June 2019, 17:41
  2. Replies: 0
    Last Post: 26th November 2012, 14:18
  3. How do you get involved in open source projects?
    By SwedishPete in forum General Discussion
    Replies: 0
    Last Post: 22nd October 2009, 14:59
  4. Is Qt open source?
    By Saman in forum Newbie
    Replies: 4
    Last Post: 21st May 2009, 08:17
  5. Replies: 11
    Last Post: 24th March 2006, 07:40

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.