O'Reilly logo

C++ GUI Programming with Qt 3 by Mark Summerfield, Jasmin Blanchette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Drag and Drop

Drag and drop is a modern and intuitive way of transferring information within an application or between different applications. It is often provided in addition to clipboard support for moving and copying data.

In this chapter, we will begin by showing how to add drag and drop support to a Qt application. Then we will reuse the drag and drop code to implement clipboard support. This code reuse is possible because both mechanisms rely on QMimeSource, an abstract base class that provides data in different formats.

Enabling Drag and Drop

Drag and drop involves two distinct actions: dragging and dropping. Widgets can serve as drag sites, as drop sites, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required