~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qdropevent-qt3.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/kernel/qevent.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: Qt 3 Support Members for QDropEvent</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Qt 3 Support Members for QDropEvent</h1>
 
21
<p><b>The following class members are part of the Qt 3 support layer.</b> They are provided to help you port old code to Qt 4. We advise against using them in new code.</p>
 
22
<p><ul><li><a href="qdropevent.html">QDropEvent class reference</a></li></ul></p>
 
23
<h3>Public Types</h3>
 
24
<ul>
 
25
<li><div class="fn"/>enum <b><a href="qdropevent-qt3.html#Action-enum">Action</a></b> { Copy, Link, Move, Private, UserAction }</li>
 
26
</ul>
 
27
<h3>Public Functions</h3>
 
28
<ul>
 
29
<li><div class="fn"/>void <b><a href="qdropevent-qt3.html#accept-2">accept</a></b> ( bool <i>accept</i> )</li>
 
30
<li><div class="fn"/>void <b><a href="qdropevent-qt3.html#acceptAction">acceptAction</a></b> ( bool <i>accept</i> = true )</li>
 
31
<li><div class="fn"/>Action <b><a href="qdropevent-qt3.html#action">action</a></b> () const</li>
 
32
<li><div class="fn"/>QByteArray <b><a href="qdropevent-qt3.html#data">data</a></b> ( const char * <i>f</i> ) const</li>
 
33
<li><div class="fn"/>virtual QByteArray <b><a href="qdropevent-qt3.html#encodedData">encodedData</a></b> ( const char * <i>format</i> ) const</li>
 
34
<li><div class="fn"/>virtual const char * <b><a href="qdropevent-qt3.html#format">format</a></b> ( int <i>n</i> = 0 ) const</li>
 
35
<li><div class="fn"/>virtual bool <b><a href="qdropevent-qt3.html#provides">provides</a></b> ( const char * <i>mimeType</i> ) const</li>
 
36
<li><div class="fn"/>void <b><a href="qdropevent-qt3.html#setPoint">setPoint</a></b> ( const QPoint &amp; <i>point</i> )</li>
 
37
</ul>
 
38
<hr />
 
39
<h2>Member Type Documentation</h2>
 
40
<h3 class="fn"><a name="Action-enum"></a>enum QDropEvent::Action</h3>
 
41
<p>When a drag and drop action is completed, the target is expected to perform an action on the data provided by the source. This will be one of the following:</p>
 
42
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
43
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
44
<tr><td valign="top"><tt>QDropEvent::Copy</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The default action. The source simply uses the data provided in the operation.</td></tr>
 
45
<tr><td valign="top"><tt>QDropEvent::Link</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The source should somehow create a link to the location specified by the data.</td></tr>
 
46
<tr><td valign="top"><tt>QDropEvent::Move</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The source should somehow move the object from the location specified by the data to a new location.</td></tr>
 
47
<tr><td valign="top"><tt>QDropEvent::Private</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">The target has special knowledge of the MIME type, which the source should respond to in a similar way to a Copy.</td></tr>
 
48
<tr><td valign="top"><tt>QDropEvent::UserAction</tt></td><td align="center" valign="top"><tt>Private</tt></td><td valign="top">The source and target can co-operate using special actions. This feature is not currently supported.</td></tr>
 
49
</table>
 
50
<p>The Link and Move actions only makes sense if the data is a reference, for example, text/uri-list file lists (see <a href="porting4.html#quridrag">QUriDrag</a>).</p>
 
51
<hr />
 
52
<h2>Member Function Documentation</h2>
 
53
<h3 class="fn"><a name="accept-2"></a>void QDropEvent::accept ( bool <i>accept</i> )</h3>
 
54
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
55
<p>Call setAccepted(<i>accept</i>) instead.</p>
 
56
<h3 class="fn"><a name="acceptAction"></a>void QDropEvent::acceptAction ( bool <i>accept</i> = true )</h3>
 
57
<p>Call this to indicate that the action described by <a href="qdropevent-qt3.html#action">action</a>() is accepted (i.e. if <i>accept</i> is true, which is the default), not merely the default copy action. If you call acceptAction(true), there is no need to also call accept(true).</p>
 
58
<h3 class="fn"><a name="action"></a><a href="qdropevent-qt3.html#Action-enum">Action</a> QDropEvent::action () const</h3>
 
