Resizing support in QWidgetWindow.

This commit is contained in:
Samuel Rødal 2011-05-02 10:36:39 +02:00
parent af77656f15
commit 5daea69f74
2 changed files with 22 additions and 0 deletions

View File

@ -63,6 +63,14 @@ bool QWidgetWindow::event(QEvent *event)
handleKeyEvent(static_cast<QKeyEvent *>(event));
return true;
case QEvent::Move:
handleMoveEvent(static_cast<QMoveEvent *>(event));
return true;
case QEvent::Resize:
handleResizeEvent(static_cast<QResizeEvent *>(event));
return true;
default:
break;
}
@ -96,4 +104,16 @@ void QWidgetWindow::handleKeyEvent(QKeyEvent *event)
QGuiApplication::sendSpontaneousEvent(widget, event);
}
void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
{
m_widget->data->crect = geometry();
QGuiApplication::sendSpontaneousEvent(m_widget, event);
}
void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
{
m_widget->data->crect = geometry();
QGuiApplication::sendSpontaneousEvent(m_widget, event);
}
QT_END_NAMESPACE

View File

@ -65,6 +65,8 @@ protected:
void handleMouseEvent(QMouseEvent *);
void handleKeyEvent(QKeyEvent *);
void handleMoveEvent(QMoveEvent *);
void handleResizeEvent(QResizeEvent *);
private:
QWidget *m_widget;