Introduction to Qt Widgets (Part 36) - QVariant
KDAB KDAB
12.8K subscribers
247 views
8

 Published On Aug 13, 2024

The class QVariant is a truly impotant class in Qt, that offers the possibility to provide anything to a function, or return anything from one.
If you know modern C++, then it is a bit like std::any, and if you are more familiar with plain C, then you will find some resemblances to its union.

Links:
Avoiding QVariant::fromValue in QWAM:    • Avoiding QVariant::fromValue around y...  

Documentation on QVariant QAbstractItemModel: https://doc.qt.io/qt-6/qabstractitemm...

Adapting Column Content to Size in QWAM:    • Adapting Column Content to Size  

KDAB Rust training info: https://training.kdab.com/portfolio/r...

The example code showcased in this video is available here: https://github.com/KDABLabs/kdabtv/tr...

0:00 Introduction
0:25 Union datatype or union
4:47 QVariant
5:55 Rust training KDAB
6:10 QVariant
9:27 Q_DECLARE_METATYPE
11:39 qRegisterMetatype
15:51 QVariant usages
21:13 Conclusion

All 'Introduction to Qt Widgets - Module 1' videos:    • Introduction to Qt Widgets - Module 1...  

All 'Introduction to Qt Widgets - Module 2' videos:
   • Introduction to Qt Widgets - Module 2...  

All 'Introduction to Qt Widgets - Module 3' videos:
   • Introduction to Qt Widgets - Module 3...  

All 'Introduction to Qt Widgets - Module 4' videos:
   • Introduction to Qt Widgets - Module 4...  

All 'Introduction to Qt Widgets - Module 5' videos:
   • Introduction to Qt Widgets - Module 5...  

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-reso...

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 enrolment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at [email protected] or visit our website: https://www.kdab.com/software-service...

We are over 100 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/

show more

Share/Embed