本文整理汇总了C++中ImageResource::fetchPixmap方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageResource::fetchPixmap方法的具体用法?C++ ImageResource::fetchPixmap怎么用?C++ ImageResource::fetchPixmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageResource
的用法示例。
在下文中一共展示了ImageResource::fetchPixmap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadOne
void MCommonPixmaps::loadOne()
{
// stop the timer, so we can adjust the frequency depending on the usage
cpuMonitor.stop();
if ((cpuMonitor.usage() != -1) && (cpuMonitor.usage() < maximumCpuUsageBeforeLoadingOneItem)) {
for (int i = 0; i < numberOfPixmapsToLoadAtOnce; ++i) {
if (!toLoadList.isEmpty()) {
PixmapIdentifier id = *toLoadList.begin();
toLoadList.erase(toLoadList.begin());
ImageResource *resource = daemon->findImageResource(id.imageId);
if (resource) {
resource->fetchPixmap(id.size);
} else {
mWarning("MCommonPixmaps") << QString("Themedaemon could not find resource %1 while loading most used pixmaps. Removing from list.").arg(id.imageId);
requestCounts.remove(id);
mostUsedPixmaps.remove(id);
}
} else {
break;
}
}
if (!toLoadList.isEmpty()) {
// there's still items in the list, so start the timer with small delay
cpuMonitor.start(delayBeforeLoadingNextItemWhenIdle);
} else {
if (toLoadList.isEmpty()) {
disconnect(&cpuMonitor, SIGNAL(newCpuFrameAvailable()), this, SLOT(loadOne()));
connect(&cpuMonitor, SIGNAL(newCpuFrameAvailable()), SLOT(updateClientsAboutMostUsed()));
cpuMonitor.start(delayBeforeSendingMostUsed);
}
}
} else {
// the cpu usage was too high, so start start the timer with longer delay
cpuMonitor.start(delayBeforeLoadingNextItemWhenBusy);
}
}