1QIconDrag(3qt) QIconDrag(3qt)
2
3
4
6 QIconDrag - Supports drag and drop operations within a QIconView
7
9 #include <qiconview.h>
10
11 Inherits QDragObject.
12
13 Public Members
14 QIconDrag ( QWidget * dragSource, const char * name = 0 )
15 virtual ~QIconDrag ()
16 void append ( const QIconDragItem & i, const QRect & pr, const QRect &
17 tr )
18 virtual QByteArray encodedData ( const char * mime ) const
19
20 Static Public Members
21 bool canDecode ( QMimeSource * e )
22
24 The QIconDrag class supports drag and drop operations within a
25 QIconView.
26
27 A QIconDrag object is used to maintain information about the positions
28 of dragged items and the data associated with the dragged items.
29 QIconViews are able to use this information to paint the dragged items
30 in the correct positions. Internally QIconDrag stores the data
31 associated with drag items in QIconDragItem objects.
32
33 If you want to use the extended drag-and-drop functionality of
34 QIconView, create a QIconDrag object in a reimplementation of
35 QIconView::dragObject(). Then create a QIconDragItem for each item
36 which should be dragged, set the data it represents with
37 QIconDragItem::setData(), and add each QIconDragItem to the drag object
38 using append().
39
40 The data in QIconDragItems is stored in a QByteArray and is mime-typed
41 (see QMimeSource and the Drag and Drop overview). If you want to use
42 your own mime-types derive a class from QIconDrag and reimplement
43 format(), encodedData() and canDecode().
44
45 The fileiconview example program demonstrates the use of the QIconDrag
46 class including subclassing and reimplementing dragObject(), format(),
47 encodedData() and canDecode(). See the files
48 qt/examples/fileiconview/qfileiconview.h and
49 qt/examples/fileiconview/qfileiconview.cpp.
50
51 See also QMimeSource::format() and Drag And Drop Classes.
52
55 Constructs a drag object called name, which is a child of dragSource.
56
57 Note that the drag object will be deleted when dragSource is deleted.
58
60 Destructor.
61
63 QRect & tr )
64 Append the QIconDragItem, i, to the QIconDrag object's list of items.
65 You must also supply the geometry of the pixmap, pr, and the textual
66 caption, tr.
67
68 See also QIconDragItem.
69
70 Example: fileiconview/qfileiconview.cpp.
71
73 Returns TRUE if e can be decoded by the QIconDrag, otherwise return
74 FALSE.
75
76 Example: fileiconview/qfileiconview.cpp.
77
79 Returns the encoded data of the drag object if mime is application/x-
80 qiconlist.
81
82 Example: fileiconview/qfileiconview.cpp.
83
84 Reimplemented from QMimeSource.
85
86
88 http://doc.trolltech.com/qicondrag.html
89 http://www.trolltech.com/faq/tech.html
90
92 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
93 license file included in the distribution for a complete license
94 statement.
95
97 Generated automatically from the source code.
98
100 If you find a bug in Qt, please report it as described in
101 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
102 help you. Thank you.
103
104 The definitive Qt documentation is provided in HTML format; it is
105 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
106 web browser. This man page is provided as a convenience for those users
107 who prefer man pages, although this format is not officially supported
108 by Trolltech.
109
110 If you find errors in this manual page, please report them to qt-
111 bugs@trolltech.com. Please include the name of the manual page
112 (qicondrag.3qt) and the Qt version (3.3.8).
113
114
115
116Trolltech AS 2 February 2007 QIconDrag(3qt)