Monday, February 1, 2021 - 09:47 ">  •  By Vy Duong  •  Qt
The latest release of Qt, version 6.0, arrived not only with API cleanups but also improvements in performance. The binding engine was brought into the C++ side of the Qt API, allowing C++ developers to take advantage of the powers of binding. This not only enhances performance, but also code readability. In this blog post, I’ll explain how to best use the newly added binding functionality in Qt 6.0 and provide a full, simple example to test run on your own machine. C++ to QML Binding Before we even look at bindings in C++, we need to look at what it is or how it operates. The best way is…
Monday, January 25, 2021 - 11:33 ">  •  By Christopher Probst  •  Qt
Unit testing is becoming an essential part of the software implementation process. Test-driven Development (TDD), for instance, mandates that before a requirement is even implemented a corresponding test case must be written. In the context of Graphic User Interfaces (GUI), developers are often confronted with having to write unit tests for what is typically validated by a human’s perception of the software’s look and feel. The Qt Test Module provides some tools that can facilitate this task. Using this module and illustrating it with a fun example hosted here, this blog describes how to…
Wednesday, October 28, 2020 - 09:47 ">  •  By Jeff Tranter  •  Qt
Update: Qt 6.0.0 has arrived! Read the announcement from The Qt Company's Lars Knoll and then check out our blog below for more details on the new release and migrating to Qt 6. Later this year will see the release of Qt 6.0.0, the first new major release since Qt 5.0.0 was announced almost eight years ago. It will offer a number of exciting new features and performance improvements. Unlike minor releases of the Qt 5 series, Qt 6.0.0 does not need to maintain binary or even source compatibility with Qt 5. That means that Qt 5 code will typically require porting to Qt 6. The…
Tuesday, September 22, 2020 - 11:33 ">  •  By Chris Rizzitello  •  Qt, QML
*Image courtesy of KDE.org I had the opportunity to attend Akademy 2020, KDE’s annual world summit — a free, non-commercial event organized by the KDE community. In case you’re not familiar with KDE, it’s an international team cooperating on development and distribution of free, open source software for desktop and portable computing. Not only is it one of the largest free software communities in the world, KDE is also one of — if not the — largest communities using Qt.  Due to the pandemic, the 2020 event was held virtually September 4-11. The first day encompassed training sessions…
Wednesday, July 8, 2020 - 16:26 ">  •  By Jeff Tranter  •  Raspberry Pi
It's been some time (over two years!) since I've blogged about recent happenings on the Raspberry Pi project. Even eight years after the initial launch, the project continues to move ahead with new hardware releases and software development. And it continues to sell, with over 30 million units shipped by the end of 2019. I'd like to review a few noteworthy items of interest to Qt and embedded software developers. New Hardware Releases The most recent big hardware release was the Raspberry Pi 4 in June of 2019 which sports a Broadcom Quad-core Cortex-A72 64-bit processor that…
Wednesday, April 29, 2020 - 07:09 ">  •  By Peter Winston  •  Open Source, medical device, Qt
This ongoing series provides a close-up look at our work helping two non-profit organizations, RespiraWorks and Project RED, create low-cost ventilators to fight COVID-19 in countries with developing economies. Progress reports will be posted regularly. June 4, 2020 No one likes surprises on projects, and I have written many times about how to prepare for and budget for the unexpected. But those are negative surprises. Positive surprises, on the other hand, are welcome. A few days ago, I got just such a surprise. Thanks to all the blogging and the publicity we’ve…
Monday, April 6, 2020 - 08:30 ">  •  By Krzysztof Krzewniak  •  GreenHouse, embedded systems
Developing an embedded product is a complex affair and often involves multiple teams working in parallel to achieve the common goal of shipping the product to market. It is not uncommon to find oneself in a situation where one of the teams is dependent on a critical part being delivered by another team.  For example, the HMI team might need to interface with some hardware or service that is yet to be delivered. And, even if that's not the case it is usually not practical to supply every developer with a full working hardware setup. For these reasons, your software architecture should…
Thursday, April 2, 2020 - 12:19 ">  •  By ICS Development Team  •  GreenHouse, Qt
One of the most effective software engineering approaches involves separating the user interface (UI) or frontend from the business logic or backend, especially when it comes to developing embedded devices. This practice makes it far easier to code for a single specific functionality versus coding an overall product.  This is something we address in ICS' rapid-development solution GreenHouse by ICS, in which we encapsulate our software architecture best practices derived from hundreds of successful projects.  GreenHouse's approach to application separation uses an interchangeable…
Friday, March 20, 2020 - 14:39 ">  •  By Jeff Tranter  •  Qt
The QFile class in Qt 5.15.0 provides an API that supports moving files to the trash in a portable way. It works on Windows, macOS, and on Linux desktop platforms that support the freedesktop.org specification. Two new methods are provided: bool QFile::moveToTrash() moves the file associated with a QFile instance to the trash, returning true if it succeeds. In addition, it sets the object's fileName() to the path where the file can be found in the trash. The static method bool QFile::moveToTrash(const QString &fileName, QString *pathInTrash = nullptr) performs a similar function, but…
Monday, February 10, 2020 - 08:58 ">  •  By Peter Winston  •  Qt, embedded systems, GreenHouse
Successful touch devices appear deceptively simple to the user. In reality, they are highly complex and challenging to build because they require so many different skills. Each device requires custom hardware, touchscreen, operating system and web connectivity, as well as  custom software. Getting it right is the difference between winning or losing before you ever get to market.  ICS has devised a smarter way to build embedded devices. In fact, it’s a sophisticated solution to a complex problem. Built on the popular Qt framework, our rapid development toolkit eliminates…
Monday, February 3, 2020 - 16:45 ">  •  By Jeff Tranter  •  Qt
Qt 5.14 introduced a new class, QCalendar, which provides some useful functionality for localization of dates. An instance of a QCalendar object maps a year, month and day number to a specific day using the rules of a particular calendar system. The supported calendar systems (as of Qt 5.14.1) are: Gregorian (the default, and most widely used internationally) Julian (an ancient Roman calendar with too few leap years) Milankovic (a revised Julian calendar used by some Orthodox churches) Jalali (the Solar Hijri calendar, also called Persian) Islamic Civil (the tabular Islamic Civil…
Tuesday, January 28, 2020 - 12:29 ">  •  By Steve Holcomb  •  Qt, QML
In the world of Qt, the QTimeline object is intended to help control animations. It is an object that acts somewhat like a timer: it has a duration and an interface for start/stop/resume functions. But a QTimeline object does more. It has a value that changes from beginning to end and has an update-interval that controls how often a valueChanged signal is emitted. It can run once or run in a loop. One obvious usage of the QTimeline object is to control an animation in a GUI. Another usage could be to manage a variable that needs to have a particular range of values over a specified time.…
Monday, December 2, 2019 - 12:40 ">  •  By Boris Ralchenko  •  C++, Qt, QML run-time
Large files — I’m talking really large, say 8 gb — can be frustrating to download. How much fun it is to stare at the spinner icon or progress bar for more than a few seconds, let alone hours? When we first came up with an interactive storytelling tool called ViewPoint we butted up against this problem. But we found a solution that can work for you in a variety of non-ViewPoint environments. ViewPoint, which contains a built-in browser and video player, is essentially a presentation tool for custom touchscreen “experiences” that are shown on a variety of hardware, from large-format kiosks…
Tuesday, November 12, 2019 - 15:51 ">  •  By Jeff Tranter  •  Qt, Embedded
figure {max-width:600px; margin-bottom:25px} I just got back from a very successful Qt World Summit 2019 in Berlin. This year marked a much-appreciated return to the traditional two-day conference schedule (with a third, optional training day). Last year's shows in Boston and Berlin had a compressed format with only one day for the conference proper, and most people I spoke with felt that was too short. The venue was the Berlin Conference Center (BCC), where it has been held for several years now. The nearby Alexanderplatz public square was busy all week with displays and music…
Monday, November 4, 2019 - 14:59 ">  •  By Chris Cortopassi  •  QML, Qt
In the final installment in our QML Controls from Scratch series, this time we will implement an English-only Keyboard. There are typically three ways to display a virtual keyboard in a QML app: 1. Qt Virtual Keyboard 2. Use the keyboard that ships with the operating system (e.g. on Windows 10 call TabTip.exe in Tablet mode) 3. Roll your own virtual keyboard in QML If the keyboard must match a designer mockup, 3 is usually the only option, which is the approach we'll take here. Our Keyboard implementation consists of three QML files: Keyboard.qml: renders the full-screen keyboard, and…
Wednesday, October 30, 2019 - 17:46 ">  •  By Chris Cortopassi  •  Qt, QML
In this installment of our QML Controls from Scratch series we'll implement a ProgressBar, which is often used to indicate the progress of a long-running operation from 0 to 100%. ProgressBar is a read-only control so it's pretty simple, save for the math required to compute its width. ProgressBar is implemented with only two Rectangles. Its public properties are minimum, value, and maximum. ProgressBar.qml import QtQuick 2.0 Rectangle { // background id: root // public property double maximum: 10 property double value: 0 property double minimum: 0…
Wednesday, October 23, 2019 - 12:53 ">  •  By Jeff Tranter  •  Qt, Embedded
The market for embedded software development is one of the fastest growing areas of computing. But as the market grows, so too does the complexity of the devices. At a time when manufacturers are demanding more sophisticated "iPhone like" user interfaces and greater product functionality, today’s embedded devices often sport graphical user interfaces running on touchscreens and full operating systems based on Linux, and are developed in high-level languages like C++. It’s an exciting time for developers. But for Qt developers making the transition from desktop or mobile to embedded, there…
Tuesday, October 22, 2019 - 20:24 ">  •  By Chris Cortopassi  •  QML
Continuing our QML Controls from Scratch series, this time we will implement a PieChart. PieChart's public API consists of just a title and a list of points (whose x, y, and color members are identical to that of BarChart). Since PieChart is a Canvas, it makes heavy use of the Context2D API to draw its pie slices, callout lines, and text. We use a modified cosine to make the callout lines longer on the top/bottom and shorter on the sides so the text doesn't overlap when the pie slices are small and close together. Note: If using Qt 4 and/or QtQuick 1, replace Canvas either by a custom…
Tuesday, October 22, 2019 - 19:42 ">  •  By Chris Cortopassi  •  QML
Continuing our QML Controls from Scratch series, this time we will implement a LineChart. LineChart is similar to BarChart but with two exceptions: (1) it requires x axis tick marks and (2) it uses Canvas to draw the line curve. This is our first control to use Canvas, which is a rectangular area on which to draw with a Context2D. The public interface consists of a title, yLabel, xLabel, a list of points, and the color of the line. Note: If using Qt 4 and/or QtQuick 1, replace Canvas either by a custom QDeclarativeItem or an Image fed by a QDeclarativeImageProvider. LineChart.qml…
Tuesday, October 22, 2019 - 19:34 ">  •  By Chris Cortopassi  •  Qt, QML
Continuing our QML Controls from Scratch series, this time we will implement a BarChart. Many people who need charts in their application wonder if they need a charting library, but it turns out to be not that difficult to write a custom autoscaled chart. The public interface consists of a title, yLabel, xLabel, and a list of points, which contains a string for x, a number for y, and a color. Since Rectangle can be used to draw a line, all the pixels are rendered with just Rectangle and Text (as are all the controls so far in this series). The only tricky part is the math necessary to…
Wednesday, October 16, 2019 - 10:29 ">  •  By Chris Cortopassi  •  QML, Qt
QML provides a powerful and flexible framework for developing user interfaces (UI). The basic elements provided are low level, so you typically need to build up the components of your UI into widget-like controls. Creating a set of common QML controls can greatly reduce the overall development effort of your project. Back in 2017, we published a five-part series called Creating QML Controls From Scratch. In the series, we showed developers like you how to build a set of bare-bones QML controls to use as a starting point for the controls in a mobile or…
Tuesday, October 8, 2019 - 15:01 ">  •  By Chris Cortopassi  •  QML, Qt
Continuing our QML Controls from Scratch series, this time we will implement a DatePicker, which allows the user to select any calendar date (year, month, day). DatePicker's public interface consists of a set() function and a clicked() signal. A function set() is used instead of a property since DatePicker also returns a date (via clicked()) and we only want to set once (i.e. not a binding). set() and clicked() both pass a JavaScript Date, but use only the date part (year, month, day) and don't use the time part (hours, minutes). DatePicker is implemented as a ListView, which can be swiped…
Tuesday, October 8, 2019 - 14:41 ">  •  By Chris Cortopassi  •  QML, Qt
Continuing our QML Controls from Scratch series, this time we implement a TimePicker, which allows the user to select a time in terms of hours, minutes and am/pm. TimePicker's public interface consists of a set() function, a clicked() signal, and an interval property (to specify the granularity of minutes e.g. 1, 2, 5...). A function set() is used instead of a property since TimePicker also returns a time (via clicked()) and we only want to set once (i.e. not a binding). set() and clicked() both pass a JavaScript Date, but use only the time part (hours, minutes) and don't use…
Tuesday, September 24, 2019 - 23:27 ">  •  By Chris Cortopassi  •  QML, Qt
Continuing our QML Controls from Scratch series, this time we will implement a Table (i.e. a two-dimensional matrix of strings supporting an arbitrary number of rows and columns). The Table consists of two main parts: header and data. Consequently, it has two public properties (headerModel and dataModel) and one public clicked() signal, which is emitted when the user taps on a row of data. Both header and data are implemented with ListViews. The header background implements a half-rounded Rectangle by composing two Rectangles: one for the top two rounded corners, and another un-rounded…
Monday, September 23, 2019 - 18:07 ">  •  By Chris Cortopassi  •  Qt, QML
Continuing our QML Controls from Scratch series, this time we will implement Tabs. They are used to expand limited screen real estate by providing two or more "tabs" that divide the user interface into screens (content), only one of which is shown at a time. The Tabs control only renders the tabs themselves. A screen (content) for each tab must be implemented separately. Tabs has two public properties of interest: model (an array of strings) and currentIndex (indicating the currently selected tab), both of which are from ListView. To implement the content for each tab, simply provide…
Friday, September 20, 2019 - 15:37 ">  •  By Chris Cortopassi  •  Qt, QML
Continuing our QML Controls from Scratch series, this time we implement PageDots. They are often used in conjunction with ListView.SnapOneItem to indicate what "page" is currently shown. The public properties are page and pages to indicate the current page and total number of pages respectively. The dots are implemented with a Rectangle (configured as a circle) inside a Repeater. PageDots.qml import QtQuick 2.0 Item { id: root // public property int page: 0 // current property int pages: 3 // total // private width: 500; height: 100 // default size…
Thursday, September 19, 2019 - 21:18 ">  •  By Chris Cortopassi  •  Qt, QML
div.body h2 {margin-top:30px;} Continuing our QML Controls from Scratch series, this time we will implement a Dialog that supports an arbitrary number of Buttons (and we reuse our Button control). Its public API includes the text to show, an array of strings for the buttons, and a clicked() signal that provides the index of the button the user clicked. Unlike other controls in the series, Dialog is full screen so we place it at the root level in Test.qml and at the bottom so it is highest in z order (i.e. on top). The client code (in Test.qml) takes responsibility for…
Tuesday, September 17, 2019 - 10:05 ">  •  By Boris Ralchenko  •  Qt, Embedded
This blog is the third in an occasional series on ZeroMQ. For background, read part 1 and part 2. ZeroMQ encourages us to think in terms of patterns — what we are going to do rather than how we're going to do it. We don't need to worry about the how since ZeroMQ takes care of it. The built-in core ZeroMQ patterns are: Request/reply connects a set of clients to a set of services. This is a remote procedure call and task distribution pattern. Pub-sub connects a set of publishers to a set of subscribers. This is a data distribution pattern. Pipeline connects…