PDA

View Full Version : List of draggable icons



embeddedmz
4th May 2020, 12:14
Hi everybody,

With which components can I build something similar to the Qt Creators's resource selector (a draggable list of icons presented like files icons in file explorer) ?

13429

Thanks.

d_stranz
4th May 2020, 15:53
You could probably use the FlowLayout class (from the Qt Flow Layout example (https://doc.qt.io/qt-5/qtwidgets-layouts-flowlayout-example.html)) to do the layout. The Draggable Icons example (https://doc.qt.io/qt-5/qtwidgets-draganddrop-draggableicons-example.html) and the Fridge Magnets example (https://doc.qt.io/qt-5/qtwidgets-draganddrop-fridgemagnets-example.html) are good places to start for implementing the drag and drop features. In your case, you probably won't be dragging something out of one widget and into another, but you'll create a duplicate and drag that instead. The Drop Site example (https://doc.qt.io/qt-5/qtwidgets-draganddrop-dropsite-example.html) will probably help there.