How to set up QTCreator compiler - qt

I'm completely new to qt Creator I have never ussed it before so I just installed it. Cause I need to change a little thing of this amazing program I'm ussing to graph serial data comming from an Arduino sensor:
https://os.mbed.com/users/borislav/notebook/serial-port-plotter/#commentform
Basically I'm doing an electrocardiogram and this program works perfectly but I need to change the colors cause is a standard medical thing to read the heart data in a white backround and the graph in color black. (this program has a black backround and a red graph).
And that's basically all I need, an executable program with just that colors, so I thought I try to edit the code but after I open this project in QT, it appears an error:
13:37:46: Configuration is faulty. Check the Issues view for details.
Error while building/deploying project prueba1 (kit: Desktop Qt 5.11.1
MSVC2015 32bit)
When executing step Make, QT Creator needs a compiler set up to build, configure a compiler in the kit options.
How does this can be done? Step by step. Thanks so much, I'm new to this plataform.

If you want to use MSVC 2015 in Qt Creator you have to install it manually.
You can get from any free version:
Visual Studio Community 2015
Visual Studio Express 2015 for Windows Desktop
Visual C++ Build Tools 2015
Note that you can also install the MSVC 2015 compiler as part of Visual Studio 2017, but Qt Creator does not support it.
Also note that you have to install the CDB debugger manually to debug your program, it is included in the Windows SDK.
If you are a beginner, it might be easier to use the MinGW toolchain. You can install it directly from the Qt Maintenance Tool.

Related

Can't make Qt Creator Work

I've downloaded and installed Qt Creator from its online installer and the latest version but when i try to create a Qt Console Application i get the following error. I haven't touched options. The picture is an error from when i tried to open a file from my professor but i get the same error when i try to create a new one. It could be pretty simple but its the 1st time im using this program as a student and have no idea whats going on. Thanks in regards for your timeenter image description here
If you are using Qt Creator with MSVC Compiler (Visual Studio), you need to also download the Visual Studio Compiler. Qt for MSVC doesn't come with a compiler.
It seems that you are trying to compile with VS 2017. You can Download Visual Studio 2017 from: https://www.visualstudio.com/es/downloads/
Express is free, the other two are paid, but don't download VS Code, it's for another purpose.
Alternatively, you can download only the compiler from: http://landinghub.visualstudio.com/visual-cpp-build-tools It's ligther but you don't get the IDE.
Also, for debugging, if you are on x86 or x64, download Windows CDB from: https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools
After you install this, you can reboot Qt and then it will show it has the appropiate compiler and debugger, like this (note that I use VS 2013):
There is another option if you don't want to download or use Visual Studio. Go to the Qt Maintenance Tool (uninstaller), Add or remove components, then install MinGW binaries of your favorite Qt Version, like this:
MinGW is free and it comes bundled with Qt, so you can build and run (and debug!) right away.

Building a Qt 4.8 application on Visual Studio

I'm working on building Open-Sankoré project (https://github.com/Sankore/Sankore-3.1) which is made by Qt 4.8-msvc compiler..
But, visual studio 2015 only works with Qt5 and doesn't accept Qt4 packages directly..
So my question is whether there's any walk-around that could be done to make visual studio build Qt 4.8 projects ?
You would have to compile Qt4.8 from source if you want to use Visual Studio 2015 with that exact version (4.8). There is no official release of Qt4.8 that was built using msvc2015.
If you are really tied to the Qt4.8 version, my suggestion would be to download and install lower version of Visual Studio and the corresponding compiler, e.g., msvc2008.
Although, before doing so, I would confirm if the project you are trying to build is really bounded to the Qt4.8 version. It might work as expected with the higher Qt version; or with some added modifications.
Sankore is a bit of a mess and is abandonware, but I've forked it and ported it to Qt 5 and it was not a big job. The build system is still iffy and I haven't tested it on anything but OS X.
It currently builds and functions from a stand-alone top project under Qt Creator, i.e. the dependencies (other than Phonon) get built alongside the rest of it.
Phonon builds under Qt 5 - see phonon4qt5. It needs cmake and may be a bit iffy. Only a few classes need phonon in Sankore, and thus require porting over to Qt Multimedia. That should be the first order of business if you wish to work on the code.
Check out the qt5-compat branch from these repositories:
https://github.com/KubaO/Sankore-3.1
https://github.com/KubaO/Sankore-ThirdParty
I'm accepting pull requests, of course.

How to debug/step into QT SDK sources from my project

I want to debug, set break points etc in QT SDK sources,
I have QT5.5.0 built with symbols and symbols are picked up, at lest GDB says so.
But I still cannot debug into for Example QGuiApplication, well I don't really care about QGuiApplication but I want to be able to set break point anywhere in QT Sources and stop there when my code get there.
I do have QT 5.5.0 project opened alongside with my project, but setting break point in QT5.5.0 does not have any effect, also stepping into any QT SDK code simply does nothing, it just stays where it was stopped by breakpoint in my project.
So question is how can I place breakpoints in QT SDK code anywhere I want and when I debug my project I will be able to stop in QT code. And how can I step into QT SDK code.
Ubuntu 14.04, QT 5.5.0, Creator 3.6.0, QNX ( ARM platform ) but it is irrelevant.
Don't install any QT binary (qtcore/qtgui),
build from source and
intall them with debug symbols, should be around 200~300M each library.
Make sure your example code is loading the debug version of qt files.

Linking error because of different versions MSVC and Qt libraries

I am having trouble with compiling a Qt project using the MSVC 2012 compiler. I downloaded Qt first, then realised I didn't have a proper compiler yet, and then downloaded Microsoft Visual Studio Express 2012 and its msvc compilers.
However, whenever I try to compile something in Qt Creator, it gives the following error:
qtmain.lib(qtmain_win.obj):-1: LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match with value '1700' in glwidget.obj
So my understanding of what this means is that my Qt libraries are of a different (older) version than my msvc compiler. But I am not sure how to fix it, or how to get other/newer libraries. Some googling told me that the following code added to the Qt .pro file should solve things:
QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
But that didn't have any effect. Also, using '1600' instead of '1700' didn't help. Any ideas on what will?
I am working on a 32-bit Windows 7 system, if that's any help, and I'm using Qt 5.0.0.
You need binaries compiled for the Visual Studio 2012. Since there is no official (or unofficial) precompiled binaries available, you need to compile them by yourself.
This should not be complicated process, but it can be hard and frustrating for beginners to do to it, so I would suggest you to follow already given advice and to download VS2010 (afterall, it will take less time to download and install it than to compile Qt from source).
You have to use MSVC 2010, because the libraries are built using it. Try Visual C++ 2010 Express.

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.

Resources