本文整理汇总了C++中document::Ptr::startLoadingFullImage方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::startLoadingFullImage方法的具体用法?C++ Ptr::startLoadingFullImage怎么用?C++ Ptr::startLoadingFullImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类document::Ptr
的用法示例。
在下文中一共展示了Ptr::startLoadingFullImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print
void PrintHelper::print(Document::Ptr doc)
{
doc->startLoadingFullImage();
doc->waitUntilLoaded();
QPrinter printer;
PrintOptionsPage* optionsPage = new PrintOptionsPage(doc->size());
optionsPage->loadConfig();
std::unique_ptr<QPrintDialog> dialog(
KdePrint::createPrintDialog(&printer,
QList<QWidget*>() << optionsPage,
d->mParent)
);
dialog->setWindowTitle(i18n("Print Image"));
bool wantToPrint = dialog->exec();
optionsPage->saveConfig();
if (!wantToPrint) {
return;
}
QPainter painter(&printer);
QRect rect = painter.viewport();
QSize size = d->adjustSize(optionsPage, doc, printer.resolution(), rect.size());
QPoint pos = d->adjustPosition(optionsPage, size, rect.size());
painter.setViewport(pos.x(), pos.y(), size.width(), size.height());
QImage image = doc->image();
painter.setWindow(image.rect());
painter.drawImage(0, 0, image);
}
示例2: resizeImage
void ImageOpsContextManagerItem::resizeImage()
{
if (!d->ensureEditable()) {
return;
}
Document::Ptr doc = DocumentFactory::instance()->load(contextManager()->currentUrl());
doc->startLoadingFullImage();
DialogGuard<ResizeImageDialog> dialog(d->mMainWindow);
dialog->setOriginalSize(doc->size());
if (!dialog->exec()) {
return;
}
ResizeImageOperation* op = new ResizeImageOperation(dialog->size());
applyImageOperation(op);
}