summaryrefslogtreecommitdiffstats
path: root/src/graphs3d/axis/qlogvalue3daxisformatter.cpp
diff options
context:
space:
mode:
authorNiko Korkala <[email protected]>2025-03-24 13:04:36 +0200
committerNiko Korkala <[email protected]>2025-05-29 06:02:13 +0000
commitc1ccb5b83439203dcebe093ebb475d642d5b2973 (patch)
treeb83d64c24a9c2789835e834b9b2882adc5a816e5 /src/graphs3d/axis/qlogvalue3daxisformatter.cpp
parent1841af2b5b057929f5b8425e59c75f3b8af19b5a (diff)
Add categorized logging to graphs 3d pt1HEADdev
Feature allows developers to turn on categorized logging in graphs 3D which will log various different things qt.graphs3d.general, general purpose logs qt.graphs3d.series, series addition/removal qt.graphs3d.properties, property changes qt.graphs3d.events, sliceview enter/exit, zoom/rotate values qt.graphs3d.inputEvents, pick results qt.graphs3d.axis.general, axis general purpose qt.graphs3d.axis.properties, axis properties qt.graphs3d.critical, critical Task-number: QTBUG-128886 Change-Id: I714ff59af47f9ec583eae57e89fd0ae417d900df Reviewed-by: Sami Varanka <[email protected]>
Diffstat (limited to 'src/graphs3d/axis/qlogvalue3daxisformatter.cpp')
-rw-r--r--src/graphs3d/axis/qlogvalue3daxisformatter.cpp44
1 files changed, 29 insertions, 15 deletions
diff --git a/src/graphs3d/axis/qlogvalue3daxisformatter.cpp b/src/graphs3d/axis/qlogvalue3daxisformatter.cpp
index c1079cbc..093796ee 100644
--- a/src/graphs3d/axis/qlogvalue3daxisformatter.cpp
+++ b/src/graphs3d/axis/qlogvalue3daxisformatter.cpp
@@ -4,6 +4,7 @@
#include "qlogvalue3daxisformatter_p.h"
#include "qvalue3daxis_p.h"
#include <QtCore/qmath.h>
+#include <qgraphs3dlogging_p.h>
QT_BEGIN_NAMESPACE
@@ -144,16 +145,20 @@ void QLogValue3DAxisFormatter::setBase(qreal base)
{
Q_D(QLogValue3DAxisFormatter);
if (base < 0.0f || base == 1.0f) {
- qWarning(
- "Warning: The logarithm base must be greater than 0 and not equal to 1, attempted: %f",
- base);
+ qCWarning(lcAProperties3D,
+ "%s the logarithm base must be greater than 0 and not equal to 1, attempted: %.1f",
+ qUtf8Printable(QLatin1String(__FUNCTION__)), base);
return;
}
- if (d->m_base != base) {
- d->m_base = base;
- markDirty(true);
- emit baseChanged(base);
+ if (qFuzzyCompare(d->m_base, base)) {
+ qCDebug(lcAProperties3D,
+ "%s Base value is already set to: %.1f",
+ qUtf8Printable(QLatin1String(__FUNCTION__)), base);
+ return;
}
+ d->m_base = base;
+ markDirty(true);
+ emit baseChanged(base);
}
qreal QLogValue3DAxisFormatter::base() const
@@ -178,11 +183,15 @@ qreal QLogValue3DAxisFormatter::base() const
void QLogValue3DAxisFormatter::setAutoSubGrid(bool enabled)
{
Q_D(QLogValue3DAxisFormatter);
- if (d->m_autoSubGrid != enabled) {
- d->m_autoSubGrid = enabled;
- markDirty(false);
- emit autoSubGridChanged(enabled);
+ if (d->m_autoSubGrid == enabled) {
+ qCDebug(lcAProperties3D) << __FUNCTION__
+ << "auto subgrid value is already set to:" << enabled;
+ return;
}
+ d->m_autoSubGrid = enabled;
+ markDirty(false);
+ emit autoSubGridChanged(enabled);
+
}
bool QLogValue3DAxisFormatter::autoSubGrid() const
@@ -209,11 +218,16 @@ bool QLogValue3DAxisFormatter::autoSubGrid() const
void QLogValue3DAxisFormatter::setEdgeLabelsVisible(bool enabled)
{
Q_D(QLogValue3DAxisFormatter);
- if (d->m_edgeLabelsVisible != enabled) {
- d->m_edgeLabelsVisible = enabled;
- markDirty(true);
- emit edgeLabelsVisibleChanged(enabled);
+ if (d->m_edgeLabelsVisible == enabled) {
+ qCDebug(lcAProperties3D) << __FUNCTION__
+ << "edge labels visibility is already set to:" << enabled;
+ return;
}
+
+ d->m_edgeLabelsVisible = enabled;
+ markDirty(true);
+ emit edgeLabelsVisibleChanged(enabled);
+
}
bool QLogValue3DAxisFormatter::edgeLabelsVisible() const