本文整理汇总了C++中QPicture::d_func方法的典型用法代码示例。如果您正苦于以下问题:C++ QPicture::d_func方法的具体用法?C++ QPicture::d_func怎么用?C++ QPicture::d_func使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPicture
的用法示例。
在下文中一共展示了QPicture::d_func方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: begin
bool QPicturePaintEngine::begin(QPaintDevice *pd)
{
Q_D(QPicturePaintEngine);
#ifdef QT_PICTURE_DEBUG
qDebug() << "QPicturePaintEngine::begin()";
#endif
Q_ASSERT(pd);
QPicture *pic = static_cast<QPicture *>(pd);
d->pdev = pd;
d->pic_d = pic->d_func();
Q_ASSERT(d->pic_d);
d->s.setDevice(&d->pic_d->pictb);
d->s.setVersion(d->pic_d->formatMajor);
d->pic_d->pictb.open(QIODevice::WriteOnly | QIODevice::Truncate);
d->s.writeRawData(qt_mfhdr_tag, 4);
d->s << (quint16) 0 << (quint16) d->pic_d->formatMajor << (quint16) d->pic_d->formatMinor;
d->s << (quint8) QPicturePrivate::PdcBegin << (quint8) sizeof(qint32);
d->pic_d->brect = QRect();
if (d->pic_d->formatMajor >= 4) {
QRect r = pic->boundingRect();
d->s << (qint32) r.left() << (qint32) r.top() << (qint32) r.width()
<< (qint32) r.height();
}
d->pic_d->trecs = 0;
d->s << (quint32)d->pic_d->trecs; // total number of records
d->pic_d->formatOk = false;
setActive(true);
return true;
}
示例2: begin
bool QPreviewPaintEngine::begin(QPaintDevice *)
{
Q_D(QPreviewPaintEngine);
qDeleteAll(d->pages);
d->pages.clear();
QPicture *page = new QPicture;
page->d_func()->in_memory_only = true;
d->painter = new QPainter(page);
d->engine = d->painter->paintEngine();
d->pages.append(page);
d->state = QPrinter::Active;
return true;
}
示例3: newPage
bool QPreviewPaintEngine::newPage()
{
Q_D(QPreviewPaintEngine);
QPicture *page = new QPicture;
page->d_func()->in_memory_only = true;
QPainter *tmp_painter = new QPainter(page);
QPaintEngine *tmp_engine = tmp_painter->paintEngine();
// copy the painter state from the original painter
Q_ASSERT(painter()->d_func()->state && tmp_painter->d_func()->state);
*tmp_painter->d_func()->state = *painter()->d_func()->state;
// composition modes aren't supported on a QPrinter and yields a
// warning, so ignore it for now
tmp_engine->setDirty(DirtyFlags(AllDirty & ~DirtyCompositionMode));
tmp_engine->syncState();
delete d->painter;
d->painter = tmp_painter;
d->pages.append(page);
d->engine = tmp_engine;
return true;
}