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
9 October 2025
One of the most intuitive gestures in applications is drag and drop - "I have something here, I want it there"
In this episode, we will learn how to add drag and drop facilities to your application, both so it can work with other applications, but also so you can drag, possibly even complex data around inside your application.
Links:
* KDAB Service: Qt5 to Qt6 Migration: https://www.kdab.com/services/qt-services/qt-5-to-qt-6-migration-services/
* Codebrowser: https://codebrowser.dev/
* Code for QMimeDataPrivate on Codebrowser: https://codebrowser.dev/qt6/qtbase/src/corelib/kernel/qmimedata.cpp.html#106
Chapters
00:00 Welcome
01:01 Fives step to DnD
02:31 Step 1 - detect a drag is about to start
04:44 Step 2 - starting the drag
08:27 QMimeData
09:55 Advertise: Qt5 to Qt6 migration
10:15 Step 3+4 - the drop side
15:34 Encoding your own data type - the drag side
18:27 Decoding your own data - the drop site
21:48 Only encode the data when the drop happens
24:00 Drag and drop inside the application
24:53 The clipboard
26:40 The application shown thoughout the episode
The example code showcased in this video is available here:
https://github.com/KDABLabs/kdabtv/tree/master/Programming-With-Qt-Widgets/DragAndDrop
Introduction to Qt Widgets Modules
Please note that non-English dubs for all KDAB videos are auto-generated. These translations have not been moderated by us and may contain inaccuracies. We appreciate your understanding and apologize for any confusion this may cause.