How to compile this qt program(There is no any pro file)? - qt

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.

Related

QML runtime environment not found

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

Qt application on Windows

So, I made a Qt application on Qt Creator that displays jpg files and mp3 files(using phonon).
On deploying the application with dynamic linked libraries I had to copy to the same folder QtCore4.dll, QtGui4.dll, phonon4.dll, mingwm10.dll and libgcc_s_dw2-1.dll as required by Windows.
The problem is that the jpg files and mp3 files are only shown on pcs with the QtSDK installed. In other pcs the exe file runs, opens the user interface and does everything right except showing jpg and mp3 files. The directory path is not the problem because it opens a pdfviewer that I put in the same folder. Do I need to provide other files?
Qt relies on plugins for most of the file formats. For Jpeg you will need to include the qjpeg4.dll found in the plugins/imageformats directory. For Phonon, you will also need to include the appropriate backend DLL found in the plugins/phonon_backend directory.
All the information you need is contained within the Qt documentation on Deploying an Application on Windows and especially the section on Qt Plugins.

Convert project Qt to file .exe for window

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.

Using lupdate tool

I'm using Qt 4.7.1 on window vista.I want to make my qt application to be translatable.
How can I use the Lupdate tool to generate .ts files?
From where I can run it from Qt creator or Qt linguist?
C:\Qt\4.7.4\bin
or where ever your QT files are found, just check the bin folder.
Google told me this:
http://doc.qt.nokia.com/4.7-snapshot/linguist-manager.html

How can I create a new Qt localisation for Qt itself?

Our application is localised and I have pulled in all the standard Qt_*.qm files as well so that my Qt dialogs are translated as much as possible.
However one of our distributors wants to add the Danish translation and its not in the standard Qt translation files.
How can I get Qt to create the file so I can send it off for translation?
There is some information about translation of Qt itself:
http://doc.trolltech.com/4.6/internationalization.html#produce-translations
it's said that templates for qt translation (*.ts files) should be in the ${QTDIR}/translations directory. I can't see them in my Qt4 installation from official Ubuntu repository but I think they should be included in distributions provided by Nokia on official download page.
Edit
Idea how to generate new empty *.ts file for qt itself can be found in translations/translations.pri directory of qt sources. For Qt 4.6.3 it will be
lupdate -locations relative -no-ui-lines -I../include -I../include/Qt corelib gui-ts ../qt_my.ts

Resources