summaryrefslogtreecommitdiffstats
path: root/src/render/frontend/qcameralens.cpp
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire350@gmail.com>2016-08-13 01:14:47 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-08-16 06:27:21 +0000
commitef8b1082757acbe24d4bc7e1615fa7eec37badc4 (patch)
tree58a67c021ec8ecce74b174701a2c0e54f73f4a83 /src/render/frontend/qcameralens.cpp
parent1446680e55dd2780890de7586c8693babb934e33 (diff)
QCameraLens: block notifications that shouldn't be sent
Change-Id: If2b8cf60aac69d800657073be12a7f3d6038c41e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend/qcameralens.cpp')
-rw-r--r--src/render/frontend/qcameralens.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/render/frontend/qcameralens.cpp b/src/render/frontend/qcameralens.cpp
index 3f7a9f4f7..8c730c763 100644
--- a/src/render/frontend/qcameralens.cpp
+++ b/src/render/frontend/qcameralens.cpp
@@ -111,7 +111,11 @@ void QCameraLens::setProjectionType(QCameraLens::ProjectionType projectionType)
Q_D(QCameraLens);
if (d->m_projectionType != projectionType) {
d->m_projectionType = projectionType;
+
+ const bool wasBlocked = blockNotifications(true);
emit projectionTypeChanged(projectionType);
+ blockNotifications(wasBlocked);
+
d->updateProjectionMatrix();
}
}
@@ -195,7 +199,11 @@ void QCameraLens::setNearPlane(float nearPlane)
if (qFuzzyCompare(d->m_nearPlane, nearPlane))
return;
d->m_nearPlane = nearPlane;
+
+ const bool wasBlocked = blockNotifications(true);
emit nearPlaneChanged(nearPlane);
+ blockNotifications(wasBlocked);
+
d->updateProjectionMatrix();
}
@@ -218,7 +226,11 @@ void QCameraLens::setFarPlane(float farPlane)
if (qFuzzyCompare(d->m_farPlane, farPlane))
return;
d->m_farPlane = farPlane;
+
+ const bool wasBlocked = blockNotifications(true);
emit farPlaneChanged(farPlane);
+ blockNotifications(wasBlocked);
+
d->updateProjectionMatrix();
}
@@ -244,7 +256,11 @@ void QCameraLens::setFieldOfView(float fieldOfView)
if (qFuzzyCompare(d->m_fieldOfView, fieldOfView))
return;
d->m_fieldOfView = fieldOfView;
+
+ const bool wasBlocked = blockNotifications(true);
emit fieldOfViewChanged(fieldOfView);
+ blockNotifications(wasBlocked);
+
d->updateProjectionMatrix();
}
@@ -273,7 +289,11 @@ void QCameraLens::setAspectRatio(float aspectRatio)
if (qFuzzyCompare(d->m_aspectRatio, aspectRatio))
return;
d->m_aspectRatio = aspectRatio;
+
+ const bool wasBlocked = blockNotifications(true);
emit aspectRatioChanged(aspectRatio);
+ blockNotifications(wasBlocked);
+
d->updateProjectionMatrix();
}
@@ -302,7 +322,11 @@ void QCameraLens::setLeft(float left)
if (qFuzzyCompare(d->m_left, left))
return;
d->m_left = left;
+
+ const bool wasBlocked = blockNotifications(true);
emit leftChanged(left);
+ blockNotifications(wasBlocked);
+
d->updateProjectionMatrix();
}
@@ -331,7 +355,11 @@ void QCameraLens::setRight(float right)
if (qFuzzyCompare(d->m_right, right))
return;
d->m_right = right;
+
+ const bool wasBlocked = blockNotifications(true);
emit rightChanged(right);
+ blockNotifications(wasBlocked);
+
d->updateProjectionMatrix();
}
@@ -360,7 +388,11 @@ void QCameraLens::setBottom(float bottom)
if (qFuzzyCompare(d->m_bottom, bottom))
return;
d->m_bottom = bottom;
+
+ const bool wasBlocked = blockNotifications(true);
emit bottomChanged(bottom);
+ blockNotifications(wasBlocked);
+
d->updateProjectionMatrix();
}
@@ -389,7 +421,11 @@ void QCameraLens::setTop(float top)
if (qFuzzyCompare(d->m_top, top))
return;
d->m_top = top;
+
+ const bool wasBlocked = blockNotifications(true);
emit topChanged(top);
+ blockNotifications(wasBlocked);
+
d->updateProjectionMatrix();
}