The QIconDragItem is the internal data structure of a QIconDrag More...
#include <qiconview.h>
This class is used internally in the QIconDrag to store the data (in fact, a list of QIconDragItems is used by QIconDrag). Such an item stores the data about the geometry of an item of the iconview which is dragged around, so that drag shapes can be drawn correctly.
If you extend the DnD functionality of a QIconView, you should use a class derived from QIconDrag as dragobject. This class again should contain a list of objects which are derived from this class.
So, normally for each iconview item which is dragged, a QIconDragItem class (or a class derived from QIconDragItem) is created and stored in the QIconDrag object.
So, in a class derived from that you should reimplement QIconDragItem::makeKey(), so that a key containing the data of this object + the geometry of the dragged item is created and returned.
You also may add methods to add/get the data you store here.
An example, how to implement this, is in the QtFileIconView example. (qt/examples/qfileiconview/qfileiconview.h and qt/examples/qfileiconview/qfileiconview.cpp).
Constructs and empty QIconDragItem.
Constructs and QIconDragItem. ir is the icon rectangle and tr the bounding rectangle of the icon text.
[virtual]
Destructor.
[virtual]
Returns the key of this item.
[virtual protected]
Generates a unique key which describes this item.
[virtual]
Returns TRUE if icon is smaller than this item, else FALSE.
[virtual]
Returns TRUE if icon is equal to this item.
[virtual]
Returns the bounding rectangle of the icon which data is stored in this item.
[virtual]
Sets r as the rectangle of the icon.
[virtual]
Sets r as the rectangle of the text.
[virtual]
Returns the bounding rectangle of the text of the icon which data is stored in this item.
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-2000 Troll Tech, all rights reserved.
Copyright İ 2000 Troll Tech | Trademarks | Qt version 2.1.0 (pre-release)
|