Skip to content

KDAB TV – Recent Videos KDAB's YouTube Channel: Qt, C++ and 3D tutorials, news and more

KDAB's YouTube Channel: Qt, C++ and 3D tutorials, news and more

KDAB as the global No.1 software consultancy for Qt, C++ and 3D applications and has been a relevant source for professional software developers for 20 years, offering a good mix of valuable information. As video content has become increasingly relevant, we have decided to offer regular, highly visible videos for professional developers using Qt, C++ and 3D technologies.

The channel offers tutorials for beginners and advanced developers presented by our experienced experts as well as show cases, C++, Qt and 3D related news, insights on events and trends. Click the tabs to explore.

KDAB TV – Latest

Do you remember to add qAsConst around your Qt containers when you iterate them? If not, there is a real risk that you are paying a price tag for them detaching just as you are about to start.

In  this episode Jesper has a chat with his coworker Peppe to better understand what qAsConst does, why and when it is needed and how to work around issues with iterating containers that are the result of calling a function.

0:00 Introduction
0:57 implicit shared
3:16  the container might be copied
3:40 what does the for loop expands to?
5:04 What is the cure?
5:35  Solution: create a const copy of the contrainer.
7:00  Solution: Make the method const
7:40 Colution: use qAsConst
9:05   qAsConst and rvalues
10:30 But but but - nobody else has access...
12:45 Returning a const
15:05  Standard containers
15:46  a C++20 solution
17:04 Summary

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/qAsConst

The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more.  https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/
Understanding qAsConst / std::as_const

Do you remember to add qAsConst around your Qt containers when you iterate them? If not, there is a real risk that you are paying a price tag for them detaching just as you are about to start.

In  this episode Jesper has a chat with his coworker Peppe to better understand what qAsConst does, why and when it is needed and how to work around issues with iterating containers that are the result of calling a function.

0:00 Introduction
0:57 implicit shared
3:16 the container might be copied
3:40 what does the for loop expands to?
5:04 What is the cure?
5:35 Solution: create a const copy of the contrainer.
7:00 Solution: Make the method const
7:40 Colution: use qAsConst
9:05 qAsConst and rvalues
10:30 But but but - nobody else has access...
12:45 Returning a const
15:05 Standard containers
15:46 a C++20 solution
17:04 Summary

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/qAsConst

The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more.  https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/

24 9

YouTube Video VVVqc0prVEpTWjVHN2V3SDJ1ZjA4dDBBLi1DTTQ1RDBRQmZj

Understanding qAsConst / std::as_const

In this interview about Python bindings in C++, Cristián will focus on Shiboken and Juan on Pybind11. They answer the questions below in order to compare the two solutions:

00:00 Intro
00:27 Why is binding generation important in Python and C++ projects?
01:43 What's the most popular use case of the Python bindings for C++?
02:47 What's the feature you are missing in them?
03:47 What's the next step for Shiboken and Pybind11 (next releases, features...)?
05:10 Is it possible to generate automatic bindings with Python?
06:21 How can someone get started with Shiboken and Pybind11?
07:55 Why are there 2 different Python bindings?
09:36 In Pybind11, bindings are created using C++ code. How is that done in Shiboken?

Cristián is an R&D Manager at The Qt Company, working with the Qt Core and Qt for Python teams. He also is one of the developers of the Qt for Python project. On his spare time, Cristián works closely with Open Source projects and initiatives, mainly focus on the Python community.
Twitter: https://twitter.com/cmaureir
LinkedIn: https://www.linkedin.com/in/cmaureir/

Juan Casafranca is a passionate programmer with a PhD in computer graphics. He has been developing 3D tools at KDAB since 2017. He left KDAB recently to pursue research in physically based mechanical simulation. 

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing, and innovative software across embedded, mobile, and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D, and more.  https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL, and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK, and the USA. https://www.kdab.com/about/contact/
Python Bindings for C++ Projects - Comparison between Shiboken and Pybind11

