summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformwindow_qpa.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-12-06 15:13:34 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-01-04 14:18:19 (GMT)
commit3753b15e88f2c8220b887f27be79491c4135a291 (patch)
tree9d8ceb094637b4270d61a57384a854e1d26d81d8 /src/gui/kernel/qplatformwindow_qpa.cpp
parentfc013b7be66a6d4fc13af8bd38b7e679ed3998af (diff)
downloadQt-3753b15e88f2c8220b887f27be79491c4135a291.zip
Qt-3753b15e88f2c8220b887f27be79491c4135a291.tar.gz
Qt-3753b15e88f2c8220b887f27be79491c4135a291.tar.bz2
Added window focus handling to lighthouse
The idea is that QPlatformWindows can request focus handling. And when actual focus shifting is done by windowsystem callbacks/events which are sent to QWindowSystemInterface
Diffstat (limited to 'src/gui/kernel/qplatformwindow_qpa.cpp')
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp
index 29eaa82..b6b6693 100644
--- a/src/gui/kernel/qplatformwindow_qpa.cpp
+++ b/src/gui/kernel/qplatformwindow_qpa.cpp
@@ -41,6 +41,7 @@
#include "qplatformwindow_qpa.h"
+#include <QtGui/qwindowsysteminterface_qpa.h>
#include <QtGui/qwidget.h>
class QPlatformWindowPrivate
@@ -171,6 +172,24 @@ void QPlatformWindow::setOpacity(qreal level)
}
/*!
+ Reimplement to let Qt be able to request activation/focus for a window
+
+ Some window systems will probably not have callbacks for this functionality,
+ and then calling QWindowSystemInterface::handleWindowActivated(QWidget *w)
+ would be sufficient.
+
+ If the window system has some event handling/callbacks then call
+ QWindowSystemInterface::handleWindowActivated(QWidget *w) when the window system
+ gives the notification.
+
+ Default implementation calls QWindowSystem::handleWindowActivated(QWidget *w)
+*/
+void QPlatformWindow::requestActivateWindow()
+{
+ QWindowSystemInterface::handleWindowActivated(widget());
+}
+
+/*!
Reimplement to return the glContext associated with the window.
*/
QPlatformGLContext *QPlatformWindow::glContext() const