Every Qt developer should be familiar with the common tools like qmake, Qt Designer and Assistant, but looking in your Qt installation's bin directory will reveal a few more programs there. In this and future blogs, we'll look at some of the lesser known Qt development tools.
First, let's review a list of the tools for which you should be familiar. A few, like moc, rcc, and uic may be less familiar to you if you primarily let qmake or your IDE take care of building software, but the tools shown in the table below are ones that most Qt developers use on a regular basis.
Table 1 - Commonly Used Qt Tools
||Qt Assistant documentation tool
||Qt Designer GUI layout tool
||Qt Linguist translation tool
||Localization tool to compile ts files to qm files
||Localization tool to extract translation strings and generate or update ts files
||Qt Meta Object Compiler
||Qt software build tool
||QML file viewer (for Qt Quick2/Scene Graph)
||QML file viewer (for Qt Quick 1)
||Qt resource file compiler
||Qt User Interface Compiler for generating code from ui files
If any of the tools above don't look familiar, I encourage you to review the Qt documentation to learn more about them. In this post we'll look at three lesser-known tools: lconvert, pixeltool and qlalr.
Lconvert is one of the translation tools included with Qt. It is a command line tool that can convert between different translation file formats. It was introduced in Qt 4.5.0. If you use Qt's standard ts files for translations, you may not have occasion to use this tool. However, if you use another translation file format, like the GNU Gettext PO format, lconvert can be useful for converting to and from this format. Even if you are using the ts file format, if your translations are done by a large translation house, they may not have heard of Qt's file format. However, they may be able to supply you with translations in XLIFF (1) format. The lconvert tool can convert your translations between XLIFF and PO format. Because it is a non-graphical command line program, you may find it useful to incorporate the tool into your software build system to automate building or conversion of translation files. The tool also has some filtering capabilities. You can get further details by reading the Qt documentation.
The Qt Pixel Zooming Tool, pixeltool, is a handy little graphical application that magnifies the screen around the mouse pointer so you can look more closely at individual pixels. It is useful for testing small areas of a graphical user interface (GUI), something you might need to do when developing a new custom widget or theme, for example. Pixeltool has a number of options that are accessible via a context menu. A screenshot is shown below, as well as the context (right click) menu.
Pixeltool has been a part of Qt for a long time, at least as far back as the early Qt 4 releases.
I hope you found this brief article regarding some of the more obscure Qt tools useful. I plan to cover more of the lesser known commands in future blog posts.
- XLIFF, Wikipedia article, accessed 12 February 2015, en.wikipedia.org/wiki/XLIFF
- QLALR Adventures, Using QLALR to generate a parser for a text adventure, Qt project blog post, accessed 12 February 2015, qt-project.org/quarterly/view/qlalr_adventures
- Developer Daze(tm) presents: A Closer Look at QLALR, Qt project blog post, accessed 12 February 2015, blog.qt.digia.com/blog/category/qlalr