59
<p>Use <a href="qdropevent.html#dropAction">dropAction</a>() instead.</p>
 
60
<p>The table below shows the correspondance between the return type of action() and the return type of <a href="qdropevent.html#dropAction">dropAction</a>().</p>
 
61
<table align="center" cellpadding="2" cellspacing="1" border="0">
 
62
<tr valign="top" bgcolor="#a2c511"><th>Old enum value</th><th>New enum value</th></tr>
 
63
<tr valign="top" bgcolor="#f0f0f0"><td><a href="qdropevent-qt3.html#Action-enum">QDropEvent::Copy</a></td><td><a href="qt.html#DropAction-enum">Qt::CopyAction</a></td></tr>
 
64
<tr valign="top" bgcolor="#e0e0e0"><td><a href="qdropevent-qt3.html#Action-enum">QDropEvent::Move</a></td><td><a href="qt.html#DropAction-enum">Qt::MoveAction</a></td></tr>
 
65
<tr valign="top" bgcolor="#f0f0f0"><td><a href="qdropevent-qt3.html#Action-enum">QDropEvent::Link</a></td><td><a href="qt.html#DropAction-enum">Qt::LinkAction</a></td></tr>
 
66
<tr valign="top" bgcolor="#e0e0e0"><td>other</td><td><a href="qt.html#DropAction-enum">Qt::CopyAction</a></td></tr>
 
67
</table>
 
68
<h3 class="fn"><a name="data"></a><a href="qbytearray.html">QByteArray</a> QDropEvent::data ( const char * <i>f</i> ) const</h3>
 
69
<p>The encoded data is in <i>f</i>. Use <a href="qdropevent-qt3.html#encodedData">QDropEvent::encodedData</a>().</p>
 
70
<h3 class="fn"><a name="encodedData"></a><a href="qbytearray.html">QByteArray</a> QDropEvent::encodedData ( const char * <i>format</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
71
<p>Returns a byte array containing the drag's data, in <i>format</i>.</p>
 
72
<p><a href="qdropevent-qt3.html#data">data</a>() normally needs to get the data from the drag source, which is potentially very slow, so it's advisable to call this function only if you're sure that you will need the data in that particular <i>format</i>.</p>
 
73
<p>The resulting data will have a size of 0 if the format was not available.</p>
 
74
<p>Reimplemented from <a href="qmimesource.html#encodedData">QMimeSource</a>.</p>
 
75
<p>See also <a href="qdropevent-qt3.html#format">format</a>() and <a href="qbytearray.html#size">QByteArray::size</a>().</p>
 
76
<h3 class="fn"><a name="format"></a>const char * QDropEvent::format ( int <i>n</i> = 0 ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
77
<p>Returns a string describing one of the available data types for this drag. Common examples are &quot;text/plain&quot; and &quot;image/gif&quot;. If <i>n</i> is less than zero or greater than the number of available data types, format() returns 0.</p>
 
78
<p>This function is provided mainly for debugging. Most drop targets will use <a href="qdropevent-qt3.html#provides">provides</a>().</p>
 
79
<p>Reimplemented from <a href="qmimesource.html#format">QMimeSource</a>.</p>
 
80
<p>See also <a href="qdropevent-qt3.html#data">data</a>() and <a href="qdropevent-qt3.html#provides">provides</a>().</p>
 
81
<h3 class="fn"><a name="provides"></a>bool QDropEvent::provides ( const char * <i>mimeType</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
82
<p>Returns true if this event provides format <i>mimeType</i>; otherwise returns false.</p>
 
83
<p>Reimplemented from <a href="qmimesource.html#provides">QMimeSource</a>.</p>
 
84
<p>See also <a href="qdropevent-qt3.html#data">data</a>().</p>
 
85
<h3 class="fn"><a name="setPoint"></a>void QDropEvent::setPoint ( const <a href="qpoint.html">QPoint</a> &amp; <i>point</i> )</h3>
 
86
<p>Sets the drop to happen at the given <i>point</i>. You do not normally need to use this as it will be set internally before your widget receives the drop event.</p>
 
87
<p /><address><hr /><div align="center">
 
88
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
89
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
90
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
91
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
92
</tr></table></div></address></body>
 
93
</html>