mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remove code that was unused.
Ancient code that was unused and only adding complexity to the DiveCartesianAxis. Also remove the spacing between the text and the lines of the Axis. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0ad2a69c42
commit
7fbeb71dce
4 changed files with 14 additions and 40 deletions
|
@ -35,5 +35,4 @@ void moveTo(QObject* obj, const QPointF& pos, int msecs)
|
||||||
moveTo(obj, pos.x(), pos.y(), msecs);
|
moveTo(obj, pos.x(), pos.y(), msecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ void DiveCartesianAxis::setTextColor(const QColor& color)
|
||||||
textColor = color;
|
textColor = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
DiveCartesianAxis::DiveCartesianAxis() : orientation(LeftToRight), showTicks(true), showText(true)
|
DiveCartesianAxis::DiveCartesianAxis() : orientation(LeftToRight)
|
||||||
{
|
{
|
||||||
setPen(gridPen());
|
setPen(gridPen());
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ void DiveCartesianAxis::updateTicks()
|
||||||
double steps = (max - min) / interval;
|
double steps = (max - min) / interval;
|
||||||
double currValue = min;
|
double currValue = min;
|
||||||
|
|
||||||
if(!showText && !labels.isEmpty()){
|
if(!labels.isEmpty()){
|
||||||
qDeleteAll(labels);
|
qDeleteAll(labels);
|
||||||
labels.clear();
|
labels.clear();
|
||||||
}
|
}
|
||||||
|
@ -145,27 +145,19 @@ void DiveCartesianAxis::updateTicks()
|
||||||
} else {
|
} else {
|
||||||
childPos = begin - i * stepSize;
|
childPos = begin - i * stepSize;
|
||||||
}
|
}
|
||||||
DiveTextItem *label = NULL;
|
DiveTextItem *label = new DiveTextItem(this);
|
||||||
|
label->setText(textForValue(currValue));
|
||||||
if (showText){
|
label->setBrush(QBrush(textColor));
|
||||||
label = new DiveTextItem(this);
|
label->setBrush(colorForValue(currValue));
|
||||||
label->setText(textForValue(currValue));
|
labels.push_back(label);
|
||||||
label->setBrush(QBrush(textColor));
|
|
||||||
label->setBrush(colorForValue(currValue));
|
|
||||||
labels.push_back(label);
|
|
||||||
}
|
|
||||||
if (orientation == RightToLeft || orientation == LeftToRight) {
|
if (orientation == RightToLeft || orientation == LeftToRight) {
|
||||||
if(showText){
|
label->setAlignment(Qt::AlignBottom | Qt::AlignHCenter);
|
||||||
label->setAlignment(Qt::AlignBottom | Qt::AlignHCenter);
|
label->setPos(scene()->sceneRect().width() + 10, m.y1() + tick_size); // position it outside of the scene);
|
||||||
label->setPos(scene()->sceneRect().width() + 10, m.y1() + tick_size); // position it outside of the scene);
|
label->animateMoveTo(childPos, m.y1() + tick_size);
|
||||||
label->animateMoveTo(childPos, m.y1() + tick_size);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(showText){
|
label->setAlignment(Qt::AlignVCenter| Qt::AlignLeft);
|
||||||
label->setAlignment(Qt::AlignVCenter| Qt::AlignLeft);
|
label->setPos(m.x1() - tick_size, scene()->sceneRect().height() + 10);
|
||||||
label->setPos(m.x1() - tick_size, scene()->sceneRect().height() + 10);
|
label->animateMoveTo(m.x1() - tick_size, childPos);
|
||||||
label->animateMoveTo(m.x1() - tick_size, childPos);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,18 +169,6 @@ void DiveCartesianAxis::animateChangeLine(const QLineF& newLine)
|
||||||
sizeChanged();
|
sizeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveCartesianAxis::setShowText(bool show)
|
|
||||||
{
|
|
||||||
showText = show;
|
|
||||||
updateTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DiveCartesianAxis::setShowTicks(bool show)
|
|
||||||
{
|
|
||||||
showTicks = show;
|
|
||||||
updateTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString DiveCartesianAxis::textForValue(double value)
|
QString DiveCartesianAxis::textForValue(double value)
|
||||||
{
|
{
|
||||||
return QString::number(value);
|
return QString::number(value);
|
||||||
|
|
|
@ -34,8 +34,6 @@ public:
|
||||||
qreal posAtValue(qreal value);
|
qreal posAtValue(qreal value);
|
||||||
void setColor(const QColor& color);
|
void setColor(const QColor& color);
|
||||||
void setTextColor(const QColor& color);
|
void setTextColor(const QColor& color);
|
||||||
void setShowTicks(bool show);
|
|
||||||
void setShowText(bool show);
|
|
||||||
void animateChangeLine(const QLineF& newLine);
|
void animateChangeLine(const QLineF& newLine);
|
||||||
int unitSystem;
|
int unitSystem;
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -53,8 +51,6 @@ protected:
|
||||||
double interval;
|
double interval;
|
||||||
double tick_size;
|
double tick_size;
|
||||||
QColor textColor;
|
QColor textColor;
|
||||||
bool showTicks;
|
|
||||||
bool showText;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DepthAxis : public DiveCartesianAxis {
|
class DepthAxis : public DiveCartesianAxis {
|
||||||
|
|
|
@ -120,7 +120,7 @@ void ProfileWidget2::setupItemOnScene()
|
||||||
profileYAxis->setOrientation(DiveCartesianAxis::TopToBottom);
|
profileYAxis->setOrientation(DiveCartesianAxis::TopToBottom);
|
||||||
profileYAxis->setMinimum(0);
|
profileYAxis->setMinimum(0);
|
||||||
profileYAxis->setTickInterval(M_OR_FT(10,30));
|
profileYAxis->setTickInterval(M_OR_FT(10,30));
|
||||||
profileYAxis->setTickSize(2);
|
profileYAxis->setTickSize(1);
|
||||||
|
|
||||||
gasYAxis->setOrientation(DiveCartesianAxis::BottomToTop);
|
gasYAxis->setOrientation(DiveCartesianAxis::BottomToTop);
|
||||||
gasYAxis->setTickInterval(1);
|
gasYAxis->setTickInterval(1);
|
||||||
|
@ -268,7 +268,6 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
||||||
profileYAxis->setMaximum(maxdepth);
|
profileYAxis->setMaximum(maxdepth);
|
||||||
profileYAxis->updateTicks();
|
profileYAxis->updateTicks();
|
||||||
|
|
||||||
qDebug() << "More profile..." << profileYAxis->minimum() << profileYAxis->maximum() << profileYAxis->tickInterval() << profileYAxis->tickSize();
|
|
||||||
temperatureAxis->setMinimum(pInfo.mintemp);
|
temperatureAxis->setMinimum(pInfo.mintemp);
|
||||||
temperatureAxis->setMaximum(pInfo.maxtemp);
|
temperatureAxis->setMaximum(pInfo.maxtemp);
|
||||||
timeAxis->setMaximum(maxtime);
|
timeAxis->setMaximum(maxtime);
|
||||||
|
|
Loading…
Add table
Reference in a new issue