diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-09-23 12:42:20 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-09-24 20:14:25 +0900 |
commit | d73937a9f779e2aafa6c392f94c9c29aa32b78fd (patch) | |
tree | e2c52ad435e8cca696acae34b1f451e934675a64 /doc/dnd.doc | |
parent | eb42871e999672a8fad5793733c58be05928c8ea (diff) | |
download | tqt3-r14.1.1.tar.gz tqt3-r14.1.1.zip |
Replace QObject, QWidget, QImage, QPair, QRgb, QColor, QChar, QString, QIODevice with TQ* versionr14.1.1
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit b35e0845dc9b3c8b9a5e52a682c769f383933fae)
Diffstat (limited to 'doc/dnd.doc')
-rw-r--r-- | doc/dnd.doc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/doc/dnd.doc b/doc/dnd.doc index b7d54c15..27ac5937 100644 --- a/doc/dnd.doc +++ b/doc/dnd.doc @@ -57,7 +57,7 @@ QTextEdit widget source code. \section1 Dragging -To start a drag, for example in a \link QWidget::mouseMoveEvent() +To start a drag, for example in a \link TQWidget::mouseMoveEvent() mouse motion event\endlink, create an object of the QDragObject subclass appropriate for your media, such as QTextDrag for text and QImageDrag for images. Then call the drag() method. This is all you @@ -84,20 +84,20 @@ references. \section1 Dropping To be able to receive media dropped on a widget, call -\link QWidget::setAcceptDrops() setAcceptDrops(TRUE)\endlink +\link TQWidget::setAcceptDrops() setAcceptDrops(TRUE)\endlink for the widget (e.g. in its constructor), and override the event handler methods -\link QWidget::dragEnterEvent() dragEnterEvent()\endlink and -\link QWidget::dropEvent() dropEvent()\endlink. +\link TQWidget::dragEnterEvent() dragEnterEvent()\endlink and +\link TQWidget::dropEvent() dropEvent()\endlink. For more sophisticated applications overriding -\link QWidget::dragMoveEvent() dragMoveEvent()\endlink and -\link QWidget::dragLeaveEvent() dragLeaveEvent()\endlink will also be +\link TQWidget::dragMoveEvent() dragMoveEvent()\endlink and +\link TQWidget::dragLeaveEvent() dragLeaveEvent()\endlink will also be necessary. For example, to accept text and image drops: \code MyWidget::MyWidget(...) : - QWidget(...) + TQWidget(...) { ... setAcceptDrops(TRUE); @@ -113,8 +113,8 @@ void MyWidget::dragEnterEvent(QDragEnterEvent* event) void MyWidget::dropEvent(QDropEvent* event) { - QImage image; - QString text; + TQImage image; + TQString text; if ( QImageDrag::decode(event, image) ) { insertImageAt(image, event->pos()); @@ -146,7 +146,7 @@ void MyWidget::copy() void MyWidget::paste() { - QString text; + TQString text; if ( QTextDrag::decode(QApplication::clipboard()->data(), text) ) insertText( text ); } @@ -283,7 +283,7 @@ void MyEditor::startDrag() void MyEditor::dropEvent(QDropEvent* event) { - QString text; + TQString text; if ( QTextDrag::decode(event, text) ) { if ( event->source() == this && event->action() == QDropEvent::Move ) { @@ -300,7 +300,7 @@ void MyEditor::dropEvent(QDropEvent* event) Some widgets are more specific than just a "yes" or "no" response when data is dragged onto them. For example, a CAD program might only accept drops of text onto text objects in the view. In these cases, -the \link QWidget::dragMoveEvent() dragMoveEvent()\endlink is used and +the \link TQWidget::dragMoveEvent() dragMoveEvent()\endlink is used and an \e area is given for which the drag is accepted or ignored: \code void MyWidget::dragMoveEvent(QDragMoveEvent* event) |