Installing Qt Creator with MinGW - qt

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

Related

QT 5.11 macdeployqt mingw not installed by default?

I do not have the macdeployqt installed on Windows 10 alongside of the windeployqt tool. Nothing relevant or useful appears when searching about this issue so I'm forced to resort to stackoverflow.
windeployqt works fine, however the macdeployqt tool is not there. Is there a way to download the tool from somewhere possibly via the presently non working maintenance tool (due to the default repositories not working for me on QT5.11)?
The macdeploy tool's source code is shipped with Qt sources (qt-src\qttools\src\macdeployqt). Most of it's source code is within #ifdef Q_OS_DARWIN-blocks, and it's linked against Apple's CoreFoundation Framework, so I don't think you will ever get the macdeploy-tool to work on windows. Im curious how you compiled your application that you're trying to bundle; afaik you cannot cross-compile in a meaningful way as the CoreFoundation and other Mac-Frameworks are not available on any other platform.

Qt SDK download for MingW

I´m looking for Qt SDK for windows that uses MingW as the compiler. Unfortunately, on the official download sites, I can only find the one that uses MSVC. Or just the library instead of the whole SDK.
Can anybody tell me where I can find the version I am looking for, or explain what I should do if I download QT library, QT creator and MingW seperately?
Here you can find pre-release builds using MinGW 4.7.
http://releases.qt-project.org/digia/5.0.1/latest/
They work well with the MinGW builds distributed here:
http://sourceforge.net/projects/mingwbuilds/
The Qt builds come with Qt Creator, so you can install it and should be good to go after setting up your kits.
You can find binaries here:
http://qt-project.org/forums/viewthread/23002/
But then you ought to reconfigure installation manual or you may use this utility.
Some guy from Digia promised MinGW builds by the end of January, so you can wait instead.

Compiler configuration for Qt Creator

