Use requestUpdate in QOpenGL and RasterWindow
Change-Id: Ibed4b8d2e2185f1bcf3430932701f81577b59408 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This commit is contained in:
parent
1f040d401d
commit
7069ebd1f6
@ -76,7 +76,7 @@ void QPaintDeviceWindow::update(const QRect &rect)
|
|||||||
{
|
{
|
||||||
Q_D(QPaintDeviceWindow);
|
Q_D(QPaintDeviceWindow);
|
||||||
d->dirtyRegion += rect;
|
d->dirtyRegion += rect;
|
||||||
d->triggerUpdate();
|
requestUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -89,7 +89,7 @@ void QPaintDeviceWindow::update(const QRegion ®ion)
|
|||||||
{
|
{
|
||||||
Q_D(QPaintDeviceWindow);
|
Q_D(QPaintDeviceWindow);
|
||||||
d->dirtyRegion += region;
|
d->dirtyRegion += region;
|
||||||
d->triggerUpdate();
|
requestUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -179,7 +179,6 @@ bool QPaintDeviceWindow::event(QEvent *event)
|
|||||||
Q_D(QPaintDeviceWindow);
|
Q_D(QPaintDeviceWindow);
|
||||||
|
|
||||||
if (event->type() == QEvent::UpdateRequest) {
|
if (event->type() == QEvent::UpdateRequest) {
|
||||||
d->paintEventSent = false;
|
|
||||||
if (handle()) // platform window may be gone when the window is closed during app exit
|
if (handle()) // platform window may be gone when the window is closed during app exit
|
||||||
d->handleUpdateEvent();
|
d->handleUpdateEvent();
|
||||||
return true;
|
return true;
|
||||||
|
@ -46,8 +46,6 @@ class Q_GUI_EXPORT QPaintDeviceWindowPrivate : public QWindowPrivate
|
|||||||
Q_DECLARE_PUBLIC(QPaintDeviceWindow)
|
Q_DECLARE_PUBLIC(QPaintDeviceWindow)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QPaintDeviceWindowPrivate() : paintEventSent(false) { }
|
|
||||||
|
|
||||||
virtual void beginPaint(const QRegion ®ion)
|
virtual void beginPaint(const QRegion ®ion)
|
||||||
{
|
{
|
||||||
Q_UNUSED(region);
|
Q_UNUSED(region);
|
||||||
@ -82,15 +80,6 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void triggerUpdate()
|
|
||||||
{
|
|
||||||
Q_Q(QPaintDeviceWindow);
|
|
||||||
if (!paintEventSent) {
|
|
||||||
QCoreApplication::postEvent(q, new QEvent(QEvent::UpdateRequest));
|
|
||||||
paintEventSent = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void doFlush(const QRegion ®ion)
|
void doFlush(const QRegion ®ion)
|
||||||
{
|
{
|
||||||
QRegion toFlush = region;
|
QRegion toFlush = region;
|
||||||
@ -113,7 +102,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QRegion dirtyRegion;
|
QRegion dirtyRegion;
|
||||||
bool paintEventSent;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user