<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Mardy (Posts about qqc2-desktop)</title><link>http://mardy.it/</link><description></description><atom:link href="http://mardy.it/categories/qqc2-desktop.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:info@mardy.it"&gt;Alberto Mardegan&lt;/a&gt; </copyright><lastBuildDate>Sat, 11 Apr 2026 13:53:53 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>And now for something completely different: QtQuick.Controls 2 for the desktop!</title><link>http://mardy.it/blog/2018/11/and-now-for-something-completely.html</link><dc:creator>Alberto Mardegan</dc:creator><description>&lt;p&gt;As you might know, the &lt;tt&gt;QtQuick.Controls 1&lt;/tt&gt; module &lt;a href="https://wiki.qt.io/New_Features_in_Qt_5.11"&gt;has been officially deprecated&lt;/a&gt; since Qt 5.11; this had been in the air already since quite some time, given that the development of the module had almost stopped. It looks like The Qt Company is mostly investing on the more performing &lt;tt&gt;QtQuick.Controls 2&lt;/tt&gt; module, and is inviting developers to switch over to that — at least for new projects.&lt;/p&gt;

&lt;p&gt;However, there currently isn't a style available that would make an application using the &lt;tt&gt;QtQuick.Controls 2&lt;/tt&gt; look native on the desktop. There has been an &lt;a href="https://jriddell.org/2017/09/06/qqc2-desktop-style-beta-release/"&gt;attempt&lt;/a&gt; at it, but it soon turned into a custom style for the KDE desktop environment. So, some time ago I decided to give it a try: I started by forking the project of the KDE guys and as a first step I removed the dependency on the KDE libraries.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;figure&gt;
&lt;a href="http://mardy.it/archivos/imagines/blog/0ada813887ce03f72527a27e91dd7059-button-qml.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://mardy.it/archivos/imagines/blog/0ada813887ce03f72527a27e91dd7059-button-qml.png" data-original-width="580" data-original-height="96"&gt;&lt;/a&gt;
&lt;figcaption&gt;A button generated by the QML QQC2 desktop style&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;figure&gt;
&lt;a href="http://mardy.it/archivos/imagines/blog/560f77fd16c36393c5be4d0d95e17960-button-widget.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://mardy.it/archivos/imagines/blog/560f77fd16c36393c5be4d0d95e17960-button-widget.png" data-original-width="580" data-original-height="96"&gt;&lt;/a&gt;
&lt;figcaption&gt;A traditional &lt;tt&gt;QPushButton&lt;/tt&gt;&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;figure&gt;
&lt;a href="http://mardy.it/archivos/imagines/blog/941872169d511dec1d156db865fdcab0-button-diff.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://mardy.it/archivos/imagines/blog/941872169d511dec1d156db865fdcab0-button-diff.png" data-original-width="580" data-original-height="96"&gt;&lt;/a&gt;
&lt;figcaption&gt;The difference (enhanced in Gimp, or you wouldn't see a thing)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/div&gt;

&lt;p&gt;It's a work in progress, and it probably has a long way to go before it's usable for a real world product, but I'm trying my best to turn it into something you can trust: this is a project where &lt;em&gt;Test Driven Development&lt;/em&gt; fits very well, because in order to ensure pixel by pixel visual compatibility (that's my goal indeed!) I'm running a test where I create the same widget using the &lt;tt&gt;QtWidgets&lt;/tt&gt; module and with this &lt;tt&gt;QQC2&lt;/tt&gt; style, and comparing the resulting surfaces for equality. In the pictures above you can see how the &lt;tt&gt;Button&lt;/tt&gt; element looked earlier today (before I fixed it 🙂), compared to a traditional &lt;tt&gt;QPushButton&lt;/tt&gt;: the test code creates a visual &lt;em&gt;diff&lt;/em&gt; of the two images, and the test passes only if the resulting image is pitch black (with a very small tolerance for possible differences in font antialiasing).&lt;/p&gt;

&lt;p&gt;For the time being I'm focusing my attention on the visual appearance of the individual widgets and their implicit size, but I'll soon add tests (and code) for layouts and interaction behaviours. I also need to extend the tests: they are currently run in GitLab CI for Linux only (where I can test the &lt;tt&gt;Fusion&lt;/tt&gt; and the &lt;tt&gt;Windows&lt;/tt&gt; styles), but I hope to find a way to run them in &lt;a href="https://www.appveyor.com/"&gt;AppVeyor&lt;/a&gt; and on Mac OS. By the way, if someone knows of a CI service which would allow me to run my graphical tests on a Mac, please let me know in the comments.&lt;/p&gt;

&lt;p&gt;This is an early notice that the project exists; if you have some time and energy to spare, you are very welcome to &lt;a href="https://gitlab.com/mardy/qqc2-desktop"&gt;help me with the development&lt;/a&gt;.&lt;/p&gt;</description><category>english</category><category>kdeplanet</category><category>programmation</category><category>QML</category><category>qqc2-desktop</category><category>Qt</category><guid>http://mardy.it/blog/2018/11/and-now-for-something-completely.html</guid><pubDate>Fri, 30 Nov 2018 17:02:00 GMT</pubDate></item></channel></rss>