QClipboard(3qt)

NAME
QClipboard - Access to the window system clipboard

SYNOPSIS

#include <qclipboard.h>

Inherits QObject.

  Public Members
void clear ()
void* data ( const char * format ) const
void setData ( const char * format, void * )
const char* text () const
void setText ( const char * )
QPixmap* pixmap () const
void setPixmap ( const QPixmap & )

  Signals
void dataChanged ()

  Protected Members
virtual void connectNotify ( const char * )
virtual bool event ( QEvent * )

DESCRIPTION
The QClipboard class provides access to the window system clipboard.

The clipboard offers a simple mechanism to copy and paste data between applications.

QClipboard supports these formats (a format is identified by a string):

"TEXT", zero-terminated char *.

"PIXMAP" as provided by QPixmap.

The "PIXMAP" format is not implemented in this version of Qt.

Only a single QClipboard object may exist in an application. This is because QClipboard is a shared window system resource. It is not possible to create a QClipboard object the standard C++ way (the constructor and destructor are private member functions, but accessible to QApplication since it is a friend class). Call QApplication::clipboard() to access the clipboard.

Example:

    QClipboard *cb = QApplication::clipboard();
    const char *text;
    // Copy text from the clipboard (paste)
    text = cb->text();
    if ( text )
        debug( "The clipboard contains: %s", text );
    // Copy text into the clipboard
    cb->setText( "This text can be pasted by other programs" );

MEMBER FUNCTION DOCUMENTATION

void QClipboard::clear ()
Clears the clipboard contents.

void QClipboard::connectNotify ( const char * ) [virtual protected]
For internal use only.

Reimplemented from QObject.

void * QClipboard::data ( const char * format ) const
Returns a pointer to the clipboard data, where format is the clipboard format.

We recommend that you use text() or pixmap() instead.

void QClipboard::dataChanged () [signal]
This signal is emitted when the clipboard data is changed.

bool QClipboard::event ( QEvent * e ) [virtual protected]
Handles clipboard events (very platform-specific).

Reimplemented from QObject.

QPixmap * QClipboard::pixmap () const
Returns the clipboard pixmap, or null if the clipboard does not contains any pixmap.

See also: setText().

void QClipboard::setData ( const char * format, void * data )
Copies text into the clipboard, where format is the clipboard format string and data is the data to be copied.

We recommend that you use setText() or setPixmap() instead.

void QClipboard::setPixmap ( const QPixmap & pixmap )
Copies pixmap into the clipboard.

See also: pixmap().

void QClipboard::setText ( const char * text )
Copies text into the clipboard.

See also: text().

const char * QClipboard::text () const
Returns the clipboard text, or null if the clipboard does not contains any text.

See also: setText().

SEE ALSO
http://www.troll.no/qt/qclipboard.html

COPYRIGHT
Copyright 1992-1997 Troll Tech AS. See the LICENSE file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.