Add a platform API for QClipboard::ownsMode()

Simply forward ownsMode() to the QPlatformClipboard.
This commit is contained in:
Lars Knoll 2011-06-08 21:59:33 +02:00
parent 672fe5d43c
commit fc266713cc
3 changed files with 9 additions and 4 deletions

View File

@ -87,9 +87,8 @@ bool QClipboard::supportsMode(Mode mode) const
bool QClipboard::ownsMode(Mode mode) const
{
if (mode == Clipboard)
qWarning("QClipboard::ownsClipboard: UNIMPLEMENTED!");
return false;
QPlatformClipboard *clipboard = QGuiApplicationPrivate::platformIntegration()->clipboard();
return clipboard->ownsMode(mode);
}
void QClipboard::connectNotify( const char * )

View File

@ -102,6 +102,11 @@ bool QPlatformClipboard::supportsMode(QClipboard::Mode mode) const
return mode == QClipboard::Clipboard;
}
bool QPlatformClipboard::ownsMode(QClipboard::Mode mode) const
{
return false;
}
void QPlatformClipboard::emitChanged(QClipboard::Mode mode)
{
QGuiApplication::clipboard()->emitChanged(mode);

View File

@ -62,6 +62,7 @@ public:
virtual QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard);
virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard);
virtual bool supportsMode(QClipboard::Mode mode) const;
virtual bool ownsMode(QClipboard::Mode mode) const;
void emitChanged(QClipboard::Mode mode);
};