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 .
Related
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.
How to use Qt with Visual Studio Code? I have Qt 5.15.1 installed which builds my code for macOS, Android and iOS.
Is it possible to have Visual Studio Code build my Qt application for macOS, Android and iOS like QtCreator does?
Environment:
My developer environment is macOS Catalina.
If you're using cmake, which you should, then all you need to do is configure your cmake project to point to your Qt folder, which basically means setting the project's Qt5_dir env variable to point to your Qt installation.
Here's what you need to do to get Visual Studio Code to work with Qt using Microsoft's CMake Tools extension:
Verify that you really have Qt installed,
Install Microsoft's CMake Tools extension,
Open CMake Tools extension's "Edit CMake Cache (UI)"
click on "CMake extension" on vscode's activity bar to open "CMake: project outline",
click on the "View and more actions" button (i.e., elipsis on upper right corner of the project outline.
Edit CMake's cache to point Qt5_dir to ${QTINSTALLDIR}/5.15.1/gcc_64/lib/cmake/Qt5
Rebuild project.
You can achieve the same goal by using cmake-gui to configure your cmake project.
If instead you really want to stick with qmake then it's enough to setup a build task that runs qmake.
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 am setting up Qt using CLion and build project successfully.
But the problem comes when I try to run it, which it does not run because it can't find the Qt Library.
When using QtCreator, I don't need to setup anything to run Qt project (it does automatically). So, how QtCreator run the project? So I can achieve it on CLion?
Already set PATH to Qt bin, but it does not work.
MMMMMM#unbuntu:~/QT/test4Qml$ qmlscene main.qml
qmlscene: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmlscene': No such file or directory
My Qt Development Environment does not have qmlscene. I googled it, and I only found *.deb. How should I do it?
As far as I know, Qt is not installed by default in /usr/lib/x86_64-linux-gnu/qt4. That directory is the default path when linux detects a dependency which requires Qt.
Where did you installed Qt? How did you installed it? Did you set the PATH environment variable to where Qt binaries are installed?
Usually, you have to follow the next steps:
1.- Install the the basic requirements for building Qt applications.
2.- Download Qt. I recommend Qt 5 using an offline installer. Otherwise, you'd need to compile from the source. Here you have a list of older versions of Qt.
3.- Set the environment variable PATH to the directory where you Qt bin directory is installed.