summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-08-02 10:07:12 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2010-08-02 13:29:40 (GMT)
commit6e0edcce4c215f01416a5ee8467b7abe4665e592 (patch)
tree9f628f973a25a75a10d5010d6da42b941bc18bc8 /src/gui/kernel
parentda0d594f7d1b01145c5ec47f36d039435e04e7a5 (diff)
downloadQt-6e0edcce4c215f01416a5ee8467b7abe4665e592.zip
Qt-6e0edcce4c215f01416a5ee8467b7abe4665e592.tar.gz
Qt-6e0edcce4c215f01416a5ee8467b7abe4665e592.tar.bz2
Make openkode plugin handle events
And make it also work without a gui manager
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication_qpa.cpp3
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.cpp9
-rw-r--r--src/gui/kernel/qwidget_qpa.cpp3
3 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp
index e5b5396..b89e81d 100644
--- a/src/gui/kernel/qapplication_qpa.cpp
+++ b/src/gui/kernel/qapplication_qpa.cpp
@@ -802,6 +802,9 @@ void QApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEven
if (app_do_modal && !qt_try_modal(focusW, e->keyType))
return;
+ if (!focusW->isWindow())
+ focusW = focusW->window();
+
modifiers = e->modifiers;
QKeyEvent ev(e->keyType, e->key, e->modifiers, e->unicode, e->repeat, e->repeatCount);
QApplication::sendSpontaneousEvent(focusW, &ev);
diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp
index 4ac4736..9d722d8 100644
--- a/src/gui/kernel/qplatformwindow_qpa.cpp
+++ b/src/gui/kernel/qplatformwindow_qpa.cpp
@@ -47,6 +47,7 @@ class QPlatformWindowPrivate
{
QWidget *tlw;
QRect rect;
+ Qt::WindowFlags flags;
friend class QPlatformWindow;
};
@@ -92,8 +93,9 @@ Requests setting the window flags of this surface to \a type. Returns the actual
*/
Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags)
{
- Q_UNUSED(flags);
- return Qt::Window;
+ Q_D(QPlatformWindow);
+ d->flags = flags;
+ return flags;
}
/*!
@@ -101,7 +103,8 @@ Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags)
*/
Qt::WindowFlags QPlatformWindow::windowFlags() const
{
- return Qt::Window;
+ Q_D(const QPlatformWindow);
+ return d->flags;
}
WId QPlatformWindow::winId() const { return WId(0); }
diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp
index 3584f87..ef53004 100644
--- a/src/gui/kernel/qwidget_qpa.cpp
+++ b/src/gui/kernel/qwidget_qpa.cpp
@@ -63,6 +63,7 @@ void setParentForChildrenOfWidget(QPlatformWindow *window, const QWidget *widget
if (childWidget) { // should not be necessary
if (childWidget->platformWindow()) {
childWidget->platformWindow()->setParent(window);
+ childWidget->platformWindow()->setWindowFlags(Qt::SubWindow);
} else {
setParentForChildrenOfWidget(window,childWidget);
}
@@ -106,6 +107,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
if (QWidget *nativeParent = q->nativeParentWidget()) {
if (nativeParent->platformWindow()) {
platformWindow->setParent(nativeParent->platformWindow());
+ platformWindow->setWindowFlags(Qt::SubWindow);
}
}
@@ -174,6 +176,7 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f)
QWidget * parentWithWindow = newparent->platformWindow()? newparent : newparent->nativeParentWidget();
if (parentWithWindow && parentWithWindow->platformWindow()) {
q->platformWindow()->setParent(parentWithWindow->platformWindow());
+ q->platformWindow()->setWindowFlags(Qt::SubWindow);
}
}