Making Qt Creator use MinGW - qt

This tutorial here shows how to add toolchains to Qt Creator. I didn't need that, since my installed MinGW automatically shows up there (I checked the path and it's right).
How do I make my project compile with it? I checked the projects tab on the left, and under none of the build configurations do I get the option to use MinGW (only Visual Studio).
Then I went to Tools->Options->Build and Run->Qt Version, and tried adding a Qt version for MinGW, but I simply don't have a qmake.exe for MinGW (or do I, and I'm just not aware?).
How can I make Qt Creator use MinGW?
Note: I have the Qt SDK.

Just to add a bit more specific info here. When I originally installed the QtSDK on windows I only had the MVSC option for building. To fix this run the Update QT SDK program and pick the Package Manager option, hit next. Expand "Qt SDK" -> "Development Tools" -> "Desktop QT" -> "Your QT Verision (mine is 4.8.0 (Desktop) at time of writing)" and you should only see a check box next to your Qt version for MSVC. Also check the MinGW option and hit next at the bottom. This will download and install mingw build tool chain for qt creator. You will then have the option to choose MinGW builds instead of MSVC.

In order to update Qt, and install mingw support, on windows, you will go to programs and features, find Qt, and right click on it. Click on change, and then hit next until you get to the "Setup - Qt" page. Click on "Add or remove components" then "Next". Wait while it updates "meta information" and then click the arrow next to the version you want to install qt for and check the box for the version of mingw you have (or everything to be safe). Then hit next and then update.
pic

Related

Qt Creator -> Qt Quick Application (QML) -> Design Tab -> Missing "Window"

In Design tab the "Window" is missing.
When I click the Design tab -> pop up three windows. three windows
After I close one -> disappear all of them.window title
It doesn't work when I try to drag and drop basic component's...
I reinstall the Qt Creator but the same thing...
Have a look at the following bugreport https://bugreports.qt.io/browse/QTCREATORBUG-26486
Here are some key points from the comments.
Three things you shouldn't have done:
Enable the QmlDesigner plugin (isn't officially supported by Qt Creator anymore, you can use Qt Design Studio)
Open a non-.ui.qml file in QmlDesigner
Open a file with a QtQuick.Window root element, which is not fully endorsed in QmlDesigner.
Support for Qt 5.15 requires a "kit" with a qml2puppet for Qt 5.15.
This setup is only properly supported and tested in Qt Design Studio.
If you use Qt Creator the puppet will be always built with the same Qt
version as Qt Creator.
QtCreator states are kept in the following locations:
Windows: %APPDATA%\QtProject and %LOCALAPPDATA%\QtProject\QtCreator
Linux: $HOME/.config/QtProject
macOS: $HOME/.config/QtProject
Please review those locations and backup/rename/clean up.
You should find this restores your Qt Creator to 'factory' conditions.

I could not understand which Qt version I am using

So when I click Help -> About Qt Creator I have a such message.
Why in heading says 4.11.1 but below I see that Based on Qt 5.14.1
This is which version is used to build Qt Creator... You should check from the maintenance tool for your installed version!

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

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

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.

"Design" button grayed out in Qt Creator for QML Project

I'm on a Kubuntu 11 system and trying out my first Qt Quick project. As this is Kubuntu I'm just running with the Qt that came with it, which has worked fine so far.
I asked Qt Creator to create the sample "Hello World" project from Qt Quick. But the design button was grayed out, as were the run buttons.
At first when I went into the Projects menu under "Run Settings" it said Qt version: [Invalid Qt Version]. Pushing the "Manage Qt versions" button brings up a tree control that looks like this:
v -- Auto-detected
| |
| +---Qt in PATH /usr/bin/qmake-qt4
|
+--- Manual
At the bottom of the dialog it says "Found Qt version 4.7.2, using mkspec linux-g++ (Desktop)"
I found out that I could get the "Invalid Qt version" message to go away by manually choosing to install QmlViewer from the app repositories. You'd think it would say something more like "Qml Viewer not found, please install it" but...oh well. Now it says Qt Version: [Qt in PATH].
So that's fixed, and the Qml app runs. But the "Design" button is still grayed out. Qt Designer is installed as an application, and its plugin shows in the "About Plugins..." list. The design button is enabled in ordinary (non-Qt-Quick) projects when I click on a form file, just not for .qml files.
in the QtCreator, go to Help -> About plugins -> Select "QT Quick".
Restart QtCreator and then select the ui.qml files. It should work now
In my case it wasn't showing up because I had my cpp file open. When I double clicked on the .ui file, the design button became active.
Solved it while writing the question.
To make a long story short: this appears to be a known issue in general with installing Qt Creator through the ubuntu repositories as opposed to using the Qt SDK Installer from Nokia:
http://qt.nokia.com/downloads
(That installer seems to do the work of making sure the proper SDK elements are installed, while the linux package repositories lag in getting things right.)
Another option seems to be building Qt from sources. But uninstalling the Qt Creator I got through KPackageKit and instead using the installer from Nokia was less involved, and worked for me in this case.

Resources