JLev
JLev

Reputation: 705

Upgrade from Qt 5.7 to 5.10 results in slower UI

I've installed Qt 5.10 alongside 5.7, and when compiling the same project I get a very weird side-effect, my user interface is extremely slow (sometimes takes few seconds for a button push to process). I've looked at the cpu measurements, it doesn't look like it's working harder. Has anybody encountered such issue? Any directions to solving it / understanding the cause? Using ubuntu 16.04, with GCC 7.2 for both setups.

EDIT

Following an advice in the comments (thanks @n.m), ran with strace, looks like there is something different with the mouse handling, I think. While the 5.7 version finds this file open("/usr/share/icons/default/index.theme", O_RDONLY) = 11

The 5.10 version is looking for it in another location, and fails. Later, it finds another file for it. open("/home/innereye/.icons/DMZ-White/index.theme", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/usr/share/icons/DMZ-White/cursors/xterm", O_RDONLY) = 19

Upvotes: 1

Views: 303

Answers (1)

JLev
JLev

Reputation: 705

Well, I've found a solution (more of a workaround). After looking in to it, figured out that setting a background image was causing the problems. This is the code I had for it -

QPalette palette;
palette.setBrush(this->backgroundRole(), QBrush(QImage("/path/to/img.jpg").scaled(1870, 1020)));
this->setPalette(palette);

Now I change my QWidget to a QFrame, and used

setStyleSheet("QFrame {background-image: url(/path/to/img.bmp);}");

And it works.

Upvotes: 1

Related Questions