<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_09) on Tue Aug 07 17:02:48 CEST 2007 --> <TITLE> QMimeData </TITLE> <META NAME="keywords" CONTENT="com.trolltech.qt.gui.QMimeData class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="QMimeData"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/trolltech/qt/gui/QMessageBox.StandardButtons.html" title="class in com.trolltech.qt.gui"><B>PREV CLASS</B></A> <A HREF="../../../../com/trolltech/qt/gui/QMotifStyle.html" title="class in com.trolltech.qt.gui"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?com/trolltech/qt/gui/QMimeData.html" target="_top"><B>FRAMES</B></A> <A HREF="QMimeData.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_classes_inherited_from_class_com.trolltech.qt.QSignalEmitter">NESTED</A> | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.trolltech.qt.gui</FONT> <BR> Class QMimeData</H2> <PRE> java.lang.Object <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/QSignalEmitter.html" title="class in com.trolltech.qt">com.trolltech.qt.QSignalEmitter</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/QtJambiObject.html" title="class in com.trolltech.qt">com.trolltech.qt.QtJambiObject</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">com.trolltech.qt.core.QObject</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.trolltech.qt.gui.QMimeData</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../com/trolltech/qt/QtJambiInterface.html" title="interface in com.trolltech.qt">QtJambiInterface</A></DD> </DL> <HR> <DL> <DT><PRE>public class <B>QMimeData</B><DT>extends <A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">QObject</A></DL> </PRE> <P> <p>The <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> class provides a container for data that records information about its MIME type.</p> <p><a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> is used to describe information that can be stored in the <a href="QClipboard.html">clipboard</tt></a>, and transferred via the <a href="%2E%2E/dnd.html">drag and drop</tt></a> mechanism. <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> objects associate the data that they hold with the corresponding MIME types to ensure that information can be safely transferred between applications, and copied around within the same application.</p> <p><a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> objects are usually created using <tt>new</tt> and supplied to <a href="QDrag.html"><tt>QDrag</tt></a> or <a href="QClipboard.html"><tt>QClipboard</tt></a> objects. This is to enable Qt to manage the memory that they use.</p> <p>A single <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> object can store the same data using several different formats at the same time. The <a href="QMimeData.html#formats()"><tt>formats</tt></a> function returns a list of the available formats in order of preference. The <a href="QMimeData.html#data(java.lang.String)"><tt>data</tt></a> function returns the raw data associated with a MIME type, and <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a> allows you to set the data for a MIME type.</p> <p>For the most common MIME types, <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> provides convenience functions to access the data:</p> <p><table align="center" cellpadding="2" cellspacing="1" border="0"> <thead><tr valign="top" class="qt-style"><th>Tester</th><th>Getter</th><th>Setter</th><th>MIME Types</th></tr></thead> <tr valign="top" class="odd"><td><a href="QMimeData.html#hasText()"><tt>hasText</tt></a></td><td><a href="QMimeData.html#text()"><tt>text</tt></a></td><td><a href="QMimeData.html#setText(java.lang.String)"><tt>setText</tt></a></td><td><tt>text/plain</tt></td></tr> <tr valign="top" class="even"><td><a href="QMimeData.html#hasHtml()"><tt>hasHtml</tt></a></td><td><a href="QMimeData.html#html()"><tt>html</tt></a></td><td><a href="QMimeData.html#setHtml(java.lang.String)"><tt>setHtml</tt></a></td><td><tt>text/html</tt></td></tr> <tr valign="top" class="odd"><td><a href="QMimeData.html#hasUrls()"><tt>hasUrls</tt></a></td><td><a href="QMimeData.html#urls()"><tt>urls</tt></a></td><td><a href="QMimeData.html#setUrls(java.util.List<com.trolltech.qt.core.QUrl>)"><tt>setUrls</tt></a></td><td><tt>text/uri-list</tt></td></tr> <tr valign="top" class="even"><td><a href="QMimeData.html#hasImage()"><tt>hasImage</tt></a></td><td><a href="QMimeData.html#imageData()"><tt>imageData</tt></a></td><td><a href="QMimeData.html#setImageData(java.lang.Object)"><tt>setImageData</tt></a></td><td><tt>image/</tt> *</td></tr> <tr valign="top" class="odd"><td><a href="QMimeData.html#hasColor()"><tt>hasColor</tt></a></td><td><a href="QMimeData.html#colorData()"><tt>colorData</tt></a></td><td><a href="QMimeData.html#setColorData(java.lang.Object)"><tt>setColorData</tt></a></td><td><tt>application/x-color</tt></td></tr> </table></p> <p>For example, if your write a widget that accepts URL drags, you would end up writing code like this:</p> <pre> void MyWidget::dragEnterEvent(QDragEnterEvent *event) { if (event->mimeData()->hasUrls()) event->acceptProposedEvent(); } void MyWidget::dropEvent(QDropEvent *event) { if (event->mimeData()->hasUrls()) { QUrl url = event->mimeData()->urls(); ... } }</pre> <p>There are three appraches for storing custom data in a <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> object:</p> <ol type="1"> <li>Custom data can be stored directly in a <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> object as a <a href="%2E%2E/core/QByteArray.html"><tt>QByteArray</tt></a> using <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a>. For example:<pre> QByteArray csvData = ...; QMimeData *mimeData = new QMimeData; mimeData->setData("text/csv", csvData);</pre> </li> <li>We can subclass <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> and reimplement <a href="QMimeData.html#hasFormat(java.lang.String)"><tt>hasFormat</tt></a>, <a href="QMimeData.html#formats()"><tt>formats</tt></a>, and <a href="QMimeData.html#retrieveData(java.lang.String, int)"><tt>retrieveData</tt></a>.</li> <li>If the drag and drop operation occurs withing a single application, we can subclass <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> and add extra data in it, and use a qobject_cast() in the receiver's drop event handler. For example:<pre> void MyWidget::dropEvent(QDropEvent *event) { const MyMimeData *myData = qobject_cast<const MyMimeData *>(event->mimeData()); if (myData) { <span class="comment">// access myData's data directly (not through QMimeData's API)</span> } }</pre> </li> </ol> <a name="platform-specific-mime-types"></a> <h3>Platform-Specific MIME Types</h3> <p>On Windows, <a href="QMimeData.html#formats()"><tt>formats</tt></a> will also return custom formats available in the MIME data, using the <tt>x-qt-windows-mime</tt> subtype to indicate that they represent data in non-standard formats. The formats will take the following form:</p> <pre> application/x-qt-windows-mime;value="<custom type>"</pre> <p>The following are examples of custom MIME types:</p> <pre> application/x-qt-windows-mime;value="FileGroupDescriptor" application/x-qt-windows-mime;value="FileContents"</pre> <p>The <tt>value</tt> declaration of each format describes the way in which the data is encoded.</p> <p>On Windows, the MIME format does not always map directly to the clipboard formats. Qt provides QWindowsMime to map clipboard formats to open-standard MIME formats. Similarly, the QMacPasteboardMime maps MIME to Mac flavors.</p> <P> <P> <DL> <DT><B>See Also:</B><DD><a href="QClipboard.html"><tt>QClipboard</tt></a>, <a href="QDragEnterEvent.html"><tt>QDragEnterEvent</tt></a>, <a href="QDragMoveEvent.html"><tt>QDragMoveEvent</tt></a>, <a href="QDropEvent.html"><tt>QDropEvent</tt></a>, <a href="QDrag.html"><tt>QDrag</tt></a>, <tt>QWindowsMime</tt>, <tt>QMacPasteboardMime</tt>, <a href="%2E%2E/dnd.html">Drag and Drop</tt></a></DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <A NAME="nested_class_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Nested Class Summary</B></FONT></TH> </TR> </TABLE> <A NAME="nested_classes_inherited_from_class_com.trolltech.qt.QSignalEmitter"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Nested classes/interfaces inherited from class com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QSignalEmitter.html" title="class in com.trolltech.qt">QSignalEmitter</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal0.html" title="class in com.trolltech.qt">QSignalEmitter.Signal0</A>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal1.html" title="class in com.trolltech.qt">QSignalEmitter.Signal1</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal1.html" title="type parameter in QSignalEmitter.Signal1">A</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal2.html" title="class in com.trolltech.qt">QSignalEmitter.Signal2</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal2.html" title="type parameter in QSignalEmitter.Signal2">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal2.html" title="type parameter in QSignalEmitter.Signal2">B</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="class in com.trolltech.qt">QSignalEmitter.Signal3</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="type parameter in QSignalEmitter.Signal3">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="type parameter in QSignalEmitter.Signal3">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="type parameter in QSignalEmitter.Signal3">C</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="class in com.trolltech.qt">QSignalEmitter.Signal4</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">D</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="class in com.trolltech.qt">QSignalEmitter.Signal5</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">E</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="class in com.trolltech.qt">QSignalEmitter.Signal6</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">F</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="class in com.trolltech.qt">QSignalEmitter.Signal7</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">F</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">G</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="class in com.trolltech.qt">QSignalEmitter.Signal8</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">F</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">G</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">H</A>>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="class in com.trolltech.qt">QSignalEmitter.Signal9</A><<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">F</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">G</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">H</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">I</A>></CODE></TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#QMimeData()">QMimeData</A></B>()</CODE> <BR> Constructs a new MIME data object with no data in it.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#clear()">clear</A></B>()</CODE> <BR> Removes all the MIME type and data entries in the object.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#colorData()">colorData</A></B>()</CODE> <BR> Returns a color if the data stored in the object represents a color (MIME type <tt>application/x-color</tt>); otherwise returns a null variant.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../com/trolltech/qt/core/QByteArray.html" title="class in com.trolltech.qt.core">QByteArray</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#data(java.lang.String)">data</A></B>(java.lang.String mimetype)</CODE> <BR> Returns the data stored in the object in the format described by the MIME type specified by <tt>mimetype</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.List<java.lang.String></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#formats()">formats</A></B>()</CODE> <BR> Returns a list of formats supported by the object.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../../com/trolltech/qt/gui/QMimeData.html" title="class in com.trolltech.qt.gui">QMimeData</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#fromNativePointer(com.trolltech.qt.QNativePointer)">fromNativePointer</A></B>(<A HREF="../../../../com/trolltech/qt/QNativePointer.html" title="class in com.trolltech.qt">QNativePointer</A> nativePointer)</CODE> <BR> This function returns the QMimeData instance pointed to by nativePointer</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#hasColor()">hasColor</A></B>()</CODE> <BR> Returns true if the object can return a color (MIME type <tt>application/x-color</tt>); otherwise returns false.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#hasFormat(java.lang.String)">hasFormat</A></B>(java.lang.String mimetype)</CODE> <BR> Returns true if the object can return data for the MIME type specified by <tt>mimetype</tt>; otherwise returns false.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#hasHtml()">hasHtml</A></B>()</CODE> <BR> Returns true if the object can return HTML (MIME type <tt>text/html</tt>); otherwise returns false.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#hasImage()">hasImage</A></B>()</CODE> <BR> Returns true if the object can return an image; otherwise returns false.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#hasText()">hasText</A></B>()</CODE> <BR> Returns true if the object can return plain text (MIME type <tt>text/plain</tt>); otherwise returns false.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#hasUrls()">hasUrls</A></B>()</CODE> <BR> Returns true if the object can return a list of urls; otherwise returns false.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#html()">html</A></B>()</CODE> <BR> Returns a string if the data stored in the object is HTML (MIME type <tt>text/html</tt>); otherwise returns an empty string.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#imageData()">imageData</A></B>()</CODE> <BR> Returns a <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a> storing a <a href="QImage.html"><tt>QImage</tt></a> if the object can return an image; otherwise returns a null variant.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#retrieveData(java.lang.String, int)">retrieveData</A></B>(java.lang.String mimetype, int preferredType)</CODE> <BR> Returns a variant with the given <tt>preferredType</tt> containing data for the MIME type specified by <tt>mimetype</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#setColorData(java.lang.Object)">setColorData</A></B>(java.lang.Object color)</CODE> <BR> Sets the color data in the object to the given <tt>color</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)">setData</A></B>(java.lang.String mimetype, <A HREF="../../../../com/trolltech/qt/core/QByteArray.html" title="class in com.trolltech.qt.core">QByteArray</A> data)</CODE> <BR> Sets the data associated with the MIME type given by <tt>mimetype</tt> to the specified <tt>data</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#setHtml(java.lang.String)">setHtml</A></B>(java.lang.String html)</CODE> <BR> Sets <tt>html</tt> as the HTML (MIME type <tt>text/html</tt>) used to represent the data.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#setImageData(java.lang.Object)">setImageData</A></B>(java.lang.Object image)</CODE> <BR> Sets the data in the object to the given <tt>image</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#setText(java.lang.String)">setText</A></B>(java.lang.String text)</CODE> <BR> Sets <tt>text</tt> as the plain text (MIME type <tt>text/plain</tt>) used to represent the data.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#setUrls(java.util.List)">setUrls</A></B>(java.util.List<<A HREF="../../../../com/trolltech/qt/core/QUrl.html" title="class in com.trolltech.qt.core">QUrl</A>> urls)</CODE> <BR> Sets the URLs stored in the MIME data object to those specified by <tt>urls</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#text()">text</A></B>()</CODE> <BR> Returns a plain text (MIME type <tt>text/plain</tt>) representation of the data.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.List<<A HREF="../../../../com/trolltech/qt/core/QUrl.html" title="class in com.trolltech.qt.core">QUrl</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QMimeData.html#urls()">urls</A></B>()</CODE> <BR> Returns a list of URLs contained within the MIME data object.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.trolltech.qt.core.QObject"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.core.<A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">QObject</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/core/QObject.html#blockSignals(boolean)">blockSignals</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#childEvent(com.trolltech.qt.core.QChildEvent)">childEvent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#children()">children</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#connectSlotsByName()">connectSlotsByName</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#customEvent(com.trolltech.qt.core.QEvent)">customEvent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#disposeLater()">disposeLater</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#dumpObjectInfo()">dumpObjectInfo</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#dumpObjectTree()">dumpObjectTree</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#dynamicPropertyNames()">dynamicPropertyNames</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#event(com.trolltech.qt.core.QEvent)">event</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#eventFilter(com.trolltech.qt.core.QObject, com.trolltech.qt.core.QEvent)">eventFilter</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChild()">findChild</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChild(java.lang.Class)">findChild</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChild(java.lang.Class, java.lang.String)">findChild</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren()">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren(java.lang.Class)">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren(java.lang.Class, com.trolltech.qt.core.QRegExp)">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren(java.lang.Class, java.lang.String)">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#installEventFilter(com.trolltech.qt.core.QObject)">installEventFilter</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#isWidgetType()">isWidgetType</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#killTimer(int)">killTimer</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#moveToThread(java.lang.Thread)">moveToThread</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#objectName()">objectName</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#parent()">parent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#property(java.lang.String)">property</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#removeEventFilter(com.trolltech.qt.core.QObject)">removeEventFilter</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#setObjectName(java.lang.String)">setObjectName</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#setParent(com.trolltech.qt.core.QObject)">setParent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#setProperty(java.lang.String, java.lang.Object)">setProperty</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#signalsBlocked()">signalsBlocked</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#startTimer(int)">startTimer</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#thread()">thread</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#timerEvent(com.trolltech.qt.core.QTimerEvent)">timerEvent</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.trolltech.qt.QtJambiObject"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QtJambiObject.html" title="class in com.trolltech.qt">QtJambiObject</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/QtJambiObject.html#dispose()">dispose</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#disposed()">disposed</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#finalize()">finalize</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#reassignNativeResources(com.trolltech.qt.QtJambiObject, java.lang.Class)">reassignNativeResources</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#tr(java.lang.String)">tr</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#tr(java.lang.String, java.lang.String)">tr</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#tr(java.lang.String, java.lang.String, int)">tr</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.trolltech.qt.QSignalEmitter"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QSignalEmitter.html" title="class in com.trolltech.qt">QSignalEmitter</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/QSignalEmitter.html#disconnect()">disconnect</A>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.html#disconnect(java.lang.Object)">disconnect</A>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.html#signalSender()">signalSender</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_com.trolltech.qt.QtJambiInterface"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from interface com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QtJambiInterface.html" title="interface in com.trolltech.qt">QtJambiInterface</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#disableGarbageCollection()">disableGarbageCollection</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#nativeId()">nativeId</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#nativePointer()">nativePointer</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#reenableGarbageCollection()">reenableGarbageCollection</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#setJavaOwnership()">setJavaOwnership</A></CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="QMimeData()"><!-- --></A><H3> QMimeData</H3> <PRE> public <B>QMimeData</B>()</PRE> <DL> <DD><p>Constructs a new MIME data object with no data in it.</p> <P> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="clear()"><!-- --></A><H3> clear</H3> <PRE> public final void <B>clear</B>()</PRE> <DL> <DD><p>Removes all the MIME type and data entries in the object.</p> <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="colorData()"><!-- --></A><H3> colorData</H3> <PRE> public final java.lang.Object <B>colorData</B>()</PRE> <DL> <DD><p>Returns a color if the data stored in the object represents a color (MIME type <tt>application/x-color</tt>); otherwise returns a null variant.</p> <p>A <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a> is used because <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> belongs to the <tt>QtCore</tt> library, whereas <a href="QColor.html"><tt>QColor</tt></a> belongs to <tt>QtGui</tt>. To convert the <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a> to a <a href="QColor.html"><tt>QColor</tt></a>, simply use qvariant_cast(). For example:</p> <pre> if (event->mimeData()->hasColor()) { QColor color = qvariant_cast<QColor>(event->mimeData()->colorData()); ... }</pre> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#hasColor()"><tt>hasColor</tt></a>, <a href="QMimeData.html#setColorData(java.lang.Object)"><tt>setColorData</tt></a>, <a href="QMimeData.html#data(java.lang.String)"><tt>data</tt></a></DL> </DD> </DL> <HR> <A NAME="data(java.lang.String)"><!-- --></A><H3> data</H3> <PRE> public final <A HREF="../../../../com/trolltech/qt/core/QByteArray.html" title="class in com.trolltech.qt.core">QByteArray</A> <B>data</B>(java.lang.String mimetype)</PRE> <DL> <DD><p>Returns the data stored in the object in the format described by the MIME type specified by <tt>mimetype</tt>.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a></DL> </DD> </DL> <HR> <A NAME="hasColor()"><!-- --></A><H3> hasColor</H3> <PRE> public final boolean <B>hasColor</B>()</PRE> <DL> <DD><p>Returns true if the object can return a color (MIME type <tt>application/x-color</tt>); otherwise returns false.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#setColorData(java.lang.Object)"><tt>setColorData</tt></a>, <a href="QMimeData.html#colorData()"><tt>colorData</tt></a>, <a href="QMimeData.html#hasFormat(java.lang.String)"><tt>hasFormat</tt></a></DL> </DD> </DL> <HR> <A NAME="hasHtml()"><!-- --></A><H3> hasHtml</H3> <PRE> public final boolean <B>hasHtml</B>()</PRE> <DL> <DD><p>Returns true if the object can return HTML (MIME type <tt>text/html</tt>); otherwise returns false.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#setHtml(java.lang.String)"><tt>setHtml</tt></a>, <a href="QMimeData.html#html()"><tt>html</tt></a>, <a href="QMimeData.html#hasFormat(java.lang.String)"><tt>hasFormat</tt></a></DL> </DD> </DL> <HR> <A NAME="hasImage()"><!-- --></A><H3> hasImage</H3> <PRE> public final boolean <B>hasImage</B>()</PRE> <DL> <DD><p>Returns true if the object can return an image; otherwise returns false.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#setImageData(java.lang.Object)"><tt>setImageData</tt></a>, <a href="QMimeData.html#imageData()"><tt>imageData</tt></a>, <a href="QMimeData.html#hasFormat(java.lang.String)"><tt>hasFormat</tt></a></DL> </DD> </DL> <HR> <A NAME="hasText()"><!-- --></A><H3> hasText</H3> <PRE> public final boolean <B>hasText</B>()</PRE> <DL> <DD><p>Returns true if the object can return plain text (MIME type <tt>text/plain</tt>); otherwise returns false.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#setText(java.lang.String)"><tt>setText</tt></a>, <a href="QMimeData.html#text()"><tt>text</tt></a>, <a href="QMimeData.html#hasHtml()"><tt>hasHtml</tt></a>, <a href="QMimeData.html#hasFormat(java.lang.String)"><tt>hasFormat</tt></a></DL> </DD> </DL> <HR> <A NAME="hasUrls()"><!-- --></A><H3> hasUrls</H3> <PRE> public final boolean <B>hasUrls</B>()</PRE> <DL> <DD><p>Returns true if the object can return a list of urls; otherwise returns false.</p> <p>URLs correspond to the MIME type <tt>text/uri-list</tt>.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#setUrls(java.util.List<com.trolltech.qt.core.QUrl>)"><tt>setUrls</tt></a>, <a href="QMimeData.html#urls()"><tt>urls</tt></a>, <a href="QMimeData.html#hasFormat(java.lang.String)"><tt>hasFormat</tt></a></DL> </DD> </DL> <HR> <A NAME="html()"><!-- --></A><H3> html</H3> <PRE> public final java.lang.String <B>html</B>()</PRE> <DL> <DD><p>Returns a string if the data stored in the object is HTML (MIME type <tt>text/html</tt>); otherwise returns an empty string.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#setHtml(java.lang.String)"><tt>setHtml</tt></a>, <a href="QMimeData.html#hasHtml()"><tt>hasHtml</tt></a>, <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a></DL> </DD> </DL> <HR> <A NAME="imageData()"><!-- --></A><H3> imageData</H3> <PRE> public final java.lang.Object <B>imageData</B>()</PRE> <DL> <DD><p>Returns a <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a> storing a <a href="QImage.html"><tt>QImage</tt></a> if the object can return an image; otherwise returns a null variant.</p> <p>A <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a> is used because <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> belongs to the <tt>QtCore</tt> library, whereas <a href="QImage.html"><tt>QImage</tt></a> belongs to <tt>QtGui</tt>. To convert the <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a> to a <a href="QImage.html"><tt>QImage</tt></a>, simply use qvariant_cast(). For example:</p> <pre> if (event->mimeData()->hasImage()) { QImage image = qvariant_cast<QImage>(event->mimeData()->imageData()); ... }</pre> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#setImageData(java.lang.Object)"><tt>setImageData</tt></a>, <a href="QMimeData.html#hasImage()"><tt>hasImage</tt></a></DL> </DD> </DL> <HR> <A NAME="setColorData(java.lang.Object)"><!-- --></A><H3> setColorData</H3> <PRE> public final void <B>setColorData</B>(java.lang.Object color)</PRE> <DL> <DD><p>Sets the color data in the object to the given <tt>color</tt>.</p> <p>Colors correspond to the MIME type <tt>application/x-color</tt>.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#colorData()"><tt>colorData</tt></a>, <a href="QMimeData.html#hasColor()"><tt>hasColor</tt></a>, <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a></DL> </DD> </DL> <HR> <A NAME="setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><!-- --></A><H3> setData</H3> <PRE> public final void <B>setData</B>(java.lang.String mimetype, <A HREF="../../../../com/trolltech/qt/core/QByteArray.html" title="class in com.trolltech.qt.core">QByteArray</A> data)</PRE> <DL> <DD><p>Sets the data associated with the MIME type given by <tt>mimetype</tt> to the specified <tt>data</tt>.</p> <p>For the most common types of data, you can call the higher-level functions <a href="QMimeData.html#setText(java.lang.String)"><tt>setText</tt></a>, <a href="QMimeData.html#setHtml(java.lang.String)"><tt>setHtml</tt></a>, <a href="QMimeData.html#setUrls(java.util.List<com.trolltech.qt.core.QUrl>)"><tt>setUrls</tt></a>, <a href="QMimeData.html#setImageData(java.lang.Object)"><tt>setImageData</tt></a>, and <a href="QMimeData.html#setColorData(java.lang.Object)"><tt>setColorData</tt></a> instead.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#data(java.lang.String)"><tt>data</tt></a>, <a href="QMimeData.html#hasFormat(java.lang.String)"><tt>hasFormat</tt></a></DL> </DD> </DL> <HR> <A NAME="setHtml(java.lang.String)"><!-- --></A><H3> setHtml</H3> <PRE> public final void <B>setHtml</B>(java.lang.String html)</PRE> <DL> <DD><p>Sets <tt>html</tt> as the HTML (MIME type <tt>text/html</tt>) used to represent the data.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#html()"><tt>html</tt></a>, <a href="QMimeData.html#hasHtml()"><tt>hasHtml</tt></a>, <a href="QMimeData.html#setText(java.lang.String)"><tt>setText</tt></a>, <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a></DL> </DD> </DL> <HR> <A NAME="setImageData(java.lang.Object)"><!-- --></A><H3> setImageData</H3> <PRE> public final void <B>setImageData</B>(java.lang.Object image)</PRE> <DL> <DD><p>Sets the data in the object to the given <tt>image</tt>.</p> <p>A <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a> is used because <a href="QMimeData.html#QMimeData()"><tt>QMimeData</tt></a> belongs to the <tt>QtCore</tt> library, whereas <a href="QImage.html"><tt>QImage</tt></a> belongs to <tt>QtGui</tt>. The conversion from <a href="QImage.html"><tt>QImage</tt></a> to <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a> is implicit. For example:</p> <pre> mimeData->setImageData(QImage("beautifulfjord.png"));</pre> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#imageData()"><tt>imageData</tt></a>, <a href="QMimeData.html#hasImage()"><tt>hasImage</tt></a>, <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a></DL> </DD> </DL> <HR> <A NAME="setText(java.lang.String)"><!-- --></A><H3> setText</H3> <PRE> public final void <B>setText</B>(java.lang.String text)</PRE> <DL> <DD><p>Sets <tt>text</tt> as the plain text (MIME type <tt>text/plain</tt>) used to represent the data.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#text()"><tt>text</tt></a>, <a href="QMimeData.html#hasText()"><tt>hasText</tt></a>, <a href="QMimeData.html#setHtml(java.lang.String)"><tt>setHtml</tt></a>, <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a></DL> </DD> </DL> <HR> <A NAME="setUrls(java.util.List)"><!-- --></A><H3> setUrls</H3> <PRE> public final void <B>setUrls</B>(java.util.List<<A HREF="../../../../com/trolltech/qt/core/QUrl.html" title="class in com.trolltech.qt.core">QUrl</A>> urls)</PRE> <DL> <DD><p>Sets the URLs stored in the MIME data object to those specified by <tt>urls</tt>.</p> <p>URLs correspond to the MIME type <tt>text/uri-list</tt>.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#urls()"><tt>urls</tt></a>, <a href="QMimeData.html#hasUrls()"><tt>hasUrls</tt></a>, <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a></DL> </DD> </DL> <HR> <A NAME="text()"><!-- --></A><H3> text</H3> <PRE> public final java.lang.String <B>text</B>()</PRE> <DL> <DD><p>Returns a plain text (MIME type <tt>text/plain</tt>) representation of the data.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#setText(java.lang.String)"><tt>setText</tt></a>, <a href="QMimeData.html#hasText()"><tt>hasText</tt></a>, <a href="QMimeData.html#html()"><tt>html</tt></a>, <a href="QMimeData.html#data(java.lang.String)"><tt>data</tt></a></DL> </DD> </DL> <HR> <A NAME="urls()"><!-- --></A><H3> urls</H3> <PRE> public final java.util.List<<A HREF="../../../../com/trolltech/qt/core/QUrl.html" title="class in com.trolltech.qt.core">QUrl</A>> <B>urls</B>()</PRE> <DL> <DD><p>Returns a list of URLs contained within the MIME data object.</p> <p>URLs correspond to the MIME type <tt>text/uri-list</tt>.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#setUrls(java.util.List<com.trolltech.qt.core.QUrl>)"><tt>setUrls</tt></a>, <a href="QMimeData.html#hasUrls()"><tt>hasUrls</tt></a>, <a href="QMimeData.html#data(java.lang.String)"><tt>data</tt></a></DL> </DD> </DL> <HR> <A NAME="formats()"><!-- --></A><H3> formats</H3> <PRE> public java.util.List<java.lang.String> <B>formats</B>()</PRE> <DL> <DD><p>Returns a list of formats supported by the object. This is a list of MIME types for which the object can return suitable data. The formats in the list are in a priority order.</p> <p>For the most common types of data, you can call the higher-level functions <a href="QMimeData.html#hasText()"><tt>hasText</tt></a>, <a href="QMimeData.html#hasHtml()"><tt>hasHtml</tt></a>, <a href="QMimeData.html#hasUrls()"><tt>hasUrls</tt></a>, <a href="QMimeData.html#hasImage()"><tt>hasImage</tt></a>, and <a href="QMimeData.html#hasColor()"><tt>hasColor</tt></a> instead.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#hasFormat(java.lang.String)"><tt>hasFormat</tt></a>, <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a>, <a href="QMimeData.html#data(java.lang.String)"><tt>data</tt></a></DL> </DD> </DL> <HR> <A NAME="hasFormat(java.lang.String)"><!-- --></A><H3> hasFormat</H3> <PRE> public boolean <B>hasFormat</B>(java.lang.String mimetype)</PRE> <DL> <DD><p>Returns true if the object can return data for the MIME type specified by <tt>mimetype</tt>; otherwise returns false.</p> <p>For the most common types of data, you can call the higher-level functions <a href="QMimeData.html#hasText()"><tt>hasText</tt></a>, <a href="QMimeData.html#hasHtml()"><tt>hasHtml</tt></a>, <a href="QMimeData.html#hasUrls()"><tt>hasUrls</tt></a>, <a href="QMimeData.html#hasImage()"><tt>hasImage</tt></a>, and <a href="QMimeData.html#hasColor()"><tt>hasColor</tt></a> instead.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#formats()"><tt>formats</tt></a>, <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a>, <a href="QMimeData.html#data(java.lang.String)"><tt>data</tt></a></DL> </DD> </DL> <HR> <A NAME="retrieveData(java.lang.String, int)"><!-- --></A><H3> retrieveData</H3> <PRE> protected java.lang.Object <B>retrieveData</B>(java.lang.String mimetype, int preferredType)</PRE> <DL> <DD><p>Returns a variant with the given <tt>preferredType</tt> containing data for the MIME type specified by <tt>mimetype</tt>. If the object does not support the MIME type or variant type given, a null variant is returned instead.</p> <p>This function is called by the general <a href="QMimeData.html#data(java.lang.String)"><tt>data</tt></a> getter and by the convenience getters (<a href="QMimeData.html#text()"><tt>text</tt></a>, <a href="QMimeData.html#html()"><tt>html</tt></a>, <a href="QMimeData.html#urls()"><tt>urls</tt></a>, <a href="QMimeData.html#imageData()"><tt>imageData</tt></a>, and <a href="QMimeData.html#colorData()"><tt>colorData</tt></a>). You can reimplement it if you want to store your data using a custom data structure (instead of a <a href="%2E%2E/core/QByteArray.html"><tt>QByteArray</tt></a>, which is what <a href="QMimeData.html#setData(java.lang.String, com.trolltech.qt.core.QByteArray)"><tt>setData</tt></a> provides). You would then also need to reimplement <a href="QMimeData.html#hasFormat(java.lang.String)"><tt>hasFormat</tt></a> and <a href="QMimeData.html#formats()"><tt>formats</tt></a>.</p> <P> <DD><DL> <DT><B>See Also:</B><DD><a href="QMimeData.html#data(java.lang.String)"><tt>data</tt></a></DL> </DD> </DL> <HR> <A NAME="fromNativePointer(com.trolltech.qt.QNativePointer)"><!-- --></A><H3> fromNativePointer</H3> <PRE> public static <A HREF="../../../../com/trolltech/qt/gui/QMimeData.html" title="class in com.trolltech.qt.gui">QMimeData</A> <B>fromNativePointer</B>(<A HREF="../../../../com/trolltech/qt/QNativePointer.html" title="class in com.trolltech.qt">QNativePointer</A> nativePointer)</PRE> <DL> <DD>This function returns the QMimeData instance pointed to by nativePointer <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>nativePointer</CODE> - the QNativePointer of which object should be returned.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/trolltech/qt/gui/QMessageBox.StandardButtons.html" title="class in com.trolltech.qt.gui"><B>PREV CLASS</B></A> <A HREF="../../../../com/trolltech/qt/gui/QMotifStyle.html" title="class in com.trolltech.qt.gui"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?com/trolltech/qt/gui/QMimeData.html" target="_top"><B>FRAMES</B></A> <A HREF="QMimeData.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_classes_inherited_from_class_com.trolltech.qt.QSignalEmitter">NESTED</A> | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>