本文整理汇总了C++中QClipboardData::releaseIData方法的典型用法代码示例。如果您正苦于以下问题:C++ QClipboardData::releaseIData方法的具体用法?C++ QClipboardData::releaseIData怎么用?C++ QClipboardData::releaseIData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QClipboardData
的用法示例。
在下文中一共展示了QClipboardData::releaseIData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: event
bool QClipboard::event(QEvent *e)
{
if (e->type() != QEvent::Clipboard)
return QObject::event(e);
QClipboardData *d = clipboardData();
MSG *m = (MSG *)((QClipboardEvent*)e)->data();
if (!m) {
// this is sent to render all formats at app shut down
if (ownsClipboard()) {
OleFlushClipboard();
d->releaseIData();
}
return true;
}
bool propagate = false;
if (m->message == WM_CHANGECBCHAIN) {
if ((HWND)m->wParam == d->nextClipboardViewer)
d->nextClipboardViewer = (HWND)m->lParam;
else
propagate = true;
} else if (m->message == WM_DRAWCLIPBOARD) {
emitChanged(QClipboard::Clipboard);
if (!ownsClipboard() && d->iData)
// clean up the clipboard object if we no longer own the clipboard
d->releaseIData();
propagate = true;
}
if (propagate && d->nextClipboardViewer) {
if (ptrIsHungAppWindow == 0) {
QSystemLibrary library(QLatin1String("User32"));
ptrIsHungAppWindow = (PtrIsHungAppWindow)library.resolve("IsHungAppWindow");
}
if (ptrIsHungAppWindow && ptrIsHungAppWindow(d->nextClipboardViewer)) {
qWarning("%s: Cowardly refusing to send clipboard message to hung application...", Q_FUNC_INFO);
} else if (isProcessBeingDebugged(d->nextClipboardViewer)) {
// Also refuse if the process is being debugged, specifically, if it is
// displaying a runtime assert, which is not caught by isHungAppWindow().
qWarning("%s: Cowardly refusing to send clipboard message to application under debugger...", Q_FUNC_INFO);
} else {
SendMessage(d->nextClipboardViewer, m->message, m->wParam, m->lParam);
}
}
return true;
}
示例2: setMimeData
void QClipboard::setMimeData(QMimeData *src, Mode mode)
{
if (mode != Clipboard)
return;
QClipboardData *d = clipboardData();
if (!(d->iData && d->iData->mimeData() == src)) {
d->releaseIData();
d->iData = new QOleDataObject(src);
}
if (OleSetClipboard(d->iData) != S_OK) {
d->releaseIData();
qErrnoWarning("QClipboard::setMimeData: Failed to set data on clipboard");
return;
}
}
示例3: clear
void QClipboard::clear(Mode mode)
{
if (mode != Clipboard) return;
QClipboardData *d = clipboardData();
d->releaseIData();
if (OleSetClipboard(0) != S_OK) {
qErrnoWarning("QClipboard::clear: Failed to clear data on clipboard");
return;
}
}
示例4: clear
void QClipboard::clear(Mode mode)
{
if (mode != Clipboard) return;
QClipboardData *d = clipboardData();
d->releaseIData();
if (OleSetClipboard(0) != S_OK) {
qErrnoWarning("QClipboard::clear: Failed to clear data on clipboard");
return;
}
#if defined(Q_OS_WINCE)
// As WinCE does not support notifications we send the signal here
// We will get no event when the clipboard changes outside...
emit dataChanged();
emit changed(Clipboard);
#endif
}