avoid view sync more than every 150 msecs, avoids cpu hogging and displaying garbage
BUG:206946 svn path=/trunk/KDE/kdelibs/; revision=1062972
This commit is contained in:
parent
4a708b9351
commit
8e967abc2d
@ -95,6 +95,7 @@ public:
|
||||
QMap<Dialog::ResizeCorner, QRect> resizeAreas;
|
||||
int resizeStartCorner;
|
||||
QTimer *moveTimer;
|
||||
QTimer *adjustViewTimer;
|
||||
Plasma::AspectRatioMode aspectRatioMode;
|
||||
};
|
||||
|
||||
@ -280,6 +281,10 @@ Dialog::Dialog(QWidget *parent, Qt::WindowFlags f)
|
||||
pal.setColor(backgroundRole(), Qt::transparent);
|
||||
setPalette(pal);
|
||||
|
||||
d->adjustViewTimer = new QTimer(this);
|
||||
d->adjustViewTimer->setSingleShot(true);
|
||||
connect(d->adjustViewTimer, SIGNAL(timeout()), this, SLOT(adjustView()));
|
||||
|
||||
connect(d->background, SIGNAL(repaintNeeded()), this, SLOT(update()));
|
||||
|
||||
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(themeChanged()));
|
||||
@ -527,7 +532,7 @@ bool Dialog::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (d->resizeStartCorner == Dialog::NoCorner && watched == d->graphicsWidget &&
|
||||
(event->type() == QEvent::GraphicsSceneResize || event->type() == QEvent::GraphicsSceneMove)) {
|
||||
d->adjustView();
|
||||
d->adjustViewTimer->start(150);
|
||||
}
|
||||
|
||||
return QWidget::eventFilter(watched, event);
|
||||
|
Loading…
x
Reference in New Issue
Block a user