Add 32-bit versions of Qt 5.7 on a 64-bit machine - qt

Want to manually install 32-bit versions of Qt 5.7 so that I will be able to deploy my app to not only 32-bit but 64-bit machines as well.
Initially when I installed it on my 64-bit Windows 7 machine, I only selected the 64-bit components and, hence, I can only select the MSVC2015_64 bit kits in Qt Creator to build my app with.
Since I want to deploy my app to a 32-bit Windows 10 machine, I am trying to add the 32-bit Qt versions to my installation; tried through Tools > Options > Build & Run > Add... with no success. Searched for some answer/guide to the documentation and to other online sources but could not find how to achieve this in Windows.
Is it possible to manually add other Qt versions on a current install or is do I have to reinstall Qt? Also, could I simple install Qt with the desired Qt versions on a different directory than the first installation or will that mess up the PATH variables?

You have to launch Qt Maintenance Tool : Start -> Programs -> Qt -> Qt Maintenance Tool.
Skip the Qt login (unless you are using a commercial version of Qt).
Select "Add or remove components" and click yes. You'll be able to select other kits to download and install*.
Then Qt Creator should automatically add those kits, you'll just have to add them to your project : go to project settings once your project is open, and you'll find "Add kit" button in the upper left corner.
*Qt Maintenance Tool may prompt you to update components first if there's a new version available.

