]> git.sesse.net Git - kdenlive/blobdiff - src/colorpickerwidget.cpp
Add center-crop option to slideshow clip.
[kdenlive] / src / colorpickerwidget.cpp
index 83bbb0414fc7981dc2cfac03fe73708d2a15a9f2..acd1d26982a8be5378c146f2395f5582abaa6b66 100644 (file)
@@ -59,8 +59,8 @@ ColorPickerWidget::ColorPickerWidget(QWidget *parent) :
 {
 #ifdef Q_WS_X11
     m_filter = 0;
+    m_image = NULL;
 #endif
-    m_image = 0;
 
     QHBoxLayout *layout = new QHBoxLayout(this);
 
@@ -141,8 +141,8 @@ QColor ColorPickerWidget::averagePickedColor(const QPoint pos)
 
 #ifdef Q_WS_X11
     XDestroyImage(m_image);
+    m_image = NULL;
 #endif
-    m_image = 0;
 
     if (size > 200)
         emit displayMessage(i18n("Calculated average color for rectangle."), -1);
@@ -224,7 +224,7 @@ QColor ColorPickerWidget::grabColor(const QPoint &p, bool destroyImage)
     if( !qApp->desktop()->geometry().contains( p ))
         return QColor();
     unsigned long xpixel;
-    if (m_image == 0) {
+    if (m_image == NULL) {
         Window root = RootWindow(QX11Info::display(), QX11Info::appScreen());
         m_image = XGetImage(QX11Info::display(), root, p.x(), p.y(), 1, 1, -1, ZPixmap);
         xpixel = XGetPixel(m_image, 0, 0);
@@ -243,7 +243,7 @@ QColor ColorPickerWidget::grabColor(const QPoint &p, bool destroyImage)
                 &xcol);
     return QColor::fromRgbF(xcol.red / 65535.0, xcol.green / 65535.0, xcol.blue / 65535.0);
 #else
-    if (m_image == 0) {
+    if (m_image.isNull()) {
         QWidget *desktop = QApplication::desktop();
         QPixmap pm = QPixmap::grabWindow(desktop->winId(), p.x(), p.y(), 1, 1);
         QImage i = pm.toImage();