Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
12 March 2024
Adding a new widget to your toolbox might be as simple as subclassing from QWidget and add two child widgets plus a layout, or it might
be a multi-month job where you need to polish every single pixel. In any case there are a few things to think about, and that is exactly what we will discuss in this episode.
00:00 Introduction
00:25 Custom Widget Guidelines
01:50 Create a Custom Widget
02:18 Base Class and Event Handlers
04:25 Drawing a Widget
06:01 Internal States and Subclassing
06:40 Widget Constructor
09:14 Size Preferences
10:02 Further Reading
All 'Introduction to Qt Widgets' videos: https://www.youtube.com/playlist?list=PL6CJYn40gN6iFcTyItvnE5nOmJR8qk_7o
All 'Introduction to Qt Widgets - Module 1' videos: https://www.youtube.com/playlist?list=PL6CJYn40gN6hgf7zCKF2Rv9Y0WoN8RVGf
All 'Introduction to Qt Widgets - Module 2' videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6j_c41CFMprvg9EiWz0WdSy
All 'Introduction to Qt Widgets - Module 3' videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6hWZO_viEf1rfjgk4E6SCKd
Links:
* KDAB Rust Training Courses: https://training.kdab.com/portfolio/rust/
* Implementing a File Choose https://youtu.be/D5nsjsPbEJc?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
* Episode on Event Handling: https://youtu.be/yIf-eieQ6UA?list=PL6CJYn40gN6iFcTyItvnE5nOmJR8qk_7o
* Using Custom Widgets from Qt Designer: https://youtu.be/PxAnxOr_QJo?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
* Understanding the C++ keyword explicit: https://youtu.be/GUdQ9u34HQI?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
The example code showcased in this video is available here: https://github.com/KDABLabs/kdabtv/tree/master/Programming-With-Qt-Widgets