The QClipboard class provides access to the window system clipboard. More...
#include <qclipboard.h>
Inherits QObject.
The clipboard offers a simple mechanism to copy and paste data between applications.
QClipboard supports the same formats that drag and drop supports, and uses much of the same mechanisms.
Only a single QClipboard object may exist in an application. This is because QClipboard is a shared window system resource. Call QApplication::clipboard() to access the clipboard.
Example:
QClipboard *cb = QApplication::clipboard(); QString text; // Copy text from the clipboard (paste) text = cb->text(); if ( text ) qDebug( "The clipboard contains: %s", text ); // Copy text into the clipboard cb->setText( "This text can be pasted by other programs" );
Clears the clipboard contents.
[virtual protected]
For internal use only.
Reimplemented from QObject.
Returns a reference to a QMimeSource representation of the current clipboard data.
[signal]
This signal is emitted when the clipboard data is changed.
[virtual protected]
Handles clipboard events (very platform-specific).
Reimplemented from QObject.
Returns the clipboard image, or null if the clipboard does not contain an image.
See also: setText().
Returns the clipboard pixmap, or null if the clipboard does not contains any pixmap. Note that this usually looses more information than image().
See also: setText() and image().
Sets the clipboard data. Ownership of the data is transferred to the clipboard - the only way to remove this data is to set something else, or to call clear(). The QDragObject subclasses are reasonable things to put on the clipboard (but do not try to drag the same object). Do not put QDragMoveEvent or QDropEvent subclasses on the clipboard, as they do not belong to the event handler which receives them.
The setText() and setPixmap() functions are shorthand ways of setting the data.
Copies image into the clipboard.
This is just a shorthand for:
setData(new QImageDrag(image))
See also: image() and setData().
Copies pixmap into the clipboard. Note that this usually looses more information than setImage(), as the data may be converted to an image for transfer.
See also: pixmap().
Copies text into the clipboard.
See also: text() and setData().
Returns the clipboard text, or a null string if the clipboard does not contain any text.
See also: setText().
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.
Copyright İ 1999 Troll Tech | Trademarks | Qt version 2.0.2
|