In this interview about Python bindings in C++, Cristián will focus on Shiboken and Juan on Pybind11. They answer the questions below in order to compare the two solutions:
00:00 Intro
00:27 Why is binding generation important in Python and C++ projects?
01:43 What's the most popular use case of the Python bindings for C++?
02:47 What's the feature you are missing in them?
03:47 What's the next step for Shiboken and Pybind11 (next releases, features...)?
05:10 Is it possible to generate automatic bindings with Python?
06:21 How can someone get started with Shiboken and Pybind11?
07:55 Why are there 2 different Python bindings?
09:36 In Pybind11, bindings are created using C++ code. How is that done in Shiboken?

Cristián is an R&D Manager at The Qt Company, working with the Qt Core and Qt for Python teams. He also is one of the developers of the Qt for Python project. On his spare time, Cristián works closely with Open Source projects and initiatives, mainly focus on the Python community.
Twitter: https://twitter.com/cmaureir
LinkedIn: https://www.linkedin.com/in/cmaureir/

Juan Casafranca is a passionate programmer with a PhD in computer graphics. He has been developing 3D tools at KDAB since 2017. He left KDAB recently to pursue research in physically based mechanical simulation.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing, and innovative software across embedded, mobile, and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D, and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL, and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK, and the USA. https://www.kdab.com/about/contact/

8 0

YouTube Video VVVqc0prVEpTWjVHN2V3SDJ1ZjA4dDBBLmVYLV9YaHdWNWFR

Python Bindings for C++ Projects - Comparison between Shiboken and Pybind11

In this video you will learn how to write Python scripts that are called into your C++ application using pybind11, one of the many solutions to do so.

All Python Bindings for C++ Projects: https://www.youtube.com/playlist?list=PL6CJYn40gN6gkvLnAUVgTRP7WAFxDbUEH

About the host:
Juan Casafranca is a passionate programmer with a PhD in computer graphics. He has been developing 3D tools at KDAB since 2017. He left KDAB recently to pursue research in physically based mechanical simulation.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing, and innovative software across embedded, mobile, and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D, and more.  https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL, and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK, and the USA. https://www.kdab.com/about/contact/
Python Bindings for C++ Projects - Pybind11

In this video you will learn how to write Python scripts that are called into your C++ application using pybind11, one of the many solution to do so.

All Python Bindings for C++ Projects: https://www.youtube.com/playlist?list=PL6CJYn40gN6gkvLnAUVgTRP7WAFxDbUEH

About the host:
Juan Casafranca is a passionate programmer with a PhD in computer graphics. He has been developing 3D tools at KDAB since 2017. He left KDAB recently to pursue research in physically based mechanical simulation.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing, and innovative software across embedded, mobile, and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D, and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL, and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK, and the USA. https://www.kdab.com/about/contact/

17 3

YouTube Video VVVqc0prVEpTWjVHN2V3SDJ1ZjA4dDBBLmt1VlNDX2xrLWlJ

Python Bindings for C++ Projects - Pybind11

In this episode Jesper goes on a quest to find the smoothest way to implement operator <() for custom classes.

It takes him via std::tie(), std::tuple() and ends in a discussion comparing QString's taking into account how humans interpret them.

Links:
* More details on comparisons in C++20: https://en.cppreference.com/w/cpp/language/default_comparisons
* why are the operators friends? https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c86-make--symmetric-with-respect-to-operand-types-and-noexcept

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/lessThan

0:00 operator <() how hard can it be?!
0:25 A naive implementation
1:22 Step 1 - the code for the naive implementation
2:26 hidden friends implementation
3:07 Step 2 - an improved implementation
4:01 Step 3 - using std::tie
5:46 Step 4 - PartialDate (which can be null) - my original implementation
7:00 Step 5 - PartialDate with std::tie
8:31 Step 6 - PartialDate (isNull instead of isValid)
11:09 Step 7 - opertator <=>
13:51 Step 8 - QString comparisons
15:59 localAwareCompare
16:36 specifying sorting method as third parameter to std::sort

