From 6930cc6f7247464f1adae143102b5a3811f25345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Sat, 18 Sep 2010 11:26:24 +0200 Subject: Give a warning in QPixmap::handle() if pixmap is not X11 class. Reviewed-by: Markus Goetz --- src/gui/image/qpixmap.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 66a861d..1e502bd 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1177,8 +1177,12 @@ Qt::HANDLE QPixmap::handle() const { #if defined(Q_WS_X11) const QPixmapData *pd = pixmapData(); - if (pd && pd->classId() == QPixmapData::X11Class) - return static_cast(pd)->handle(); + if (pd) { + if (pd->classId() == QPixmapData::X11Class) + return static_cast(pd)->handle(); + else + qWarning("QPixmap::handle(): Pixmap is not an X11 class pixmap"); + } #endif return 0; } -- cgit v0.12