summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2013-06-05 18:38:56 +0300
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2013-06-07 14:46:25 +0300
commitd8fb9ca603439c8ee4381e1e47012e2e40385cd4 (patch)
tree28a5cfa2bef843c292632c8b6518667a6419f6b9
parent098b014cf37787e4234de0050e0d761161f3316a (diff)
qt5: Stop using QWeakPointer as a QPointer in Qt4 builds to reduce #ifdefs
QPointer works fine in Qt4 too, although with a minor performance overhead. QWeakPointer was going to deprecate it, but in Qt5 QPointer was brought back to life and QWeakPointer no longer works as a QPointer replacement.
-rw-r--r--elements/gstqtvideosink/qwidgetvideosinkdelegate.cpp4
-rw-r--r--elements/gstqtvideosink/qwidgetvideosinkdelegate.h6
-rw-r--r--src/QGst/Ui/graphicsvideowidget.h6
3 files changed, 2 insertions, 14 deletions
diff --git a/elements/gstqtvideosink/qwidgetvideosinkdelegate.cpp b/elements/gstqtvideosink/qwidgetvideosinkdelegate.cpp
index 76f3b45..eeb3855 100644
--- a/elements/gstqtvideosink/qwidgetvideosinkdelegate.cpp
+++ b/elements/gstqtvideosink/qwidgetvideosinkdelegate.cpp
@@ -43,11 +43,7 @@ void QWidgetVideoSinkDelegate::setWidget(QWidget *widget)
m_widget.data()->setAttribute(Qt::WA_OpaquePaintEvent, m_opaquePaintEventAttribute);
m_widget.data()->update();
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
m_widget = NULL;
-#else
- m_widget = QWeakPointer<QWidget>();
-#endif
}
if (widget) {
diff --git a/elements/gstqtvideosink/qwidgetvideosinkdelegate.h b/elements/gstqtvideosink/qwidgetvideosinkdelegate.h
index 8849287..d33e9f5 100644
--- a/elements/gstqtvideosink/qwidgetvideosinkdelegate.h
+++ b/elements/gstqtvideosink/qwidgetvideosinkdelegate.h
@@ -20,9 +20,9 @@
#include "qtvideosinkdelegate.h"
#include <QtCore/QEvent>
+#include <QtCore/QPointer>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
-# include <QtCore/QPointer>
# include <QtWidgets/QWidget>
#else
# include <QtGui/QWidget>
@@ -45,11 +45,7 @@ protected:
private:
// "widget" property
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
QPointer<QWidget> m_widget;
-#else
- QWeakPointer<QWidget> m_widget;
-#endif
// original value of the Qt::WA_OpaquePaintEvent attribute
bool m_opaquePaintEventAttribute;
diff --git a/src/QGst/Ui/graphicsvideowidget.h b/src/QGst/Ui/graphicsvideowidget.h
index 7d53c52..e6434b7 100644
--- a/src/QGst/Ui/graphicsvideowidget.h
+++ b/src/QGst/Ui/graphicsvideowidget.h
@@ -19,10 +19,10 @@
#define QGST_UI_GRAPHICSVIDEOWIDGET_H
#include "graphicsvideosurface.h"
+#include <QtCore/QPointer>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
# include <QtWidgets/QGraphicsWidget>
-# include <QtCore/QPointer>
#else
# include <QtGui/QGraphicsWidget>
#endif
@@ -56,11 +56,7 @@ public:
void setSurface(GraphicsVideoSurface *surface);
private:
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
QPointer<GraphicsVideoSurface> m_surface;
-#else
- QWeakPointer<GraphicsVideoSurface> m_surface;
-#endif
};
} // namespace Ui