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

« back to all changes in this revision

Viewing changes to doc/html/qdropevent.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: QDropEvent Class Reference</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">QDropEvent Class Reference</h1>
 
21
<p>The QDropEvent class provides an event which is sent when a drag and drop action is completed. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QDropEvent&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<p>Inherits <a href="qevent.html">QEvent</a>.</p>
 
24
<p>Inherited by <a href="qdragmoveevent.html">QDragMoveEvent</a>.</p>
 
25
<ul>
 
26
<li><a href="qdropevent-members.html">List of all members, including inherited members</a></li>
 
27
<li><a href="qdropevent-qt3.html">Qt 3 support members</a></li>
 
28
</ul>
 
29
<a name="public-functions"></a>
 
30
<h3>Public Functions</h3>
 
31
<ul>
 
32
<li><div class="fn"/><b><a href="qdropevent.html#QDropEvent">QDropEvent</a></b> ( const QPoint &amp; <i>pos</i>, Qt::DropActions <i>actions</i>, const QMimeData * <i>data</i>, Qt::MouseButtons <i>buttons</i>, Qt::KeyboardModifiers <i>modifiers</i>, Type <i>type</i> = Drop )</li>
 
33
<li><div class="fn"/>void <b><a href="qdropevent.html#acceptProposedAction">acceptProposedAction</a></b> ()</li>
 
34
<li><div class="fn"/>Qt::DropAction <b><a href="qdropevent.html#dropAction">dropAction</a></b> () const</li>
 
35
<li><div class="fn"/>Qt::KeyboardModifiers <b><a href="qdropevent.html#keyboardModifiers">keyboardModifiers</a></b> () const</li>
 
36
<li><div class="fn"/>const QMimeData * <b><a href="qdropevent.html#mimeData">mimeData</a></b> () const</li>
 
37
<li><div class="fn"/>Qt::MouseButtons <b><a href="qdropevent.html#mouseButtons">mouseButtons</a></b> () const</li>
 
38
<li><div class="fn"/>const QPoint &amp; <b><a href="qdropevent.html#pos">pos</a></b> () const</li>
 
39
<li><div class="fn"/>Qt::DropActions <b><a href="qdropevent.html#possibleActions">possibleActions</a></b> () const</li>
 
40
<li><div class="fn"/>Qt::DropAction <b><a href="qdropevent.html#proposedAction">proposedAction</a></b> () const</li>
 
41
<li><div class="fn"/>void <b><a href="qdropevent.html#setDropAction">setDropAction</a></b> ( Qt::DropAction <i>action</i> )</li>
 
42
<li><div class="fn"/>QWidget * <b><a href="qdropevent.html#source">source</a></b> () const</li>
 
43
</ul>
 
44
<ul>
 
45
<li><div class="fn"/>6 public functions inherited from <a href="qevent.html#public-functions">QEvent</a></li>
 
46
</ul>
 
47
<h3>Additional Inherited Members</h3>
 
48
<ul>
 
49
<li><div class="fn"/>1 property inherited from <a href="qevent.html#properties">QEvent</a></li>
 
50
</ul>
 
51
<a name="details"></a>
 
52
<hr />
 
53
<h2>Detailed Description</h2>
 
54
<p>The QDropEvent class provides an event which is sent when a drag and drop action is completed.</p>
 
55
<p>When a widget <a href="qwidget.html#acceptDrops-prop">accepts drop events</a>, it will receive this event if it has accepted the most recent <a href="qdragenterevent.html">QDragEnterEvent</a> or <a href="qdragmoveevent.html">QDragMoveEvent</a> sent to it.</p>
 
56
<p>The drop event contains a proposed action, available from <a href="qdropevent.html#proposedAction">proposedAction</a>(), for the widget to either accept or ignore. If the action can be handled by the widget, you should call the <a href="qdropevent.html#acceptProposedAction">acceptProposedAction</a>() function. Since the proposed action can be a combination of <a href="qt.html#DropAction-enum">Qt::DropAction</a> values, it may be useful to either select one of these values as a default action or ask the user to select their preferred action. If the required drop action is different to the proposed action, you can call <a href="qdropevent.html#setDropAction">setDropAction</a>() instead of <a href="qdropevent.html#acceptProposedAction">acceptProposedAction</a>() to complete the drop operation.</p>
 
57
<p>The <a href="qdropevent.html#mimeData">mimeData</a>() function provides the data dropped on the widget in a <a href="qmimedata.html">QMimeData</a> object. This contains information about the MIME type of the data in addition to the data itself.</p>
 
58
<p>See also <a href="qmimedata.html">QMimeData</a>, <a href="qdrag.html">QDrag</a>, and <a href="dnd.html">Drag and Drop</a>.</p>
 
59
<hr />
 
60
<h2>Member Function Documentation</h2>
 
