From 8468c10170a2fb9d07a0ccb668e3359a1929fc16 2012-11-26 15:19:05 From: Marek Rosa Date: 2012-11-26 15:19:05 Subject: [PATCH] Fix to domain initialization when log base was preset on axis before adding it to chart --- diff --git a/src/domain/logxlogydomain.cpp b/src/domain/logxlogydomain.cpp index 32e4a89..4ddbb7e 100644 --- a/src/domain/logxlogydomain.cpp +++ b/src/domain/logxlogydomain.cpp @@ -160,11 +160,15 @@ bool LogXLogYDomain::attachAxis(QAbstractAxis* axis) AbstractDomain::attachAxis(axis); QLogValueAxis *logAxis = qobject_cast(axis); - if(logAxis && logAxis->orientation()==Qt::Vertical) + if(logAxis && logAxis->orientation()==Qt::Vertical) { QObject::connect(logAxis, SIGNAL(baseChanged(qreal)), this, SLOT(handleVerticalAxisBaseChanged(qreal))); + handleVerticalAxisBaseChanged(logAxis->base()); + } - if(logAxis && logAxis->orientation()==Qt::Horizontal) + if(logAxis && logAxis->orientation()==Qt::Horizontal) { QObject::connect(logAxis, SIGNAL(baseChanged(qreal)), this, SLOT(handleHorizontalAxisBaseChanged(qreal))); + handleHorizontalAxisBaseChanged(logAxis->base()); + } return true; } diff --git a/src/domain/logxydomain.cpp b/src/domain/logxydomain.cpp index f63c496..2842196 100644 --- a/src/domain/logxydomain.cpp +++ b/src/domain/logxydomain.cpp @@ -160,8 +160,10 @@ bool LogXYDomain::attachAxis(QAbstractAxis* axis) AbstractDomain::attachAxis(axis); QLogValueAxis *logAxis = qobject_cast(axis); - if(logAxis && logAxis->orientation()==Qt::Horizontal) + if(logAxis && logAxis->orientation()==Qt::Horizontal) { QObject::connect(logAxis, SIGNAL(baseChanged(qreal)), this, SLOT(handleHorizontalAxisBaseChanged(qreal))); + handleHorizontalAxisBaseChanged(logAxis->base()); + } return true; } diff --git a/src/domain/xlogydomain.cpp b/src/domain/xlogydomain.cpp index 0ded403..e2ddfa3 100644 --- a/src/domain/xlogydomain.cpp +++ b/src/domain/xlogydomain.cpp @@ -160,9 +160,10 @@ bool XLogYDomain::attachAxis(QAbstractAxis* axis) { QLogValueAxis *logAxis = qobject_cast(axis); - if(logAxis && logAxis->orientation()==Qt::Vertical) + if(logAxis && logAxis->orientation()==Qt::Vertical){ QObject::connect(logAxis, SIGNAL(baseChanged(qreal)), this, SLOT(handleVerticalAxisBaseChanged(qreal))); - + handleVerticalAxisBaseChanged(logAxis->base()); +} return AbstractDomain::attachAxis(axis); }