-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[Qt, OSX] QProgressBar CPU-Issue workaround #5296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
33ee777 to
ebbf9ef
Compare
ebbf9ef to
6093aa1
Compare
|
I'm not too happy about more and more platform-specific code, but if this is really required, fine with me. Please do move the implementation to guiutil, though. |
|
You can use a typedef to give the new name to the original class on non-Mac platforms, so the application code can be free of platform-specifics. |
|
I also don't like it. |
|
Is there a patch ready from Qt upstream that could be used during the build? I know we already include some patches during build time. |
|
@Diapolo i did search for a qt patch but could nothing found. I also followed the idea of writing a qt patch (root cause fixing) but didn't succeed. I just think we owe the user a more or less bug free bitcoin-qt client. This pull does not follow a state of the art architecture but makes the enduser experience better. I try now to move it to |
|
@sipa i just implemented |
|
I'll leave that up to @laanwj. I was just giving a suggestion on how you could keep the platform-dependence out of the application code. |
|
Agree with @sipa; something like #include <QProgressBar>
#ifdef Q_OS_MAC
#include <QEvent>
// 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;
#endifThen in the code you can just do ...would contain the platform specific code this to just guiutil.h. We just define our own progress bar class which happens to be different on a certain OS. |
3db587b to
0ceab00
Compare
|
Okay. Now i see. |
|
Making all in src Got this with current commit a574189 |
|
What version of Qt? Probably it needs a version check too. |
|
Admin@MacBookPro-3:~/Desktop/test/bitcoin $ brew upgrade qt |
|
OK - looks like this should be a Qt5-only workaround |
|
Hmm.. Yes. The enum is only in qt5 available. |
|
Thank you guys! |
fixes #5295
I know it's a bit of a hack. But it saves a lot of CPU ticks on OSX.
You might decide to take this in because it does the job and the QTBUG-15631 seams to be open and untouched since 2010.