Quick User Interfaces with Qt
Looking at the future of Qt Quick, many things may happen. In MeeGo, the MeeGo touch initiative is implementing new widgets using Qt Quick. In KDE, Plasma is supporting Qt Quick. One effect of this is that you can write Plasmoids using QML. In the Qt tooling department, the trolls are working on a visual designer for Qt Quick. It already has a few interesting features—for instance, layers can be imported from GIMP and Photoshop directly into the designer.
Looking at Qt, I don't think we have seen the last widget-based application yet. Actually, when creating serious software for serious tasks, I see no reason not to use widgets. However, with the new focus on mobile, not only within the old Trolltech, but the entire Linux community, I think that Qt Quick will be a very frequently used tool.
Getting Started with Qt Quick
As Qt 4.7 recently was released, Qt Quick is becoming available through the repositories of most distributions. Some distributions choose to package Qt in several packages, so make sure you get the Qt development package, the Qt Creator package and all Qt modules, especially those referencing to Qt declarative. In the Linux world, I recommend you use the facilities provided by your distribution to install and maintain your software. However, for those of you needing a particular version of the Qt tools, or if you are using a distribution that doesn't include Qt, you can download the Qt SDK from Nokia's Web site.
The package that you want is the Qt SDK, available from qt.nokia.com/downloads. Simply download the file, chmod it to make it executable and run the installer. You can install it in your home directory if you do not have root access. The SDK includes tools, demos, sources and documentation, all in one convenient package.
Limitations of Widgets
There are a number of limitations imposed from building user interfaces with widgets that are addressed when switching to a graphics view-based approach. One obvious limitation is that widgets are rectangular and like to be arranged side by side, which makes it hard to arrange non-rectangular items in a good manner.
Another limitation is that widgets clip their children, which means children cannot extend outside their parent widget. Take a simple effect, such as having parts of a user interface explode. In that case, clipping is a limiting factor.
Another feature that widget-based systems usually do not support is sub-pixel resolution for item dimensions and placement. Also, transformations, such as scaling and rotation, are not supported by widgets. In a scene, all these features can be used to achieve the best possible visual experience.
Taking transformations over time, it becomes obvious that widgets are not meant to slide, bounce or generally move about. They are designed to be arranged in layouts based on grids, columns and rows, and they provide users with a standardized, structured user interface. This is very good when the user is using the computer as a computer. When the user is using a device, this type of computer interface is not the most appropriate solution.
Johan Thelin is a passionate Qt and open-source user. He spends his days at Pelagicore working with Linux and open source in the automotive industry. At night, he works as a consultant and freelance writer.
Johan Thelin is a consultant working with Qt, embedded and free software. On-line, he is known as e8johan.
Practical books for the most technical people on the planet. Newly available books include:
- Agile Product Development by Ted Schmidt
- Improve Business Processes with an Enterprise Job Scheduler by Mike Diehl
- Finding Your Way: Mapping Your Network to Improve Manageability by Bill Childers
- DIY Commerce Site by Reven Lerner
Plus many more.
- diff -u: What's New in Kernel Development
- What's New in 3D Printing, Part III: the Software
- Giving Silos Their Due
- Server Hardening
- February 2016 Issue of Linux Journal
- Controversy at the Linux Foundation
- 22 Years of Linux Journal on One DVD - Now Available
- Don't Burn Your Android Yet
- New Products