fromPixmapAsImage added

This commit is contained in:
Uwe Rathmann 2021-10-26 11:33:26 +02:00
parent 10519ffee0
commit 6194f947b8
2 changed files with 18 additions and 0 deletions

View File

@ -1027,6 +1027,23 @@ QskGraphic QskGraphic::fromPixmap( const QPixmap& pixmap )
return graphic;
}
QskGraphic QskGraphic::fromPixmapAsImage( const QPixmap& pixmap )
{
/*
Using QPainter::drawPixmap in the scene graph thread leads
to warnings about "not being safe". This is probably not critical
for Qt/Quick as the main thread is waiting, when updating the
scene graph nodes.
It needs to be checked, what is going on, when
using the X11 paint engine, where QPixmap/QImage are more different.
TODO ...
*/
return fromImage( pixmap.toImage() );
}
#ifndef QT_NO_DEBUG_STREAM
#include <qdebug.h>

View File

@ -114,6 +114,7 @@ class QSK_EXPORT QskGraphic : public QPaintDevice
static QskGraphic fromImage( const QImage& );
static QskGraphic fromPixmap( const QPixmap& );
static QskGraphic fromPixmapAsImage( const QPixmap& );
quint64 modificationId() const;
uint hash( uint seed ) const;