本文整理汇总了C++中QPixmap::paintingActive方法的典型用法代码示例。如果您正苦于以下问题:C++ QPixmap::paintingActive方法的具体用法?C++ QPixmap::paintingActive怎么用?C++ QPixmap::paintingActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPixmap
的用法示例。
在下文中一共展示了QPixmap::paintingActive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QPaintDevice
QPixmap::QPixmap( const QPixmap &pixmap )
: QPaintDevice( QInternal::Pixmap )
{
if ( pixmap.paintingActive() ) { // make a deep copy
data = 0;
operator=( pixmap.copy() );
} else {
data = pixmap.data;
data->ref();
devFlags = pixmap.devFlags; // copy QPaintDevice flags
#if defined(Q_WS_WIN)
hdc = pixmap.hdc; // copy Windows device context
#elif defined(Q_WS_X11)
hd = pixmap.hd; // copy X11 drawable
rendhd = pixmap.rendhd;
copyX11Data( &pixmap ); // copy x11Data
#elif defined(Q_WS_MAC)
hd = pixmap.hd;
#endif
}
}
示例2: bindTexture
GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QPixmap &pixmap, BindOptions options)
{
if (pixmap.isNull())
return 0;
QMutexLocker locker(&m_mutex);
qint64 key = pixmap.cacheKey();
// A QPainter is active on the image - take the safe route and replace the texture.
if (!pixmap.paintingActive()) {
QOpenGLCachedTexture *entry = m_cache.object(key);
if (entry && entry->options() == options) {
context->functions()->glBindTexture(GL_TEXTURE_2D, entry->id());
return entry->id();
}
}
GLuint id = bindTexture(context, key, pixmap.toImage(), options);
if (id > 0)
QImagePixmapCleanupHooks::enableCleanupHooks(pixmap);
return id;
}