diff options
Diffstat (limited to 'doc/html/dnd.html')
-rw-r--r-- | doc/html/dnd.html | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/doc/html/dnd.html b/doc/html/dnd.html index 0fb3d2950..08e41e137 100644 --- a/doc/html/dnd.html +++ b/doc/html/dnd.html @@ -59,18 +59,18 @@ mechanism. <p> For drag and drop examples see (in increasing order of sophistication): <tt>qt/examples/iconview/simple_dd</tt>, <tt>qt/examples/dragdrop</tt> and <tt>qt/examples/fileiconview</tt>. See also the -<a href="ntqtextedit.html">TQTextEdit</a> widget source code. +<a href="tqtextedit.html">TQTextEdit</a> widget source code. <p> <h2> Dragging </h2> <a name="1"></a><p> To start a drag, for example in a <a href="tqwidget.html#mouseMoveEvent">mouse motion event</a>, create an object of the <a href="ntqdragobject.html">TQDragObject</a> -subclass appropriate for your media, such as <a href="qtextdrag.html">TQTextDrag</a> for text and +subclass appropriate for your media, such as <a href="tqtextdrag.html">TQTextDrag</a> for text and <a href="tqimagedrag.html">TQImageDrag</a> for images. Then call the drag() method. This is all you need for simple dragging of existing types. <p> For example, to start dragging some text from a widget: <pre> void MyWidget::startDrag() { - <a href="ntqdragobject.html">TQDragObject</a> *d = new <a href="qtextdrag.html">TQTextDrag</a>( myHighlightedText(), this ); + <a href="ntqdragobject.html">TQDragObject</a> *d = new <a href="tqtextdrag.html">TQTextDrag</a>( myHighlightedText(), this ); d-><a href="ntqdragobject.html#dragCopy">dragCopy</a>(); // do NOT delete d. } @@ -107,7 +107,7 @@ MyWidget::MyWidget(...) : void MyWidget::dragEnterEvent(TQDragEnterEvent* event) { event->accept( - TQTextDrag::<a href="qtextdrag.html#canDecode">canDecode</a>(event) || + TQTextDrag::<a href="tqtextdrag.html#canDecode">canDecode</a>(event) || TQImageDrag::<a href="tqimagedrag.html#canDecode">canDecode</a>(event) ); } @@ -119,7 +119,7 @@ void MyWidget::dropEvent(TQDropEvent* event) if ( TQImageDrag::<a href="tqimagedrag.html#decode">decode</a>(event, image) ) { insertImageAt(image, event->pos()); - } else if ( TQTextDrag::<a href="qtextdrag.html#decode">decode</a>(event, text) ) { + } else if ( TQTextDrag::<a href="tqtextdrag.html#decode">decode</a>(event, text) ) { insertTextAt(text, event->pos()); } } @@ -143,13 +143,13 @@ information on the clipboard: void MyWidget::copy() { TQApplication::<a href="ntqapplication.html#clipboard">clipboard</a>()->setData( - new <a href="qtextdrag.html">TQTextDrag</a>(myHighlightedText()) ); + new <a href="tqtextdrag.html">TQTextDrag</a>(myHighlightedText()) ); } void MyWidget::paste() { <a href="tqstring.html">TQString</a> text; - if ( TQTextDrag::<a href="qtextdrag.html#decode">decode</a>(TQApplication::<a href="ntqapplication.html#clipboard">clipboard</a>()->data(), text) ) + if ( TQTextDrag::<a href="tqtextdrag.html#decode">decode</a>(TQApplication::<a href="ntqapplication.html#clipboard">clipboard</a>()->data(), text) ) insertText( text ); } </pre> @@ -210,7 +210,7 @@ indicate to each other which data formats they can accept and which they can produce. This is achieved using <a href="http://www.rfc-editor.org/rfc/rfc1341.txt">MIME types</a>: the drag source provides a list of MIME types that it can produce (ordered from most appropriate to least appropriate), and the drop target chooses -which of those it can accept. For example, <a href="qtextdrag.html">TQTextDrag</a> provides support +which of those it can accept. For example, <a href="tqtextdrag.html">TQTextDrag</a> provides support for the "<tt>text/plain</tt>" MIME type (ordinary unformatted text), and the Unicode formats "<tt>text/utf16</tt>" and "<tt>text/utf8</tt>"; <a href="tqimagedrag.html">TQImageDrag</a> provides for "<tt>image/*</tt>", where <tt>*</tt> is any image format that @@ -259,7 +259,7 @@ the drag start point and the drop event might look like this: <p> <pre> void MyEditor::startDrag() { - <a href="ntqdragobject.html">TQDragObject</a> *d = new <a href="qtextdrag.html">TQTextDrag</a>(myHighlightedText(), this); + <a href="ntqdragobject.html">TQDragObject</a> *d = new <a href="tqtextdrag.html">TQTextDrag</a>(myHighlightedText(), this); if ( d-><a href="ntqdragobject.html#drag">drag</a>() && d-><a href="ntqdragobject.html#target">target</a>() != this ) cutMyHighlightedText(); } @@ -268,7 +268,7 @@ void MyEditor::dropEvent(TQDropEvent* event) { <a href="tqstring.html">TQString</a> text; - if ( TQTextDrag::<a href="qtextdrag.html#decode">decode</a>(event, text) ) { + if ( TQTextDrag::<a href="tqtextdrag.html#decode">decode</a>(event, text) ) { if ( event->source() == this && event->action() == TQDropEvent::Move ) { // Careful not to tread on my own feet event->acceptAction(); @@ -288,7 +288,7 @@ an <em>area</em> is given for which the drag is accepted or ignored: <pre> void MyWidget::dragMoveEvent(TQDragMoveEvent* event) { - if ( TQTextDrag::<a href="qtextdrag.html#canDecode">canDecode</a>(event) ) { + if ( TQTextDrag::<a href="tqtextdrag.html#canDecode">canDecode</a>(event) ) { MyCadItem* item = findMyItemAt(event->pos()); if ( item ) event->accept(); @@ -302,7 +302,7 @@ you promise the acceptance persists: <pre> void MyWidget::dragMoveEvent(TQDragMoveEvent* event) { - if ( TQTextDrag::<a href="qtextdrag.html#canDecode">canDecode</a>(event) ) { + if ( TQTextDrag::<a href="tqtextdrag.html#canDecode">canDecode</a>(event) ) { MyCadItem* item = findMyItemAt(event->pos()); if ( item ) { <a href="ntqrect.html">TQRect</a> r = item->areaRelativeToMeClippedByAnythingInTheWay(); |