I'm new to Qt. I'm under Win 10, 64bit, using Visual Studio 2019.
I installed Qt 5.15.1 a while ago to work on an open source project. Python and CMake are also installed. vcvarsall.bat was also executed.
Now I'm working on a new project where I need QtCharts. I found that QtCharts was not installed by default. So I installed QtCharts with the Qt MaintenanceTool.exe. After that, I was expecting to see the *.lib files added to the lib folder but what I see are added *.prl files.
What is the next step for me to get the *.lib files.
Well, I found the .lib files I was expecting are there in the lib folder. I'm not sure how and when they got there. I re-checked in the lib folder after I succesfully built Qt provided examples that use QtCharts within Qt Creator. The dates on the files are from back to September 2020, though. Like if the files had been copied from another folder or from an archive.
Anyway. My problem is solved.
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.
I've been trying to import an open-source project into Qt-Creator to read the code and to learn from it by debuging. Unfortunatly I cannot build imported projects. I found two interessting projects:
https://sourceforge.net/projects/qpass/files/source/
and
https://github.com/keepassx/keepassx
I imported them into Qt Creator by File-->New File or Project-->Import Project-->Import as qmake Project (Limited Functionality). Afterwards I tried to run the project and I got an error:
G:\Qt Projekte\keepassx-2.0.3\src\autotype\test\AutoTypeTest.h:23: Fehler: autotype/AutoTypePlatformPlugin.h: No such file or directory
The file is definitely existing and it's within the project. I googled it and found that there might be problem when importing Qt4 projects into Qt5. Some user recommended to insert 'Qt += widgets' into the pro-File. But it didn't solve my problem.
Does anybody have an idea how to fix it? Is the way how I am importing projects into Qt Creator wrong?
Instead of "New File or Project", you want to use "Open File or Project". Since both projects use cmake, you should be opening their topmost CMakeLists.txt file. I've verified that both of the projects open that way on OS X with Qt/Creator from macports and build successfully using either the default CodeBlocks - Unix Makefiles CMake Generator, or CodeBlocks - Ninja.
Here are the things I had to do to get the builds going:
Add the macports binary path (/opt/local/bin) to the system environment in the project's build settings. That's so that cmake would find ninja. This is optional if you don't use ninja, but ninja speeds up builds by a good integer factors so it's recommended over make.
Add the /opt/local/include path to the INCLUDE_DIR path in QPass's CMakeLists.txt: otherwise it wouldn't find gcrypt's include files from macports. That wouldn't be a problem on most linux distributions, but you'd need a similar fix on windows.
I was trying to create a exe file of my Qt project.
I found this post: How to create executable file for a Qt Application?
and realised that i dont have a mingwm10.dll file in that directory.
Are there any other ways of creating a exe file or any other location where mingwm10.dll might be located?
I am using qt 5.6.
mingwm10.dll is a runtime file for the MinGW.org toolchain. Qt moved towards a MinGW-w64-based toolchain (which is essentially an expanded and newer implementation of the Win32 headers and import libraries), which doesn't have this runtime dependency. Ignore it, you don't need it. You might need the libgcc and libstdc++ DLLs though, but that's the same with any (non-statically built) toolchain.
Note you can use the windeployqt utility to automatically copy over all runtime depencies of an executable. You can enable it by adding windeployqt to CONFIG if you're using qmake, or you could just run it yourself:
windeployqt my_app.exe
This command will copy all DLLs (including the Qt platform plugins etc.) so that the application can be run by e.g. double-clicking, instead of only in the specific environment of an IDE.
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.
I am new to QT. I am using "qt creator 5" with "opencv" on ubuntu 13.04. I want to run program written and executed on my machine is to be executed as well on other windows and Ubuntu machine.
thanks in advance
On Linux:
You should place Qt so files along the release version of your executable. These are libQtCore.so, libQtGui.so and possibly the ones for other modules that you have used. These so files are in your installed Qt Directory in lib folder or in director /usr/lib/i386-linux-gnu. If you are using plugins you should place their so files in a folder named plugins beside your binary. In case of using icons and images you should ship their so files like libqico.so and libqsvg.so in a folder named imageformats.
On Windows:
You can compile your code on Windows using Qt Creator and Microsoft Visual C++ Compiler.
You should place Qt DLLs along the release version of your executable. These are Qt5Core.dll, Qt5Gui.dll and possibly the ones for other modules that you have used. These dll files are in your installed Qt Directory in bin folder. You should also place msvcr100.dll and msvcp100.dll in case you are using MSVS2010. If you are using plugins you should place their dll in a folder named plugins beside your exe. In case of using icons and images you should ship their dlls like qico.dll and qsvg.dll in a folder named imageformats.