summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp18
-rw-r--r--src/widgets/graphicsview/qgraphicsview.h6
-rw-r--r--src/widgets/graphicsview/qgraphicsview_p.h2
3 files changed, 13 insertions, 13 deletions
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index f5f24649c2..a00156ef01 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -353,7 +353,7 @@ QGraphicsViewPrivate::QGraphicsViewPrivate()
viewportUpdateMode(QGraphicsView::MinimalViewportUpdate),
optimizationFlags(0),
scene(0),
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
rubberBanding(false),
rubberBandSelectionMode(Qt::IntersectsItemShape),
rubberBandSelectionOperation(Qt::ReplaceSelection),
@@ -633,7 +633,7 @@ void QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent *event)
{
Q_Q(QGraphicsView);
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
updateRubberBand(event);
#endif
@@ -708,7 +708,7 @@ void QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent *event)
/*!
\internal
*/
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
QRegion QGraphicsViewPrivate::rubberBandRegion(const QWidget *widget, const QRect &rect) const
{
QStyleHintReturnMask mask;
@@ -1508,7 +1508,7 @@ void QGraphicsView::setDragMode(DragMode mode)
#endif
}
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
/*!
\property QGraphicsView::rubberBandSelectionMode
\brief the behavior for selecting items with a rubber band selection rectangle.
@@ -3274,7 +3274,7 @@ void QGraphicsView::mousePressEvent(QMouseEvent *event)
}
}
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (d->dragMode == QGraphicsView::RubberBandDrag && !d->rubberBanding) {
if (d->sceneInteractionAllowed) {
// Rubberbanding is only allowed in interactive mode.
@@ -3336,7 +3336,7 @@ void QGraphicsView::mouseReleaseEvent(QMouseEvent *event)
{
Q_D(QGraphicsView);
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (d->dragMode == QGraphicsView::RubberBandDrag && d->sceneInteractionAllowed && !event->buttons()) {
if (d->rubberBanding) {
if (d->viewportUpdateMode != QGraphicsView::NoViewportUpdate){
@@ -3459,7 +3459,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
// Set up the painter
QPainter painter(viewport());
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (d->rubberBanding && !d->rubberBandRect.isEmpty())
painter.save();
#endif
@@ -3583,7 +3583,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
// Foreground
drawForeground(&painter, exposedSceneRect);
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
// Rubberband
if (d->rubberBanding && !d->rubberBandRect.isEmpty()) {
painter.restore();
@@ -3651,7 +3651,7 @@ void QGraphicsView::scrollContentsBy(int dx, int dy)
if (d->viewportUpdateMode != QGraphicsView::NoViewportUpdate) {
if (d->viewportUpdateMode != QGraphicsView::FullViewportUpdate) {
if (d->accelerateScrolling) {
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
// Update new and old rubberband regions
if (!d->rubberBandRect.isEmpty()) {
QRegion rubberBandRegion(d->rubberBandRegion(viewport(), d->rubberBandRect));
diff --git a/src/widgets/graphicsview/qgraphicsview.h b/src/widgets/graphicsview/qgraphicsview.h
index fb975b9d71..d70ce6cf1c 100644
--- a/src/widgets/graphicsview/qgraphicsview.h
+++ b/src/widgets/graphicsview/qgraphicsview.h
@@ -72,7 +72,7 @@ class Q_WIDGETS_EXPORT QGraphicsView : public QAbstractScrollArea
Q_PROPERTY(ViewportAnchor transformationAnchor READ transformationAnchor WRITE setTransformationAnchor)
Q_PROPERTY(ViewportAnchor resizeAnchor READ resizeAnchor WRITE setResizeAnchor)
Q_PROPERTY(ViewportUpdateMode viewportUpdateMode READ viewportUpdateMode WRITE setViewportUpdateMode)
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
Q_PROPERTY(Qt::ItemSelectionMode rubberBandSelectionMode READ rubberBandSelectionMode WRITE setRubberBandSelectionMode)
#endif
Q_PROPERTY(OptimizationFlags optimizationFlags READ optimizationFlags WRITE setOptimizationFlags)
@@ -144,7 +144,7 @@ public:
DragMode dragMode() const;
void setDragMode(DragMode mode);
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
Qt::ItemSelectionMode rubberBandSelectionMode() const;
void setRubberBandSelectionMode(Qt::ItemSelectionMode mode);
QRect rubberBandRect() const;
@@ -228,7 +228,7 @@ public Q_SLOTS:
void invalidateScene(const QRectF &rect = QRectF(), QGraphicsScene::SceneLayers layers = QGraphicsScene::AllLayers);
void updateSceneRect(const QRectF &rect);
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
Q_SIGNALS:
void rubberBandChanged(QRect viewportRect, QPointF fromScenePoint, QPointF toScenePoint);
#endif
diff --git a/src/widgets/graphicsview/qgraphicsview_p.h b/src/widgets/graphicsview/qgraphicsview_p.h
index 10103a1809..b34be77f11 100644
--- a/src/widgets/graphicsview/qgraphicsview_p.h
+++ b/src/widgets/graphicsview/qgraphicsview_p.h
@@ -136,7 +136,7 @@ public:
QGraphicsView::OptimizationFlags optimizationFlags;
QPointer<QGraphicsScene> scene;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
QRect rubberBandRect;
QRegion rubberBandRegion(const QWidget *widget, const QRect &rect) const;
void updateRubberBand(const QMouseEvent *event);