I have QT version 4.7.4 (32 bit).
I am learning QML but don't know how to run it. The website says that QML runtime environment should be provided and it is installed with the QT itself. But there is no QML runtime environment in my computer. How to provide this environment manually?
It seems you need QML Viewer:
The viewer is located at QTDIR/bin/qmlviewer. To load a .qml file with the viewer, run the viewer and select the file to be opened, or provide the file path on the command line
Related
I wrote some app in Qt 5.7.1 with Qml Quick 2.6.
It does not run on another pc where Qt does not install.
In logs I see this error:
"[WRN] QQmlComponent: Component is not ready".
In Windows's Task Manager I see app is running, but there is no window of app.
All qml files I put in resourse file.
new QQmlComponent(&(this->engine),
QUrl(QStringLiteral("qrc:/qml/design/qml/main.qml")));
Dirs with app looks:
When I start app on another PC, there are no any message with errors about depence of some dlls. Please help...
Getting the correct (and minimal) set of DLL binaries copied over to the target machine isn't the easiest thing. But there's standard documentation for it and a helper tool called windeployqt that you should check out.
http://doc.qt.io/qt-5/windows-deployment.html
I'm trying to work on an open-source project in Qt Creator on OSX. When I open the CMakeLists.txt like other CMake projects in Qt Creator it doesn't open the project. No folders, source files, not even the CMakeList.txt shows up in Qt Creator, just a completely blank project.
What could cause a project to do this?
Edit: the project opens properly in Ubuntu. It shows the CMakeLists.txt, source files, and everything. It even builds properly when I CMake in the command line on OSX. Qt Creator in OSX just does not open this project properly.
Eit 2: My build settings are completely empty too. There are no General Messages or messages of any kind.
Open your Preferences (Cmd+, on Mac) and go to the Build & Run and then CMake tab, do you see any CMake version listed there? For me, I have to add a manual entry because it doesn't automatically find my CMake. My manual entry is set to /Applications/CMake.app/Contents/bin/cmake so compare that with what you have in your settings.
Then restart Qt Creator and reopen your project. Go to Build & Run again and make sure the Kit you have selected for your project has a CMake Tool set (should be automatic if you have just the one CMake entry listed on the CMake tab).
Background Information
It looks like you are using Qt Creator 4.0. With that version, they changed a number of things related to how CMake projects are handled. When you first open a project, it won't create the build directory if it doesn't exist. Instead, it will run CMake in a temporary directory. This would be shown in the General Messages output pane if you had it open. Once you manually create the output directory as it appears in your project's Build Settings, Qt Creator will switch to running CMake in there instead. There's no indication this is happening apart from what is logged in the General Messages output pane, even if there's a problem with your CMakeLists.txt.
In your case, if there's genuinely nothing appearing in your General Messages output pane and CMake is working fine from the command line, that suggests something may be wrong with your Qt Creator settings.
I download the code(a game made with qt 3d) from Qt learning websites
After decompressing it, all i found are some qml file and photos. There is no any c++ file or the pro file. How can i open this as a project not a file in the qt creator and run it?
Thanks
It does not contain any source code, just qml files. It is entirely written in interpreted QML. You would need to run the "main.qml", which is the "game.qml" here, through the qml viewer as follows:
qmlviewer-qt4 game.qml
or
qmlviewer-qt4 game.qml
These applications are installed by the qt/qtquick and qtquick1 packages on my Linux box.
Hello i'm a young develop on Qt. I want to know that can we convert project Qt (header, source, form, resource) to a file can run without Qt Creator? And how can we convert it to a file executable on window (.exe)?
The compiler is responsible for making an executable out of the source code. This has nothing to do with Qt.
When you start a program from the QtCreator an executable file is built by the compiler, then started. Have a look in your project folder to find that .exe file.
You dont have to do anything special. Each Qt project has a .pro file that is used for compiling. You need to use qmake on the command line with the .pro file as input. This will generate a makefile that you can then give to nmake.exe (if using Visual Studio compilers) or mingw-make (if you are uisng mingw compilers) to build. These steps will compile your source code into the .exe. Look through documentation of qmake to know more. Qt Creator also does the same steps and you can check out the buildlog in Qt Creator to see it working.
Yes, the exe file that you compile with Qt Creator or alternatively some other IDE or compiler is technically all you need to run the project from there on, except you need to have the linked Qt libraries somehow available to the executable. This is especially important if you plan to run it on a machine different from the one you developed it on. See the Qt documentation on Deploying Qt Applications for other details you may need to consider in that case.
I checked out a Qt project hosted on google code with SVN to a local folder. When I opened it on Qt Creator, it managed to compile the project, but when it tried to run the compiled program, an error message came up on the application output:
The process could not be started!
What is wrong?
I solved this problem by going to projects>run settings and manually specifying the executable. Found this solution by googling, don't know if it's the proper way to fix this.
I assume you tried to run it manually and not from the IDE by pressing Ctrl+R, and I assume that it works when you're running it from the IDE. If that's the case, the problem is that the compiled application requires the Qt libraries and the runtime loader can't find them. When deploying the app, you need to copy the Qt libraries it links against to the application folder (on Windows), or you need to copy them to the app directory and launch it via a wrapper script which adds that directory to LD_LIBRARY_PATH (on Linux.)