diff --git a/src/graphic/QskGraphic.cpp b/src/graphic/QskGraphic.cpp index 54f35fd9..45e98cb6 100644 --- a/src/graphic/QskGraphic.cpp +++ b/src/graphic/QskGraphic.cpp @@ -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 diff --git a/src/graphic/QskGraphic.h b/src/graphic/QskGraphic.h index 552b6f04..2e96e5c4 100644 --- a/src/graphic/QskGraphic.h +++ b/src/graphic/QskGraphic.h @@ -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;