aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.h
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2014-11-18 09:55:39 +0100
committerJonas Schnelli <jonas.schnelli@include7.ch>2014-11-19 14:08:56 +0100
commit0ceab00d16a1d23da06a748889db25662b16bfb3 (patch)
treec1f994cb150c5bdb7e7a8d9a45900c17dc1560ee /src/qt/guiutil.h
parent6093aa1bb03b03331cc2f48d8f6b749f8817c016 (diff)
downloadbitcoin-0ceab00d16a1d23da06a748889db25662b16bfb3.tar.xz
[Qt, OSX] move QProgressBarMac to guiutil.h
Diffstat (limited to 'src/qt/guiutil.h')
-rw-r--r--src/qt/guiutil.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h
index 5666744bd3..a6ecfbcc82 100644
--- a/src/qt/guiutil.h
+++ b/src/qt/guiutil.h
@@ -7,9 +7,11 @@
#include "amount.h"
+#include <QEvent>
#include <QHeaderView>
#include <QMessageBox>
#include <QObject>
+#include <QProgressBar>
#include <QString>
#include <QTableView>
@@ -186,6 +188,21 @@ namespace GUIUtil
/* Format a CNodeCombinedStats.dPingTime into a user-readable string or display N/A, if 0*/
QString formatPingTime(double dPingTime);
+
+#ifdef Q_OS_MAC
+ // 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
+ {
+ bool event(QEvent *e) {
+ return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false;
+ }
+ };
+#else
+ typedef QProgressBar ProgressBar;
+#endif
+
} // namespace GUIUtil
#endif // BITCOIN_QT_GUIUTIL_H