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

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

Related

How to properly add a .qrc file to a QT 6 widget app with Cmake as building system?

I'm trying to use a .qrc file to store icon images for my QT application but the Resources.qrc file never appears in resource selection. I'm using CMake as building system and 6.3.1 QT version.
When simply adding Resource.qrc to source files with AUTORCC ON file never appears in project tree, when specifically written as project source in CMakeLists it appears in project tree, but never in resource selection when I'm trying to set ToolButton icon, no matter if I add prefix and images or not.
When AUTORCC is OFF and qt_add_resources(PROJECT_SOURCES Resources.qrc) added to CMakeLists, Resources.qrc file appears in CMake modules folder in a tree, but again, never in resource selection.
There are a lot of guides about .qrc when QMake is building system, but I hardly found anything about same thing with CMake, and none of them helped me, maybe I couldn't understand them properly. Sorry for possible mistakes, I'm new in programming and english isn't my native language. I'll be grateful for any help.

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

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.

Re-built Qt5.0.2 with OpenGL, how to use with Qt Creator

I need to move my code from a C++/OpenGL and Config.txt situation to a UI friendly space. I was told here to try Qt and installed it in Windows.
The issue I ran into is that it did not support the OpenGL version I needed out of the box and I had to rebuild with the -opengl desktop parameter.
First time doing this, but was able to follow the instructions (and a ton of Google) and it "succesfully" was built. My issue now is I am unsure how to make the files I have work with Qt Creator.
I copied over all the folders from the qt5 folder created by git over to the Src folder in Qt5.0.1/5.0.1/Src but the hellogl example still wouldn't build.
I checked the options and it was pointing to a qmake in Qt5.0.1/5.0.1/msvc2010/bin so I copied over the qmake.exe from qtbase/qmake over to this folder (renaming the old one) and now Qt Creator builds the hellogl example on my Windows system.
My worry is, did I do this the right way? I fumbled around and got something, but is this the way I should have proceeded after I built the qt5 from git? If not what was the way I should have gone about making it all work with the Qt Creator?
The typical way to utilize the modern OpenGL the feature set (post fixed-function pipeline) in Qt is by utilizing a extension wrangler (GLEW) that finds all the OpenGL functions your graphics drivers support BEFORE Qt includes any OpenGL headers.
To accomplish this simply do the following:
If you already haven't, download GLEW (or another extension wrangler if you wish) and install it in your system path. I would recommend the 32 bit package as it will be easier to work with.
#include glew.h in your source code before any other Qt header includes that may use OpenGL headers. Just to be safe, make glew.h the first header included in your source code.
In your Qt project's .pro file add the line LIBS += -lGLEW (mac/linux) or LIBS += -lglew32 (windows).
Note: Beware of using Qt OpenGL wrappers when implementing an application that uses post fixed-function pipeline facilities. Qt 5's OpenGL wrappers all operate using the OpenGL ES 2.0 specification which may cause problems when interleaved with your OpenGL 3/4 code. Even QPainter can become troublesome when performing overpainting on a QGLWidget due to it's heavy use of the fixed-function transformation stack. I am currently developing a library called QGLX that provides alternative Qt wrappers designed for complying to the modern desktop OpenGL specification. The beta will hopefully be released by the end of this year for Qt 4 & Qt 5.

installing a qt widget for qt designer

I downloaded a very useful widget for my applications. A LED indicator from http://qt-apps.org/content/show.php/QLedIndicator?content=118610
But there is no README file or any instruction files.
I unzip it and gave qmake QLedIndicator.pro and then make it compiled well without errors.
But I have no idea how to add the widget in Qt Designer, so I can drag and drop it where I need.
I'm using qt 4.8.3 with mingw. qt creator 2.6.0
Under Linux you just need to copy the file libQLedIndicatorPlugin.so in the
/usr/lib/qt/plugins/designer/
directory (or whatever is the directory on your distro).
Under Windows the process is similar, but you need to pay attention to the building process, as explained on the bottom of the page I linked
Qt's plugin architecture allows you to add custom widget to the designer. You can check out this official qt's link to do so - http://doc.qt.digia.com/4.7/designer-customwidgetplugin.html

QT multilanguage app

I am new in Qt framework and now, I want to create an app which supports multi-language display. I known there is a way to do: Qt Linguist. I searched, and archieved some information about lupdate, lrelease ... But I just have Qt Creator IDE, how can I run or compile lupdate, lrelease ???
How can I create *.ts file ?
Please give me some code example or guide to do. (I often use Qt Designer to create GUI)
As far as i know, there is no option in QtCreator to use QtLinguist - you have to do it manually. Here you have an excellent documentation about how to do it. I have learned from there also.

Resources