本文整理汇总了C++中QClipboard::startTimer方法的典型用法代码示例。如果您正苦于以下问题:C++ QClipboard::startTimer方法的具体用法?C++ QClipboard::startTimer怎么用?C++ QClipboard::startTimer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QClipboard
的用法示例。
在下文中一共展示了QClipboard::startTimer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mimeData
const QMimeData* QClipboard::mimeData(Mode mode) const
{
QClipboardData *d = 0;
switch (mode) {
case Selection:
d = selectionData();
break;
case Clipboard:
d = clipboardData();
break;
default:
qWarning("QClipboard::mimeData: unsupported mode '%d'", mode);
return 0;
}
if (! d->source() && ! timer_event_clear) {
if (mode == Selection) {
if (! selection_watcher)
selection_watcher = new QClipboardWatcher(mode);
d->setSource(selection_watcher);
} else {
if (! clipboard_watcher)
clipboard_watcher = new QClipboardWatcher(mode);
d->setSource(clipboard_watcher);
}
if (! timer_id) {
// start a zero timer - we will clear cached data when the timer
// times out, which will be the next time we hit the event loop...
// that way, the data is cached long enough for calls within a single
// loop/function, but the data doesn't linger around in case the selection
// changes
QClipboard *that = ((QClipboard *) this);
timer_id = that->startTimer(0);
}
}
return d->source();
}