Qt DevCon is a conference for the Qt developer community and focuses exclusively on developer topics. This year, it will will take place in Berlin, Germany from 14th to 15th June 2022: https://www.qtdevcon.com/
QtDevCon programme: https://www.qtdevcon.com/tuesday-14th-june/
QtDevCon training day info: https://www.qtdevcon.com/training-day/
Registration: https://www.qtdevcon.com/tickets/

All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more.  https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/
Implementing the Less than Operator

In this episode Jesper goes on a quest to find the smoothest way to implement operator <() for custom classes.

It takes him via std::tie(), std::tuple() and ends in a discussion comparing QString's taking into account how humans interpret them.

Links:
* More details on comparisons in C++20: https://en.cppreference.com/w/cpp/language/default_comparisons
* why are the operators friends? https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c86-make--symmetric-with-respect-to-operand-types-and-noexcept

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/lessThan

0:00 operator <() how hard can it be?!
0:25 A naive implementation
1:22 Step 1 - the code for the naive implementation
2:26 hidden friends implementation
3:07 Step 2 - an improved implementation
4:01 Step 3 - using std::tie
5:46 Step 4 - PartialDate (which can be null) - my original implementation
7:00 Step 5 - PartialDate with std::tie
8:31 Step 6 - PartialDate (isNull instead of isValid)
11:09 Step 7 - opertator <=>
13:51 Step 8 - QString comparisons
15:59 localAwareCompare
16:36 specifying sorting method as third parameter to std::sort

Qt DevCon is a conference for the Qt developer community and focuses exclusively on developer topics. This year, it will will take place in Berlin, Germany from 14th to 15th June 2022: https://www.qtdevcon.com/
QtDevCon programme: https://www.qtdevcon.com/tuesday-14th-june/
QtDevCon training day info: https://www.qtdevcon.com/training-day/
Registration: https://www.qtdevcon.com/tickets/

All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/

9 2

YouTube Video VVVqc0prVEpTWjVHN2V3SDJ1ZjA4dDBBLk0tdzBMVjhLbE9r

Implementing the Less than Operator

Did you know that your compiler likely is parsing its way through close to 100,000 lines of code for a simple "Hello World!" in Qt? Let's give it a standing applause for its hard work.

Did you also know you easily can see what exactly is given to the compiler for each source file you ask it to compile? You can, and, in this episode, we will show you how.

We will, of course, also discuss when this is useful knowledge at all.

Links:
* ninja doesn't support .cpp.i files: https://gitlab.kitware.com/cmake/cmake/-/issues/13838
* The meaning of the flags at the end of the preprocessed files: https://stackoverflow.com/questions/5370539/what-is-the-meaning-of-lines-starting-with-a-hash-sign-and-number-like-1-a-c/5370592#5370592

0:00 Introduction
0:50 Compiler and pre-processor, and especially  -E option
1:37 A really weird compile error
5:05 qmake - and manually adding -E
7:24 qmake and "-save-temps" option
8:18 CMake + make
8:52 make Foo.cpp.i
9:33 CMake + ninja
12:28 Macro expansion in Qt Creator

Qt DevCon is a conference for the Qt developer community and focuses exclusively on developer topics. This year, it will will take place in Berlin, Germany from 14th to 15th June 2022: https://www.qtdevcon.com/
QtDevCon programme: https://www.qtdevcon.com/tuesday-14th-june/
QtDevCon training day info: https://www.qtdevcon.com/training-day/
Registration: https://www.qtdevcon.com/tickets/

All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more.  https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/
What Did That Macro Expand to?

Did you know that your compiler likely is parsing its way through close to 100.000 lines of code for a simple hello world in Qt? Let's give it a standing applause for its hard work.

Did you also know you easily can see what exactly is given to the compiler for each source file you ask it to compile? You can, and in this episode we will show you how.

We will, of course, also discuss when this is useful knowledge at all.

Links:
* ninja doesn't support .cpp.i files: https://gitlab.kitware.com/cmake/cmake/-/issues/13838
* The meaning of the flags at the end of the preprocessed files: https://stackoverflow.com/questions/5370539/what-is-the-meaning-of-lines-starting-with-a-hash-sign-and-number-like-1-a-c/5370592#5370592