I am new to Qt and its IDE Qt Creator so pardon my ignorance.
When I try to compile my code I get the exception
"Qt Creator needs a compiler set up to build. Configure a compiler in the kit options".
I have installed MingGW for compiling C++ code.
However, I am having a problem configuring it for Qt Creator.
Any help will be appreciated. Thanks
I suspect you are using the new 5.0 Qt. It required a bit of prodding for me too.
If you look into Settings > Build & Run > Kits you should see an auto-detected entry which will probably have an exclamation mark in front and is not editable. Ignore this.
Add a new Kit
Give it a name, set the "Qt version" and select a compiler. (Compilers should have been auto-detected. If you do not see any compilers, you will have to set at least one up manually)
Click the "Make Default" button. (You may have to modify project build settings to use the new Kit too)
There may be a better way, but I do not know it. And you should probably use 4.x until 5 is out of beta.
I was also having the same problem, so what I did was this:
sudo apt-get install g++
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
I then closed the QT Creator, restarted it, and it worked.
I do not know which of the above two made it work, but it worked!
You are using Qt Creator 2.6.x, as those are the only ones that have kits.
Please go to Tools>Options>Build & Run>Compilers and add you mingw compiler there. You need to point creator to 'g++' in your mingw installation.
Then head over to the Kits tab and click on the desktop kit that creator should have created for you. In the details there is a field called Compiler (or Tool chain, don't remember). Select your mingw compiler there. Check the debugger field. If it is empty or using the gdb debugger that is part of mingw: Grab a debugger from http://builds.qt-project.org/, install it and point creator to that one. The debuggers delivered as part of mingw are known to not work well with creator.
Do not use the Nokia Qt SDK: Everything in there is terribly outdated by now!
This is just a starting point to troubleshoot your question, but the Qt Creator preferences has settings in the "Build & Run" area where you can define the location of your build toolchain: compiler, Qt version to build, etc. For mingw you'd have to point the right field to the location of g++, for a Qt version the location of qmake.
Not always the last version is the better. If someone is learning Qt to implement production solutions, is not good idea to use Qt version 5 (see the Qt5 change log). If you want to learn Qt programming, I think that the Nokia SDK is a good starting point, because you only have to install it as another Windows software, and start to coding.
By using linux is another good starting point, because you will have all the develop environment with a few apt-get commands.
When I started programming Qt, I lost a lot of hours to get a complete environment working with QtCreator, and I understand that not everybody has time for it.
I am using Qt Creator 3.5.1 based on Qt 5.5.1. The error "No compiler set in kit" has been a problem every time I have to configure a development system. The solution that worked for me is to select Tools/Options/Compilers and add a compiler. In my case a GCC compiler with Name:g++, Compiler path:/usr/bin/g++. The trick is to add the compiler before trying to add a Kit. If I add a Kit before I add a compiler I can never add the compiler to the Kit. If you having this problem delete the Kit, add a compiler, then add the Kit.
In your questions you must provide us more information about your problem, such as what versions of software are you using.
About your question, I think, that very good idea to you (as a beginner) is to use all-in-box QtSDK (link, need registration). There are ready-to-use QtCreator, MinGW and litle bit old Qt Libs in that QtSDK 1.2.1. So, you dont't need to configure it at all.
Hope, it'll help. Good luck!

Is Qt Creator built with Qt Creator?

Questions:
Is Qt Creator built with Qt Creator?
Similarly, is Qt Designer built with Qt Designer?
BTW, why are there two Qt IDEs? Are they competitors? Which one should I use? I am using Creator.
What is Qt SDK? I am asking this because the Qt Designer & Creator 2.2.1 and Qtmake 4.7.4 that I installed thro ubuntu 11.10 s/w centre does not work. The build menu is all greyed out.
When I downloaded the latest QtSDK (2.3.1/4.7.4) into a separate installation into /opt/QtSDK, both the ubuntu sanctioned installation and the /opt/QtSDK would work as expected.
Why did my ubuntu sanctioned installation not work without the SDK? What does the SDK do?
This one is for Ubuntu enthusiasts - Qt IDE requires the SDK to work, and yet ubuntu released both Creator/Designer without checking if they work first? There is no QtSDK installation item in s/w centre. Is that intentional, or a procedural bug?
After I build my desktop app (I am building a tabbed file explorer) on Linux, what steps do I need to make to have it running on Windows 7/Vista? Will I rebuild on a windows version of Qt Creator?
I also notice that Qt Creator code generation is not perfect. It would forget to include some Qt library files in the auto-generated code, and I had to correct that manually.
Is Qt Creator built with Qt Creator?
I believe so.
That doesn't mean that everyone who works on Qt has to use it - just that I believe that lots of people do.
I don't work for any of the companies that have produced Qt, but my reasoning is:
A Google search for "dogfooding qt creator" brings up plenty of hits, including this comment from November 2010:
We’re also “dogfooding” by releasing complex apps like Qt Creator and the Ovi Suite on the desktop ports of Qt
They've put a massive amount of effort into Qt Creator over the last few years. It's hard to imagine that being worthwhile, unless they used it themselves
At recent Qt Developer Days, Qt Developers have spoken really enthusiastically about Qt Creator
Similarly, is Qt Designer built with Qt Designer?
Yes. A look at the Qt Designer source code shows plenty of .ui (Designer) files.
Why are there two Qt IDEs? Are they competitors? Which one should I use? I am using Creator.
When you edit .ui files insiide Qt Creator, you are still running Qt Designer: it's simply showing the Designer window inside Creator, for convenience.
What is Qt SDK? ... What does the SDK do?
Qt SDK is just a convenient way to download all the Qt tools in one go. You don't have to use it.
This one is for Ubuntu enthusiasts ... Is that intentional, or a procedural bug?
Sorry - no idea. It's hard to imagine it being intentional though.
After I build my desktop app (I am building a tabbed file explorer) on Linux, what steps do I need to make to have it running on Windows 7/Vista? Will I rebuild on a windows version of Qt Creator?
You will need to install Qt on a Windows PC, and then build your source code in it.
You can either do that by using Qt Creator and the Windows compiler it includes (mingw) or you can use another compiler, if you have one, e.g. Visual Studio.
I also notice that Qt Creator code generation is not perfect. It would forget to include some Qt library files in the auto-generated code, and I had to correct that manually.
If you've used any non-Qt classes in arguments to signals and slots, then this answer may help you there.

Qt create executable

Is there a quick, straightforward way to make a Qt application into an executable? I attempted to follow the instructions at http://doc.qt.digia.com/4.1/deployment-windows.html but have been unsuccesfull thus far; I'm unable to Any help would be much appreciated. Thanks!
I always use CMake to build Qt projects, it's easy, free and cross platform. Guide : Compiling Qt4 apps with CMake. CMake also come with CPack to easly make installer for Windows, Mac and Linux.
I agree with chmod700 about the Qt Creator suggestion, it's not my favorite IDE but it's still really nice and easy.
Do you mean an installer package? I assume you are able to compile, link, and run your app and you mean how do you package it up for others.
http://installbuilder.bitrock.com/ <-- special handling of Qt based projects but costs $
http://www.jrsoftware.org/isinfo.php <-- my personal favorite and it's free (can be rough to learn advanced features though)
Though if you mean how do you build your app, you may want to try the new Qt Creator (http://www.qtsoftware.com/products/appdev/developer-tools/developer-tools#qt-tools-at-a) which will setup build targets for you and really makes desktop Qt dev a snap. Also if you're still using 4.1, you can now use 4.5 under the LGPL on all platforms making it almost a no-brainer to upgrade.
I'm not sure if I understand your problem. Assuming you're using MinGW, it's really easy and quite straightforward:
get the Qt sources and unpack them to some folder (f.e. c:\Qt\4.5.0-static)
install MinGW. Make sure the MinGW executable folder is in the %PATH% variable.
open a cmd windows, go to the Qt sources and run configure -static. You can add other config options if you like to, but usually you don't need that.
when building Qt finished, go to your application sources, open a cmd window and run the qmake of your built Qt installation -- i.e. c:\Qt\4.5.0-static\bin\qmake in the example given above.
run make
you get a statically linked binary in the end (you might want to check it with Dependency Walker).
Doing the same using Visual Studio is pretty similar.
Or do you want to build dynamically and create an installer package?

Resources