1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/iconview/qiconview.cpp:585 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QIconDrag Class</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QIconDrag Class Reference<br><small>[<a href="iconview.html">iconview module</a>]</small></h1>
|
---|
33 |
|
---|
34 | <p>The QIconDrag class supports drag and drop operations
|
---|
35 | within a QIconView.
|
---|
36 | <a href="#details">More...</a>
|
---|
37 | <p><tt>#include <<a href="qiconview-h.html">qiconview.h</a>></tt>
|
---|
38 | <p>Inherits <a href="qdragobject.html">QDragObject</a>.
|
---|
39 | <p><a href="qicondrag-members.html">List of all member functions.</a>
|
---|
40 | <h2>Public Members</h2>
|
---|
41 | <ul>
|
---|
42 | <li class=fn><a href="#QIconDrag"><b>QIconDrag</b></a> ( QWidget * dragSource, const char * name = 0 )</li>
|
---|
43 | <li class=fn>virtual <a href="#~QIconDrag"><b>~QIconDrag</b></a> ()</li>
|
---|
44 | <li class=fn>void <a href="#append"><b>append</b></a> ( const QIconDragItem & i, const QRect & pr, const QRect & tr )</li>
|
---|
45 | <li class=fn>virtual QByteArray <a href="#encodedData"><b>encodedData</b></a> ( const char * mime ) const</li>
|
---|
46 | </ul>
|
---|
47 | <h2>Static Public Members</h2>
|
---|
48 | <ul>
|
---|
49 | <li class=fn>bool <a href="#canDecode"><b>canDecode</b></a> ( QMimeSource * e )</li>
|
---|
50 | </ul>
|
---|
51 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
52 |
|
---|
53 |
|
---|
54 | <p> The QIconDrag class supports drag and drop operations
|
---|
55 | within a <a href="qiconview.html">QIconView</a>.
|
---|
56 | <p>
|
---|
57 |
|
---|
58 | <p> A QIconDrag object is used to maintain information about the
|
---|
59 | positions of dragged items and the data associated with the
|
---|
60 | dragged items. QIconViews are able to use this information to
|
---|
61 | paint the dragged items in the correct positions. Internally
|
---|
62 | QIconDrag stores the data associated with drag items in
|
---|
63 | <a href="qicondragitem.html">QIconDragItem</a> objects.
|
---|
64 | <p> If you want to use the extended drag-and-drop functionality of
|
---|
65 | QIconView, create a QIconDrag object in a reimplementation of
|
---|
66 | <a href="qiconview.html#dragObject">QIconView::dragObject</a>(). Then create a QIconDragItem for each item
|
---|
67 | which should be dragged, set the data it represents with
|
---|
68 | <a href="qicondragitem.html#setData">QIconDragItem::setData</a>(), and add each QIconDragItem to the drag
|
---|
69 | object using <a href="#append">append</a>().
|
---|
70 | <p> The data in QIconDragItems is stored in a <a href="qbytearray.html">QByteArray</a> and is
|
---|
71 | mime-typed (see <a href="qmimesource.html">QMimeSource</a> and the
|
---|
72 | <a href="http://doc.trolltech.com/dnd.html">Drag and Drop</a>
|
---|
73 | overview). If you want to use your own mime-types derive a class
|
---|
74 | from QIconDrag and reimplement <a href="qmimesource.html#format">format</a>(), <a href="#encodedData">encodedData</a>() and
|
---|
75 | <a href="#canDecode">canDecode</a>().
|
---|
76 | <p> The fileiconview example program demonstrates the use of the
|
---|
77 | QIconDrag class including subclassing and reimplementing
|
---|
78 | dragObject(), format(), encodedData() and canDecode(). See the files
|
---|
79 | <tt>qt/examples/fileiconview/qfileiconview.h</tt> and
|
---|
80 | <tt>qt/examples/fileiconview/qfileiconview.cpp</tt>.
|
---|
81 | <p> <p>See also <a href="qmimesource.html#format">QMimeSource::format</a>() and <a href="draganddrop.html">Drag And Drop Classes</a>.
|
---|
82 |
|
---|
83 | <hr><h2>Member Function Documentation</h2>
|
---|
84 | <h3 class=fn><a name="QIconDrag"></a>QIconDrag::QIconDrag ( <a href="qwidget.html">QWidget</a> * dragSource, const char * name = 0 )
|
---|
85 | </h3>
|
---|
86 | Constructs a drag object called <em>name</em>, which is a child of <em>dragSource</em>.
|
---|
87 | <p> Note that the drag object will be deleted when <em>dragSource</em> is deleted.
|
---|
88 |
|
---|
89 | <h3 class=fn><a name="~QIconDrag"></a>QIconDrag::~QIconDrag ()<tt> [virtual]</tt>
|
---|
90 | </h3>
|
---|
91 | Destructor.
|
---|
92 |
|
---|
93 | <h3 class=fn>void <a name="append"></a>QIconDrag::append ( const <a href="qicondragitem.html">QIconDragItem</a> & i, const <a href="qrect.html">QRect</a> & pr, const <a href="qrect.html">QRect</a> & tr )
|
---|
94 | </h3>
|
---|
95 | Append the <a href="qicondragitem.html">QIconDragItem</a>, <em>i</em>, to the QIconDrag object's list of
|
---|
96 | items. You must also supply the geometry of the pixmap, <em>pr</em>, and
|
---|
97 | the textual caption, <em>tr</em>.
|
---|
98 | <p> <p>See also <a href="qicondragitem.html">QIconDragItem</a>.
|
---|
99 |
|
---|
100 | <p>Example: <a href="fileiconview-example.html#x829">fileiconview/qfileiconview.cpp</a>.
|
---|
101 | <h3 class=fn>bool <a name="canDecode"></a>QIconDrag::canDecode ( <a href="qmimesource.html">QMimeSource</a> * e )<tt> [static]</tt>
|
---|
102 | </h3>
|
---|
103 | Returns TRUE if <em>e</em> can be decoded by the QIconDrag, otherwise
|
---|
104 | return FALSE.
|
---|
105 |
|
---|
106 | <p>Example: <a href="fileiconview-example.html#x830">fileiconview/qfileiconview.cpp</a>.
|
---|
107 | <h3 class=fn><a href="qbytearray.html">QByteArray</a> <a name="encodedData"></a>QIconDrag::encodedData ( const char * mime ) const<tt> [virtual]</tt>
|
---|
108 | </h3>
|
---|
109 | Returns the encoded data of the drag object if <em>mime</em> is
|
---|
110 | application/x-qiconlist.
|
---|
111 |
|
---|
112 | <p>Example: <a href="fileiconview-example.html#x831">fileiconview/qfileiconview.cpp</a>.
|
---|
113 | <p>Reimplemented from <a href="qmimesource.html#encodedData">QMimeSource</a>.
|
---|
114 | <!-- eof -->
|
---|
115 | <hr><p>
|
---|
116 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
117 | Copyright © 1995-2007
|
---|
118 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
119 | <table width=100% cellspacing=0 border=0><tr>
|
---|
120 | <td>Copyright © 2007
|
---|
121 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
122 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
123 | </table></div></address></body>
|
---|
124 | </html>
|
---|