0:00 Introduction
0:50 Compiler and pre-processor, and especially -E option
1:37 A really weird compile error
5:05 qmake - and manually adding -E
7:24 qmake and "-save-temps" option
8:18 CMake + make
8:52 make Foo.cpp.i
9:33 CMake + ninja
12:28 Macro expansion in Qt Creator

Qt DevCon is a conference for the Qt developer community and focuses exclusively on developer topics. This year, it will will take place in Berlin, Germany from 14th to 15th June 2022: https://www.qtdevcon.com/
QtDevCon programme: https://www.qtdevcon.com/tuesday-14th-june/
QtDevCon training day info: https://www.qtdevcon.com/training-day/
Registration: https://www.qtdevcon.com/tickets/

All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/

12 0

YouTube Video VVVqc0prVEpTWjVHN2V3SDJ1ZjA4dDBBLjlWWTdocjFQQW9j

What Did That Macro Expand to?

Integers and strings can be used as data types for many different things: user id's, project id's, employee names, and account names, to name just a few.

Doing so, however, also means that you run the risk of confusing project ids with user ids or employee names with account names, with your compiler helplessly watching while you shoot yourself in the foot - after all to your compiler it is just integers and strings.

In this episode, I'll show one cure to this, namely a class you can wrap around your integers or strings to make them unique. I'll of course discuss the integration with Qt.

https://github.com/anthonywilliams/strong_typedef

If you have a Java background, a C++98 background or similar your finger memory may reach for the subclassing tool in your toolbox when faced with a problem.

In modern C++, there are many different ways to solve problems. In this episode, I'll show an example for which subclassing indeed isn't the right tool.

0:00 Introduction
0:26 The problem - compiler can't tell a city and a country apart
1:28 Trying to improve the situation with keyword "using"
2:32 Understanding the problem in more details
3:22 Introducing jss::strong_typedef
6:22 operator+ and qHash for ease of use
7:50 Adding own mix-ins
9:45 My experience in adding it to my own code base 

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/strong_typedef 

Qt DevCon is a conference for the Qt developer community and focuses exclusively on developer topics. This year, it will will take place in Berlin, Germany from 14th to 15th June 2022: https://www.qtdevcon.com/
QtDevCon programme: https://www.qtdevcon.com/tuesday-14th-june/
QtDevCon training day info: https://www.qtdevcon.com/training-day/
Registration: https://www.qtdevcon.com/tickets/

All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more.  https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/
Using strong_typedef with Qt for Improved Safety

Integers and strings can be used as data types for many different things: user id's, project id's, employee names, and account names, to name just a few.

Doing so, however, also means that you run the risk of confusing project ids with user ids or employee names with account names, with your compiler helplessly watching while you shoot yourself in the foot - after all to your compiler it is just integers and strings.

In this episode, I'll show one cure to this, namely a class you can wrap around your integers or strings to make them unique. I'll of course discuss the integration with Qt.

https://github.com/anthonywilliams/strong_typedef

If you have a Java background, a C++98 background or similar your finger memory may reach for the subclassing tool in your toolbox when faced with a problem.

In modern C++, there are many different ways to solve problems. In this episode, I'll show an example for which subclassing indeed isn't the right tool.

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/strong_typedef

Qt DevCon is a conference for the Qt developer community and focuses exclusively on developer topics. This year, it will will take place in Berlin, Germany from 14th to 15th June 2022: https://www.qtdevcon.com/
QtDevCon programme: https://www.qtdevcon.com/tuesday-14th-june/
QtDevCon training day info: https://www.qtdevcon.com/training-day/
Registration: https://www.qtdevcon.com/tickets/

All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/

19 1

YouTube Video VVVqc0prVEpTWjVHN2V3SDJ1ZjA4dDBBLnpyel9BWHBna3JF

Using strong_typedef with Qt for Improved Safety