Kits are the key to your problem. A kit in Qt is composed of:
Version of Qt (and i'm not talking about Qt creator)
Compiler (you have to choose the correct compiler corresponding to your Qt Version, i will explain that more in detail, below )
Debugger (correct version 32 or 64 bits).
You can install as many versions of Qt as you wish Qt Creator will usually autodetect them all. Don't worry it won't damage your path, you can also install 2 different compilers (MingW and MSVC a.k.a VS compiler for example).
in Qt site : https://www.qt.io/download-open-source/
pick the version or versions of Qt you want to install and install them (the package include Qt Creator so no need to install it twice)
you also download the correct version of your compilers and debbuggers (if you don't already have them) and install them.
Once you've downloaded all the components and installed them, you go to Qt Creator :
Tools -> Options
in the lhs menu select Build & Run
you can go and check Qt Versions, Compiler and debugger to see if everything was auto-detected well.
if it's ok you can then create your kit :
go to the kits Tab
you can either add a new kit, but i prefer cloning an existing one and then edit it.
select the clone and choose the correct compiler, the correct version of Qt and the correct Debugger, rename your kit so you can recognize it. Save and close.
to use the kit you created you have to choose it in the project menu
see the screenshot below :
you can create as many kits as you wish, so you can have different configurations.

QtCreator can handle any number of "kits", where a kit is a combination of compiler + Qt version + (optionally) a deployment target.
See http://doc.qt.io/qtcreator/creator-configuring.html

Related

Design Mode requires a valid Qt kit, but installed and are able to run?

In Qt Creator it is possible to run the program clicking the green play button (using PySide6), but not edit the qml file in Design mode, where it gives the error "Line 0: The Design Mode requires a valid Qt kit" inside the design view. I created a project and selected Qt for Python (qml).
But I have installed several gb of the newest Qt version during installation? I have also selected the correct python env in the options.
When I create a non-qml project, but add a .qml file later a popup error says:
"The QML emulation layer (QML Puppet) cannot be built because the Qt version is too old or it cannot run natively on your computer. The fallback emulation layer, which does not support all features, will be used"
The Qt version is 6.2.2 and the OS is Windows 11. It is possible to use design mode in Qt Design Studio.
I meet the same problem and my environment is similar, choose Edit → Preferences and enter the Kits. Then select a Qt version and a kit you like (the type of qmake shall be the same, for instance, both of them is msvc), and remember to apply the changes.
After that, go back to the form editor and it works well. What confused me is that I must repeat the steps above each time I want to use Qt, the config seems to not be saved correctly. (The Qt version is 5.1.2 and the OS is Windows 11)
PS: After selecting the kit, you need to restart Qt.

Qt5.5.1: How to create QT application that uses frameworks generated from qt-everywhere-opensource-src

I should have asked this question before asking this
I am creating a QT app (on MAC) that should use frameworks compiled from qt-everywhere-opensource-src-5.5.1.tgz and not the one that comes with qt-opensource-mac-x64-clang-5.5.0.dmg.
I use QT creator installed by that DMG file and qmake in it somehow links with the frameworks installed by this DMG. (see this for more details)
Whats the legit way of making this QT creator use other framework.
Qt Creator has the concept of build Kits. A kit includes (among other things) a compiler, debugger and Qt version. In the Qt Creator preferences, go to the Build & Run section. Under the Qt Versions tab, ensure that your Qt 5.5.1 built from source is listed there. Then go to the Kits tab and either create a new kit or modify an existing one. Ensure that kit is using your Qt 5.5.1 version.
Once you've got that sorted out, a project can have one or more kits associated with it. From the main window, go to the Projects panel. Near the top of the Build & Run tab of the projects page will be the section where you select the kit(s) for the project. Ensure your project is using the kit you created/modified which uses your Qt 5.5.1. That should be enough to get your project building with your version of Qt instead of the one that comes with Qt Creator. To be absolutely sure, perhaps delete any previous build before you switch kits or even better, create a new build configuration in a new build/output directory for it.

Qt5 Issues: error: shell32.lib: No such file or directory

I'm trying to learn how to use Qt for dev and have to say it's been a pain from the start.
I installed Qt Creator 5.4 version. Then followed this http://qt-project.org/wiki/Qt_for_beginners_Hello_World.
It defaulted to MSVS so I manually added MinGw. It has a red sign next to it saying that MinGW cannot compile code for the QT version.
I just want to use Qt5 and need an appropriate compiler for it. I'm used to using MinGW in Eclipse for C++ dev.
Your installation seems to be incomplete or inconsistent.
To work with Qt you actually need two things: One is a compiler toolchain (called the "kit" in Qt Creator), the other is the compiled Qt library, which is what is visible in settings under "Qt versions". Both need to fit together for Qt to work.
In case you want to use Qt with Visual Studio, you should select the precompiled Qt version corresponding to your (previously installed) VS version during install when you use the online installer. Or use the offline installer for your VS version. After install, everything finds together itself.
Or you want to use MinGW. Do yourself a favor and use the MinGW version which is installed by the Qt installer, which is different to the one from MinGW.org (it is the 32 bit version of the MinGW-w64 project, which is more up to date than the one from MinGW.org, and has some other subtleties). It is selectable in the installer under "tools". Additionally select the Qt version precompiled with MinGW. After install, select the MinGW Kit for your new project, and everything again will work from scratch. Again, you can use either the offline installer including MinGW-precompiled Qt or the online-installer which has all versions of precompiled selectable to perform that installation.

Installing Qt Creator with MinGW

So it looks like with Digia taking Qt over from Nokia, that it's quite a mess to get a few simple downloads.
If I now go to the downloads page (http://qt-project.org/downloads), I see that there's a single Qt Creator 2.6.2 download for Windows. When I download this and run the installation, it seems that MinGW is no longer packaged along with it.
I tried to install MinGW 4.4 separately and then add a toolchain, but nothing runs when I try to compile my CMake-based project.
I then came across the Nokia website that is offering Qt SDK 1.2.1; however it now looks that they require you to create an account to be able to download the installer.
Downloading the full set of Qt libraries is probably what is going to be suggested, but that's not the best idea, because I'm basically writing up an installation procedure for a CMake-based, open-source set of libraries that I've been working on for a while (http://tudat.tudelft.nl).
Users aren't happy with having to download all the Qt libraries, since we're not using any of them.
I've completely run out of solutions now (and mind you, this only seems to be a problem for Windows, since when I install Qt Creator on Linux and Mac, GCC auto-detection seems to work fine).
So, in short, does someone have a simple install routine to install Qt Creator and get it to work with MinGW to compile a CMake-based project?
Thanks in advance!
Kartik
PS: I know there are plenty of threads on Qt Creator + MinGW, but they all seem to be outdated now with the recent changes on both the Digia and Nokia websites.
I should add that the problem specifically is not that the toolchains can't be auto-detected under Windows. I've managed to get both MinGW and CMake auto-detected by Qt Creator by adding both to the system path. The problem is that when I then try to open the CMakeLists.txt file for my project, I can't select any generators.
Straight forward:
Install Qt Framework
Install MinGw
Install CMake
Install other stuff, e.g. git
Install Qt Creator
As you already mentioned, the chances are good that Qt Creator gets everything via auto detect. Nevertheless, you should check the Qt settings if everything is in place, e.g. the debugger.
The first time you open a cmake project, Qt Creator (should) ask for the tool chain to use. If you want to change the chain afterwards, delete the build files and cmake directories.
More details to Qt Creator and cmake: http://qt-project.org/doc/qtcreator-2.7/creator-project-cmake.html

Qt Include and QMake error

Qt was messing up on Windows so I deleted it and re installed it with the qt libraries and Qt Creator. Now, whenever I try to open my old project, I get the error that "Qmake is does not exist or is not executable", and none of the Qt headers can be located.
Assuming you're using a recent version of Qt, such as version 4.7.4, and a recent version of Qt Creator, such as the branch 2.3 .*.
Probably somewhere in this process, Qt Creator or the settings for this specific project lost the reference to Qt install.
We first need to find out if Qt Creator knows where Qt is installed. Go to Tools > Options.... Then click in Qt4. Here will show all installed and detected Qt versions.
As you can see, I have one Qt version installed (4.7.4), which was automatically detected.
If you do not have any installed version, you need to indicate a one manually. Simply click Add and point it to the right qmake.exe. Use the paths of the figure as reference. If you are developing a windows/mingw application, just need to add the qmake.exe associated with mingw (c:\qtsdk\desktop\qt\4.7.4\mingw\bin\qmake.exe on my computer) and remember the Version name, we'll need that in next step.
After that, open the project and click on Projects in the lateral bar. You need to Substitute the Qt version. Click on Manage next to it and select the correct version. This should resolve the problem.
Any trouble just comment. Sorry about the creepy english.

Resources