diff options
Diffstat (limited to 'src/qt/guiutil.h')
-rw-r--r-- | src/qt/guiutil.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 0939c78f64..a6ecfbcc82 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -2,14 +2,16 @@ // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef GUIUTIL_H -#define GUIUTIL_H +#ifndef BITCOIN_QT_GUIUTIL_H +#define BITCOIN_QT_GUIUTIL_H #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 // GUIUTIL_H +#endif // BITCOIN_QT_GUIUTIL_H |