Build qt5.8 with desktop opengl option (ubuntu) - qt

I built the sources of Qt5.8 with the option ./configure -opengl desktop
Then, I did a make and finally sudo make install. Now I changed the .profile file as pointed here: http://doc.qt.io/qt-5/linux-building.html
But I have a question: How can I start now qt creator ide?

It seems you're looking for qt creator, which isn't bundled in the qt sources and must be compiled separately, however if you want qt creator alongside with your new qt build, download the qt creator alone and install it, after that open the qt creator, go to Settings -> Build & Run -> Qt Versions , from there you can add new qt versions, just point to qmake which is located in your new qt installation (Probably /usr/local/qt5/bin/qmake) , now add a new kit via Kit's tab and then you can use your newly installed qt with qt creator.

Related

Qt.labs.plarform is not installed only in release mode

I am using FileDialog from Qt.labs.platform 1.1 on win 10 in Qt creator, compilator I use is Desktop Qt 5.15.2. MinGW 64 bit.
In the debug mode is working everthing fine but when I change to release mode I get following error in from the compilator:
QQmlApplicationEngine failed to load component
qrc:/main.qml:6:1: module "Qt.labs.platform" is not installed
I tried things like clean and rebuild or restart the computer and also change the number of import version but nothing helps. Any ideas how to solve that, please?
Check folder, where you are building your release (where *.exe is generated):
does it contains some Qt's *.dll's?
If yes: there is two ways to resolve your problem:
Remove all Qt *.dll's and run your application from Qt Creator (then Qt Creator will take all Qt *.dll's from folder, where Qt is installed).
Or add all needed Qt *.dll's with correct folder structure to folder with your release *.exe (to do it for Windows release use windeployqt tool: https://doc.qt.io/qt-6/windows-deployment.html )
Why you have such error from the compilator?
Because you have some Qt *.dll's in your release folder (beside the *.exe), but not all needed (e.g. you have only Qt6Core.dll). So Qt Creator will find this dll and will try to find other dll's in your release folder. Qt Creator will not check its installation directory to get dll's.
But if you have no Qt *.dll's in your release folder, then Qt Creator will find them in its installation directory.

Specify minimum Qt version for QtCreator / QMake build

I have a Qt project previously build using Qt 5.11. In order to support MacOS Mojave'e Dark Mode, I have updated the build to use Qt 5.13.2. This works perfectly, but the kit version is stored locally in the session settings not with the .pro project file.
I wish to enforce a minimum Qt kit version for the build, so that the build will abort if the correct kit version is not selected, ideally in the .pro file rather then the source code. How can I do that?
using versionAtLeast or lessThan you can check the Qt version. For instance:
equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 12) {
message("Cannot use Qt $${QT_VERSION}")
error("Use Qt 5.12 or newer")
}
or better:
!versionAtLeast(QT_VERSION, 5.12.0) {
message("Cannot use Qt $${QT_VERSION}")
error("Use Qt 5.12 or newer")
}

open a Qt cmake project in Qt Creator always re-run cmake

I took over a Qt project using cmake on Windows platform; every time I open this project in Qt Creator IDE (by open the top level CMakeLists.txt), Qt Creator always re-run cmake for this project. Then when I run this project, even without changing anything, cmake will re-build the complete project (because cmake is re-run).
How can I avoid such re-build? I use cmake 3.12 and Qt Creator 4.10
p/s: I noticed that there is a similar question [1], but the answer there doesn't help to avoid the re-run.
[1] Can I prevent auto-run of CMake at startup of Qt Creator 4?

I cannot integrate Qt and VTK

I am trying to integrate VTK and Qt but unfortunately for some reasons I cannot. Currently, I can run VTK's examples except those using Qt's user interface. For example, examples in tutorial work but examples in infovis cannot be run.
I followed the guide on http://www.vtk.org/Wiki/VTK/Configure_and_Build. All parts were done successfully except :
cmake -DQT_QMAKE_EXECUTABLE:PATH=/path/to/qt-4.8.6-build/qt-everywhere-opensource-src-4.8.6/bin/qmake \
-DVTK_Group_Qt:BOOL=ON \
-DBUILD_SHARED_LIBRARIES:BOOL=ON \
/path/to/VTK
when I was in VTK-build directory, it said that there was no path/to/VTK. So, I changed to VTK and removed /path/to/VTK and it worked.
Whenever I tried to build an aforementioned example, Qt says :
cannot find -lQVTK
error: cannot find -lvtkRendering ....
I really appreciate any help you can provide.
If you have installed the VTK in a folder named, say, "VTK-install", then check if you have QVTK.lib in the VTK-install/lib/vtk-5.10/ folder. (your vtk version will be different though).
In the Qt Creator, you have to edit the pro file. This is what you have to add to the end of the pro file created in Qt creator.
INCLUDEPATH += C:\\VTK\\VTK-install\\include\\vtk-5.10
LIBS += -LC:\\VTK\\VTK-install\\lib\\vtk-5.10
LIBS += -lvtkCommon\
-lvtksys\
-lQVTK\
-lvtkViews\
-lvtkWidgets\
-lvtkInfovis\
-lvtkRendering\
-lvtkGraphics\
-lvtkImaging\
-lvtkIO\
-lvtkFiltering\
-lvtklibxml2\
-lvtkDICOMParser\
-lvtkpng\
-lvtkpng\
-lvtktiff\
-lvtkzlib\
-lvtkjpeg\
-lvtkalglib\
-lvtkexpat\
-lvtkverdict\
-lvtkmetaio\
-lvtkNetCDF\
-lvtksqlite\
-lvtkexoIIc\
-lvtkftgl\
-lvtkfreetype\
-lvtkHybrid\
And run it in release mode. This should work fine.
If this doesn't work, make sure you have installed Qt and VTK correctly. You can check out this tutorial on how you should install Qt with VTK in MS Visual Studio 2010.
Install Qt with VTK
Of course, after this you got to install Qt creator which is better than Visual Studio to work with Qt.

Importing a CMake project in QtCreator

I'm trying to import my Cmake project in QtCreator, which I'd want to use as code editor, but with completition for Qt classes an the possibility to do the build via Ctrl+R
When importing the Cmake project, the QtCreator ide hangs when running CMakeWizard when I try to select RunCmake. If I cancel an empty windows pops up and the project is not generated.
Is it possible to import an existing cmake project in QtCreator?
Ubuntu 10.10 x86_64, QtCreator 2.6
Normally you just do "Open Project" and then select the CMakeLists.txt as the project file. QtCreator will then ask you to run CMake once (to generate a CodeBlocks build file, which is then interpreted by QtCreator). After that you have native support for your CMake project.
It even works with rather complicated CMake scripts.
If you observe hangs etc., you should probably file a bug report with the QtCreator project.
I had a similar issue when qtcreator crashed when opening cmake projects created in older versions of qtcreator. Removing CMakeLists.txt.user and running qt from terminal resolved issue for me.
cd /path/to/project/
qtcreator .

Resources