61
<h3 class="fn"><a name="QDropEvent"></a>QDropEvent::QDropEvent ( const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i>, <a href="qt.html#DropAction-enum">Qt::DropActions</a> <i>actions</i>, const <a href="qmimedata.html">QMimeData</a> * <i>data</i>, <a href="qt.html#MouseButton-enum">Qt::MouseButtons</a> <i>buttons</i>, <a href="qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a> <i>modifiers</i>, <a href="qevent.html#Type-enum">Type</a> <i>type</i> = Drop )</h3>
 
62
<p>Constructs a drop event of a certain <i>type</i> corresponding to a drop at the point specified by <i>pos</i> in the destination widget's coordinate system.</p>
 
63
<p>The <i>actions</i> indicate which types of drag and drop operation can be performed, and the drag data is stored as MIME-encoded data in <i>data</i>.</p>
 
64
<p>The states of the mouse buttons and keyboard modifiers at the time of the drop are specified by <i>buttons</i> and <i>modifiers</i>.</p>
 
65
<h3 class="fn"><a name="acceptProposedAction"></a>void QDropEvent::acceptProposedAction ()</h3>
 
66
<p>Sets the drop action to be the proposed action.</p>
 
67
<p>See also <a href="qdropevent.html#setDropAction">setDropAction</a>(), <a href="qdropevent.html#proposedAction">proposedAction</a>(), and <a href="qdropevent.html#accept">accept</a>().</p>
 
68
<h3 class="fn"><a name="dropAction"></a><a href="qt.html#DropAction-enum">Qt::DropAction</a> QDropEvent::dropAction () const</h3>
 
69
<p>Returns the action that the target is expected to perform on the data. If your application understands the action and can process the supplied data, call <a href="qdropevent-qt3.html#acceptAction">acceptAction</a>(); if your application can process the supplied data but can only perform the Copy action, call <a href="qdropevent.html#accept">accept</a>().</p>
 
70
<p>See also <a href="qdropevent.html#setDropAction">setDropAction</a>().</p>
 
71
<h3 class="fn"><a name="keyboardModifiers"></a><a href="qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a> QDropEvent::keyboardModifiers () const</h3>
 
72
<p>Returns the modifier keys that are pressed.</p>
 
73
<h3 class="fn"><a name="mimeData"></a>const <a href="qmimedata.html">QMimeData</a> * QDropEvent::mimeData () const</h3>
 
74
<p>Returns the data that was dropped on the widget and its associated MIME type information.</p>
 
75
<h3 class="fn"><a name="mouseButtons"></a><a href="qt.html#MouseButton-enum">Qt::MouseButtons</a> QDropEvent::mouseButtons () const</h3>
 
76
<p>Returns the mouse buttons that are pressed..</p>
 
77
<h3 class="fn"><a name="pos"></a>const <a href="qpoint.html">QPoint</a> &amp; QDropEvent::pos () const</h3>
 
78
<p>Returns the position where the drop was made.</p>
 
79
<h3 class="fn"><a name="possibleActions"></a><a href="qt.html#DropAction-enum">Qt::DropActions</a> QDropEvent::possibleActions () const</h3>
 
80
<p>Returns an OR-combination of possible drop actions.</p>
 
81
<p>See also <a href="qdropevent.html#dropAction">dropAction</a>().</p>
 
82
<h3 class="fn"><a name="proposedAction"></a><a href="qt.html#DropAction-enum">Qt::DropAction</a> QDropEvent::proposedAction () const</h3>
 
83
<p>Returns the proposed drop action.</p>
 
84
<p>See also <a href="qdropevent.html#dropAction">dropAction</a>().</p>
 
85
<h3 class="fn"><a name="setDropAction"></a>void QDropEvent::setDropAction ( <a href="qt.html#DropAction-enum">Qt::DropAction</a> <i>action</i> )</h3>
 
86
<p>Sets the <i>action</i> to be performed on the data by the target. Use this to override the <a href="qdropevent.html#proposedAction">proposed action</a> with one of the <a href="qdropevent.html#possibleActions">possible actions</a>.</p>
 
87
<p>If you set a drop action that is not one of the possible actions, the drag and drop operation will default to a copy operation.</p>
 
88
<p>See also <a href="qdropevent.html#dropAction">dropAction</a>().</p>
 
89
<h3 class="fn"><a name="source"></a><a href="qwidget.html">QWidget</a> * QDropEvent::source () const</h3>
 
90
<p>If the source of the drag operation is a widget in this application, this function returns that source; otherwise it returns 0. The source of the operation is the first parameter to the <a href="qdrag.html">QDrag</a> object used instantiate the drag.</p>
 
91
<p>This is useful if your widget needs special behavior when dragging to itself.</p>
 
92
<p>See also <a href="qdrag.html#QDrag">QDrag::QDrag</a>().</p>
 
93
<p /><address><hr /><div align="center">
 
94
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
95
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
96
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
97
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
98
</tr></table></div></address></body>
 
99
</html>