The Qt for Python project exposes the Qt framework into Python. As you know, the Qt framework is written mostly in C++. So, how is this possible?

In this video, you will learn about the binding generation tool used by the Qt for Python project, called Shiboken.

This tool allows users to expose any C++ project -- even if it's not using Qt -- into Python.

On 13 April 2022, version 6.3.0 of Qt for Python was released: https://www.qt.io/blog/qt-for-python-details-on-the-new-6.3-release

Cristián will also be giving a talk about Qt for Python in Berlin at Qt DevCon on the 14th of June, 2022: https://www.qtdevcon.com/hybrid-qt-development-boosting-your-projects-with-python/
There is still time to register to attend: https://www.qtdevcon.com/

To find out more about Qt for Python:

Qt for Python landing page https://qt.io/qt-for-python
Shiboken documentation: https://doc.qt.io/qtforpython/shiboken6/
Public Wiki: https://pyside.org

All Python Bindings for C++ Projects: https://www.youtube.com/playlist?list=PL6CJYn40gN6gkvLnAUVgTRP7WAFxDbUEH

About the host: 
Cristián is an R&D Manager at The Qt Company, working with the Qt Core and Qt for Python teams. He also is one of the developers of the Qt for Python project. In his spare time, Cristián works closely with Open Source projects and initiatives, mainly focusing on the Python community.
Twitter: https://twitter.com/cmaureir
LinkedIn: https://www.linkedin.com/in/cmaureir/

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing, and innovative software across embedded, mobile, and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D, and more.  https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL, and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK, and the USA. https://www.kdab.com/about/contact/
Python Bindings for C++ Projects - Shiboken: the Python Binding Generator

The Qt for Python project exposes the Qt Framework into Python. As you know, the Qt framework is written mostly in C++, so how is this possible?

In this video, you will learn about the binding generation tool used by the Qt for Python project, called Shiboken.
This tool allows users to expose any C++ project - even if it's not using Qt - into Python.

On 13 April 2022, version 6.3.0 of Qt for Python was released: https://www.qt.io/blog/qt-for-python-details-on-the-new-6.3-release

Cristián will also be giving a talk about Qt for Python in Berlin at Qt DevCon on the 14th June 2022: https://www.qtdevcon.com/hybrid-qt-development-boosting-your-projects-with-python/
There is still time to register to attend: https://www.qtdevcon.com/

To find out more about Qt for Python:

Qt for Python landing page https://qt.io/qt-for-python
Shiboken documentation https://doc.qt.io/qtforpython/shiboken6/
Public Wiki https://pyside.org

All Python for Qt videos: tba

About the host:
Cristián is an R&D Manager at The Qt Company, working with the Qt Core and Qt for Python teams. He also is one of the developers of the Qt for Python project. On his spare time, Cristián works closely with Open Source projects and initiatives, mainly focus on the Python community.
Twitter: https://twitter.com/cmaureir
LinkedIn: https://www.linkedin.com/in/cmaureir/

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing, and innovative software across embedded, mobile, and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D, and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL, and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK, and the USA. https://www.kdab.com/about/contact/

13 0

YouTube Video VVVqc0prVEpTWjVHN2V3SDJ1ZjA4dDBBLjZ1NklpZmtDSzhn

Python Bindings for C++ Projects - Shiboken: the Python Binding Generator

If you have a Java background, a C++98 background, or similar, your finger memory may reach for the subclassing tool in your toolbox whenever you face a problem.

In modern C++, there are many different ways to solve problems and, in this episode, I'll show an example where subclassing indeed isn't the right tool.

0:00 Intro
0:20 Intro to the problem
0:45 My starting point
2:03 Version 2 - encapsulating the currency sign in a class
4:32 version 3 - adding a virtual method for setup
5:26 version 4 - replacing the classes with functions

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/chart-axes 

Qt DevCon is a conference for the Qt developer community and focuses exclusively on developer topics. This year, it will will take place in Berlin, Germany from 14th to 15th June 2022: https://www.qtdevcon.com/
QtDevCon programme: https://www.qtdevcon.com/tuesday-14th-june/
QtDevCon training day info: https://www.qtdevcon.com/training-day/
Registration: https://www.qtdevcon.com/tickets/

