|
|
|
@ -202,32 +202,45 @@ namespace GUIUtil
|
|
|
|
|
|
|
|
|
|
QString formateNiceTimeOffset(qint64 secs);
|
|
|
|
|
|
|
|
|
|
#if defined(Q_OS_MAC) && QT_VERSION >= 0x050000
|
|
|
|
|
// workaround for Qt OSX Bug:
|
|
|
|
|
// https://bugreports.qt-project.org/browse/QTBUG-15631
|
|
|
|
|
// QProgressBar uses around 10% CPU even when app is in background
|
|
|
|
|
class ProgressBar : public QProgressBar
|
|
|
|
|
class ClickableLabel : public QLabel
|
|
|
|
|
{
|
|
|
|
|
bool event(QEvent *e) {
|
|
|
|
|
return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false;
|
|
|
|
|
}
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
/** Emitted when the label is clicked. The relative mouse coordinates of the click are
|
|
|
|
|
* passed to the signal.
|
|
|
|
|
*/
|
|
|
|
|
void clicked(const QPoint& point);
|
|
|
|
|
protected:
|
|
|
|
|
void mouseReleaseEvent(QMouseEvent *event);
|
|
|
|
|
};
|
|
|
|
|
#else
|
|
|
|
|
typedef QProgressBar ProgressBar;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
class ClickableLabel : public QLabel
|
|
|
|
|
class ClickableProgressBar : public QProgressBar
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
/** Emitted when the label is clicked. The relative mouse coordinates of the click are
|
|
|
|
|
/** Emitted when the progressbar is clicked. The relative mouse coordinates of the click are
|
|
|
|
|
* passed to the signal.
|
|
|
|
|
*/
|
|
|
|
|
void clicked(const QPoint& point);
|
|
|
|
|
protected:
|
|
|
|
|
void mousePressEvent(QMouseEvent *event);
|
|
|
|
|
void mouseReleaseEvent(QMouseEvent *event);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#if defined(Q_OS_MAC) && QT_VERSION >= 0x050000
|
|
|
|
|
// workaround for Qt OSX Bug:
|
|
|
|
|
// https://bugreports.qt-project.org/browse/QTBUG-15631
|
|
|
|
|
// QProgressBar uses around 10% CPU even when app is in background
|
|
|
|
|
class ProgressBar : public ClickableProgressBar
|
|
|
|
|
{
|
|
|
|
|
bool event(QEvent *e) {
|
|
|
|
|
return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
#else
|
|
|
|
|
typedef ClickableProgressBar ProgressBar;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
} // namespace GUIUtil
|
|
|
|
|
|
|
|
|
|