summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Cojocaru <raphael.cojocaru@yahoo.com>2016-10-10 15:24:16 (GMT)
committerRaphael Cojocaru <raphael.cojocaru@yahoo.com>2016-10-10 15:24:16 (GMT)
commita47364f40ea29fe0104788d686049b3670dc011f (patch)
tree9f681346c043222ee0af5424bf8b5ddac6674a05
parentbaa4331400025631a4c33c5a0547a1b3988ad355 (diff)
Start working on porting Altvstime to QCP 2.0
-rw-r--r--kstars/tools/altvstime.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/kstars/tools/altvstime.cpp b/kstars/tools/altvstime.cpp
index 6e08f39..6c56abc 100644
--- a/kstars/tools/altvstime.cpp
+++ b/kstars/tools/altvstime.cpp
@@ -112,8 +112,22 @@ AltVsTime::AltVsTime( QWidget* parent) :
avtUI->View->xAxis->setRange(43200, 129600);
avtUI->View->xAxis2->setRange(61200, 147600);
-
- // FIXME user QCPAxisTickerTime here
+ // configure the bottom axis to show time instead of number:
+ QSharedPointer<QCPAxisTickerTime> xAxisTimeTicker(new QCPAxisTickerTime);
+ xAxisTimeTicker->setTimeFormat("%h:%m");
+ // TODO: limit the hour values to 23
+ xAxisTimeTicker->setTickCount(12);
+ xAxisTimeTicker->setTickStepStrategy(QCPAxisTicker::tssReadability);
+ xAxisTimeTicker->setTickOrigin(Qt::UTC);
+ avtUI->View->xAxis->setTicker(xAxisTimeTicker);
+
+ // configure the top axis to show time instead of number:
+ QSharedPointer<QCPAxisTickerTime> xAxis2TimeTicker(new QCPAxisTickerTime);
+ xAxis2TimeTicker->setTimeFormat("%h:%m");
+ xAxis2TimeTicker->setTickCount(12);
+ xAxis2TimeTicker->setTickStepStrategy(QCPAxisTicker::tssReadability);
+ xAxis2TimeTicker->setTickOrigin(Qt::UTC);
+ avtUI->View->xAxis2->setTicker(xAxis2TimeTicker);
/*avtUI->View->xAxis->setDateTimeSpec(Qt::UTC);
avtUI->View->xAxis2->setDateTimeSpec(Qt::UTC);