44 #ifndef QT_NO_CLIPBOARD 318 for (
int i = 0; i < formats.
size(); ++i)
320 subtype = formats.
at(i).
mid(5);
332 #ifndef QT_NO_TEXTCODEC 339 #else //QT_NO_TEXTCODEC 341 #endif //QT_NO_TEXTCODEC 379 setMimeData(data, mode);
422 setMimeData(data, mode);
463 setMimeData(data, mode);
534 if (supportsMode(mode) ==
false)
537 if (
d->compat_data[mode])
538 return d->compat_data[mode];
540 d->wrapper[mode]->data = mimeData(mode);
541 return d->wrapper[mode];
555 if (supportsMode(mode) ==
false)
558 d->compat_data[mode] = source;
561 #endif // QT3_SUPPORT 569 return supportsMode(Selection);
578 return supportsMode(FindBuffer);
587 return ownsMode(Clipboard);
596 return ownsMode(Selection);
610 return ownsMode(FindBuffer);
647 emit selectionChanged();
650 emit findBufferChanged();
660 if (formats.isEmpty()) {
662 for (
int i = 0; i < fmts.
size(); ++i)
665 if (n < 0 || n >= formats.size())
667 return formats.at(n).data();
680 img.
save(&buffer,
"PNG");
700 while ((fmt = source->
format(i))) {
707 #endif // QT_NO_CLIPBOARD The QVariant class acts like a union for the most common Qt data types.
Mode
This enum type is used to control which part of the system clipboard is used by QClipboard::mimeData(...
bool ownsClipboard() const
Returns true if this clipboard object owns the clipboard data; otherwise returns false.
void emitChanged(Mode mode)
Emits the appropriate changed signal for mode.
void setImage(const QImage &, Mode mode=Clipboard)
Copies the image into the clipboard.
#define QT_END_NAMESPACE
This macro expands to.
virtual QStringList formats() const
Returns a list of formats supported by the object.
QClipboard(QObject *parent)
void setImageData(const QVariant &image)
Sets the data in the object to the given image.
bool open(OpenMode openMode)
Reimplemented Function
bool ownsFindBuffer() const
Returns true if this clipboard object owns the find buffer data; otherwise returns false...
The QByteArray class provides an array of bytes.
QStringList formats() const
Returns a list of formats supported by the object.
static QTextCodec * codecForHtml(const QByteArray &ba)
Tries to detect the encoding of the provided snippet of HTML in the given byte array, ba, by checking the BOM (Byte Order Mark) and the content-type meta header and returns a QTextCodec instance that is capable of decoding the html to unicode.
bool save(const QString &fileName, const char *format=0, int quality=-1) const
Saves the image to the file with the given fileName, using the given image file format and quality fa...
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType...
The QBuffer class provides a QIODevice interface for a QByteArray.
The QString class provides a Unicode character string.
void setText(const QString &, Mode mode=Clipboard)
Copies text into the clipboard as plain text.
bool hasFormat(const QString &mimetype) const
Returns true if the object can return data for the MIME type specified by mimeType; otherwise returns...
The QObject class is the base class of all Qt objects.
The QMimeSource class is an abstraction of objects that provided formatted data of a certain MIME typ...
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QString text() const
Returns a plain text (MIME type text/plain) representation of the data.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static bool setData(const QByteArray &data, STGMEDIUM *pmedium)
QVariant retrieveData(const QString &mimetype, QVariant::Type) const
Returns a variant with the given type containing data for the MIME type specified by mimeType...
void setPixmap(const QPixmap &, Mode mode=Clipboard)
Copies pixmap into the clipboard.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
static QTextCodec * codec(MYSQL *mysql)
Type
This enum type defines the types of variable that a QVariant can contain.
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
static QTextCodec * codecForMib(int mib)
Returns the QTextCodec which matches the MIBenum mib.
virtual bool provides(const char *) const
Returns true if the object can provide the data in format mimeType; otherwise returns false...
The QClipboard class provides access to the window system clipboard.
QPixmap pixmap(Mode mode=Clipboard) const
Returns the clipboard pixmap, or null if the clipboard does not contain a pixmap. ...
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
bool supportsFindBuffer() const
Returns true if the clipboard supports a separate search buffer; otherwise returns false...
const char * format(int n) const
Returns the (i - 1)-th supported MIME format, or 0.
The QMimeData class provides a container for data that records information about its MIME type...
bool supportsSelection() const
Returns true if the clipboard supports mouse selection; otherwise returns false.
QVariant imageData() const
Returns a QVariant storing a QImage if the object can return an image; otherwise returns a null varia...
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
int size() const
Returns the number of items in the list.
bool ownsSelection() const
Returns true if this clipboard object owns the mouse selection data; otherwise returns false...
T qvariant_cast(const QVariant &)
virtual const char * format(int n=0) const =0
Returns the (i - 1)-th supported MIME format, or 0.
The QPixmap class is an off-screen image representation that can be used as a paint device...
void setText(const QString &text)
Sets text as the plain text (MIME type text/plain) used to represent the data.
static QTextCodec * codecForUtfText(const QByteArray &ba)
Tries to detect the encoding of the provided snippet ba by using the BOM (Byte Order Mark) and return...
The QTextCodec class provides conversions between text encodings.
QByteArray encodedData(const char *) const
Returns the encoded data of this object in the specified MIME format.
QString text(Mode mode=Clipboard) const
Returns the clipboard text as plain text, or an empty string if the clipboard does not contain any te...
virtual QByteArray encodedData(const char *) const =0
Returns the encoded data of this object in the specified MIME format.
QImage image(Mode mode=Clipboard) const
Returns the clipboard image, or returns a null image if the clipboard does not contain an image or if...