mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 11:10:44 +00:00
Calculate currentTime String for line cursor mode only once per frame (really slow on mac)
This commit is contained in:
parent
de67282670
commit
99b255304d
@ -378,7 +378,13 @@ class gGraphView
|
|||||||
//! \brief The current time the mouse pointer is hovering over
|
//! \brief The current time the mouse pointer is hovering over
|
||||||
inline double currentTime() { return m_currenttime; }
|
inline double currentTime() { return m_currenttime; }
|
||||||
|
|
||||||
inline void setCurrentTime(double time) { m_currenttime = time; }
|
inline QString currentTimeString() { return m_currentTimeString; }
|
||||||
|
|
||||||
|
inline void setCurrentTime(double time) {
|
||||||
|
m_currenttime = time;
|
||||||
|
QDateTime dt=QDateTime::fromMSecsSinceEpoch(time);
|
||||||
|
m_currentTimeString = dt.toString("MMM dd - HH:mm:ss:zzz");
|
||||||
|
}
|
||||||
|
|
||||||
inline QPoint currentMousePos() const { return m_mouse; }
|
inline QPoint currentMousePos() const { return m_mouse; }
|
||||||
|
|
||||||
@ -501,7 +507,7 @@ class gGraphView
|
|||||||
|
|
||||||
QPoint m_mouse;
|
QPoint m_mouse;
|
||||||
qint64 m_currenttime;
|
qint64 m_currenttime;
|
||||||
|
QString m_currentTimeString;
|
||||||
|
|
||||||
QTime m_animationStarted;
|
QTime m_animationStarted;
|
||||||
|
|
||||||
|
@ -399,9 +399,7 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
|
|||||||
getMetaString(time);
|
getMetaString(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
// YEOWCH!!!! SLLLLLLLLLLOOOOOOOOWWWWWW.. Month name lookup is hideously slow on mac..
|
QString text = w.graphView()->currentTimeString() + lasttext;
|
||||||
QDateTime dt=QDateTime::fromMSecsSinceEpoch(time);
|
|
||||||
QString text = dt.toString("MMM dd - HH:mm:ss:zzz") + lasttext;
|
|
||||||
|
|
||||||
int wid, h;
|
int wid, h;
|
||||||
GetTextExtent(text, wid, h);
|
GetTextExtent(text, wid, h);
|
||||||
|
Loading…
Reference in New Issue
Block a user