7.2.2017

foto Petr Bravenec

Petr Bravenec
Twitter: @BravenecPetr
+420 777 566 384
petr.bravenec@hobrasoft.cz

When using KDE4 I had stock prices displayed in a simple charts on my desktop. I had one virtual desktop (activity) with all my investmens shown. Few weeks ago I moved to KDE5. My plasmoid Stock Charts stopped working and there is no chance to port old code to new KDE5. So I write new version of the plasmoid for KDE5:

StockCharts – Plasma 5 Extension

The application is very simple and the functionality is sufficient for me. There is nothing interesting on the application from user's view. The technology used is much more interesting.

KDE5 declined all programming languages to create desktop widget except one - the QML. This is the main reason why the original Stock Charts application written in C++ could not be ported to KDE5.

QML

I create applications in Qt more then ten years. QWidgets are perfect to create desktop applications so the QML was out of my scope. But when I needed to create some application for my mobile phone running Android, I started to experiment with QML. Applications created in C++ are strange in Android and the look and fill does not corespond with Android. QWidget and C++ are perfect for PC but not useful for Android.

QML is a language for creating graphical user interface in Qt. The basic idea is to separate the GUI layer and the computing layer. Buttons, labels, images, lists and other GUI component are made in a language specialised to describe the GUI. The functionality is made in C++ language - the database store, calculations, code recognition and other. Also, it is possible to use JavaScript in QML so the C++ is often unnecessary.

I like the idea to separate the GUI and computing layers. Many applications have different layers for GUI - web applications, HTTP pages (HTML + CSS + JavaScript) and others.

QML is simillar to HTML5. Although HTML5 can be used to create applications, the HTML is primary intended to describe documents, not applications. In contrast, QML is intended to create applications and it has much more widgets to create modern GUI application (layouts, data models, button, active areas, C++ connection and other).

QML is a declarative language and differs significantly from my favorite C++. At the begining I found it difficult to understand QML. Although I was able to create some simple applications, the expected "Wow" effect came when I tried to create the Stock Charts plasmoid. The QML can become one of my favorite technologies now.

Hobrasoft s.r.o. | Contact