All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more.  https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/
Subclassing isn't always the solution!

If you have a Java background, a C++98 background, or similar, your finger memory may reach for the subclassing tool in your toolbox whenever you face a problem.

In modern C++, there are many different ways to solve problems and, in this episode, I'll show an example where subclassing indeed isn't the right tool.

0:00 Intro
0:20 Intro to the problem
0:45 My starting point
2:03 Version 2 - encapsulating the currency sign in a class
4:32 version 3 - adding a virtual method for setup
5:26 version 4 - replacing the classes with functions

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/chart-axes

Qt DevCon is a conference for the Qt developer community and focuses exclusively on developer topics. This year, it will will take place in Berlin, Germany from 14th to 15th June 2022: https://www.qtdevcon.com/
QtDevCon programme: https://www.qtdevcon.com/tuesday-14th-june/
QtDevCon training day info: https://www.qtdevcon.com/training-day/
Registration: https://www.qtdevcon.com/tickets/

All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/

40 9

YouTube Video VVVqc0prVEpTWjVHN2V3SDJ1ZjA4dDBBLnZaQXZGcXY1Wldz

Subclassing isn't always the solution!

Designing API's is hard work with lots of traps. Even worse is the situation when you later maintain the code and just need a function to behave slightly different in different situations.

I'll start this episode by bashing Qt 3, where you could write update(false). What does that mean? Do not update?

I'll take this to the extreme and suggest that you ban boolean arguments to functions altogether. Instead, I'll show how enums and flags help make your code much more readable.

https://wiki.qt.io/API_Design_Principles

0:00 Comparing QSlider API between Qt3 and Qt4
1:52 Qt3: update(false) ← what does that mean?
3:09 Going from booleans to enums
4:45 party(false, false, true) converted to bitwised-or flags
6:38 bitwise flags in the DepecheModel
8:18 The exceptions where it is OK to use booleans

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/no-more-booleans

Qt DevCon is a conference for the Qt developer community and focuses exclusively on developer topics. This year, it will will take place in Berlin, Germany from 14th to 15th June 2022: https://www.qtdevcon.com/
QtDevCon programme: https://www.qtdevcon.com/tuesday-14th-june/
QtDevCon training day info: https://www.qtdevcon.com/training-day/
Registration: https://www.qtdevcon.com/tickets/

All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more.  https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/
No More Booleans!

Designing API's is hard work with lots of traps. Even worse is the situation when you later maintain the code and just need a function to behave slightly different in different situations.

I'll start this episode by bashing Qt 3, where you could write update(false). What does that mean? Do not update?

I'll take this to the extreme and suggest that you ban boolean arguments to functions altogether. Instead, I'll show how enums and flags help make your code much more readable.

https://wiki.qt.io/API_Design_Principles

0:00 Comparing QSlider API between Qt3 and Qt4
1:52 Qt3: update(false) ← what does that mean?
3:09 Going from booleans to enums
4:45 party(false, false, true) converted to bitwised-or flags
6:38 bitwise flags in the DepecheModel
8:18 The exceptions where it is OK to use booleans

The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/no-more-booleans

Qt DevCon is a conference for the Qt developer community and focuses exclusively on developer topics. This year, it will will take place in Berlin, Germany from 14th to 15th June 2022: https://www.qtdevcon.com/
QtDevCon programme: https://www.qtdevcon.com/tuesday-14th-june/
QtDevCon training day info: https://www.qtdevcon.com/training-day/
Registration: https://www.qtdevcon.com/tickets/

All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-resources/sign-up-for-our-newsletter/

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at training@kdab.com or visit our website: https://www.kdab.com/software-services/scheduled-training/

We are about 90 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/

50 7

YouTube Video VVVqc0prVEpTWjVHN2V3SDJ1ZjA4dDBBLkVHaEhsUERleXZn

No More Booleans!

FacebookTwitterLinkedInEmail