source: trunk/doc/html/qicondrag.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 6.5 KB
Line 
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"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { 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&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;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&nbsp;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
35within a QIconView.
36<a href="#details">More...</a>
37<p><tt>#include &lt;<a href="qiconview-h.html">qiconview.h</a>&gt;</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&nbsp;*&nbsp;dragSource, const&nbsp;char&nbsp;*&nbsp;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&nbsp;QIconDragItem&nbsp;&amp;&nbsp;i, const&nbsp;QRect&nbsp;&amp;&nbsp;pr, const&nbsp;QRect&nbsp;&amp;&nbsp;tr )</li>
45<li class=fn>virtual QByteArray <a href="#encodedData"><b>encodedData</b></a> ( const&nbsp;char&nbsp;*&nbsp;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&nbsp;*&nbsp;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
55within a <a href="qiconview.html">QIconView</a>.
56<p>
57
58<p> A QIconDrag object is used to maintain information about the
59positions of dragged items and the data associated with the
60dragged items. QIconViews are able to use this information to
61paint the dragged items in the correct positions. Internally
62QIconDrag 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
65QIconView, create a QIconDrag object in a reimplementation of
66<a href="qiconview.html#dragObject">QIconView::dragObject</a>(). Then create a QIconDragItem for each item
67which 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
69object using <a href="#append">append</a>().
70<p> The data in QIconDragItems is stored in a <a href="qbytearray.html">QByteArray</a> and is
71mime-typed (see <a href="qmimesource.html">QMimeSource</a> and the
72<a href="http://doc.trolltech.com/dnd.html">Drag and Drop</a>
73overview). If you want to use your own mime-types derive a class
74from 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
77QIconDrag class including subclassing and reimplementing
78dragObject(), 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>&nbsp;*&nbsp;dragSource, const&nbsp;char&nbsp;*&nbsp;name = 0 )
85</h3>
86Constructs 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>
91Destructor.
92
93<h3 class=fn>void <a name="append"></a>QIconDrag::append ( const&nbsp;<a href="qicondragitem.html">QIconDragItem</a>&nbsp;&amp;&nbsp;i, const&nbsp;<a href="qrect.html">QRect</a>&nbsp;&amp;&nbsp;pr, const&nbsp;<a href="qrect.html">QRect</a>&nbsp;&amp;&nbsp;tr )
94</h3>
95Append the <a href="qicondragitem.html">QIconDragItem</a>, <em>i</em>, to the QIconDrag object's list of
96items. You must also supply the geometry of the pixmap, <em>pr</em>, and
97the 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>&nbsp;*&nbsp;e )<tt> [static]</tt>
102</h3>
103Returns TRUE if <em>e</em> can be decoded by the QIconDrag, otherwise
104return 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&nbsp;char&nbsp;*&nbsp;mime ) const<tt> [virtual]</tt>
108</h3>
109Returns the encoded data of the drag object if <em>mime</em> is
110application/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>
116This file is part of the <a href="index.html">Qt toolkit</a>.
117Copyright &copy; 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 &copy; 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>
Note: See TracBrowser for help on using the repository browser.