mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge pull request #5296
0ceab00
[Qt, OSX] move QProgressBarMac to guiutil.h (Jonas Schnelli)6093aa1
[Qt, OSX] QProgressBar CPU-Issue workaround (Jonas Schnelli)
This commit is contained in:
commit
e587ecd8a6
@ -190,7 +190,7 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
|
||||
// Progress bar and label for blocks download
|
||||
progressBarLabel = new QLabel();
|
||||
progressBarLabel->setVisible(false);
|
||||
progressBar = new QProgressBar();
|
||||
progressBar = new GUIUtil::ProgressBar();
|
||||
progressBar->setAlignment(Qt::AlignCenter);
|
||||
progressBar->setVisible(false);
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user