summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QPlatformIntegration: add new style hint: SetFocusOnTouchReleaseRichard Moe Gustavsen2013-06-251-3/+1
| | | | | | | | | | | | | | | | On desktop platforms, widgets have traditionally received focus on mouse press. On touch platforms (iOS, Android) this is different, there you need to delay setting the focus until a touch release (probably to check if the press starts a flick or tap'n'hold etc). This patch will add a new style hint SetFocusOnRelease that can be set by the plugin to control this behavior in Qt. Change-Id: I2e4d714894e327822c855eb48a3b28e354726e95 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Widgets: Propagate 'accepted'-state of touch begin events.Friedemann Kleint2013-04-121-1/+1
| | | | | | | Task-number: QTBUG-29946 Change-Id: Ia9ac54251f52b6ae4b3d667e49b96441def72a57 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Fix license headers stating QtGui for QtWidgets files.Jake Petroules2013-03-191-1/+1
| | | | | Change-Id: I0ca49e3e1f9f603f0b0f7f3553e854b871efe303 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement XEmbed protocolAlberto Mardegan2013-03-061-1/+2
| | | | | | | | | | | | | | | | | | | Add a static QWindow::fromWinId(WId id) constructor which can be used to create a QWindow object representing windows created by other processes. Then, QWindow::setParent() can be used to embed a window into a foreign window socket and QWindow::setTransientParent() to stick the current window on top of a foreign window. The changes in the QtWidgets module ensure that the focus chain (TAB navigation) correctly works when a QtWidgets-based window is embedded into another application. As far as the platform implementation is concerned, this commit only implements the embedding functionality in the XCB plugin. So, this is roughly equivalent to the Qt4 QX11EmbedWidget functionality. Change-Id: Iff8f7b9ee974d33fb30f36056f7838b433a413c7 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move session management code from QApplication to QGuiApplication.David Faure2012-11-281-7/+0
| | | | | | | | | | | | | | QSessionManager was already in QtGui, but not usable since the only API to get to it was still in QtWidgets. Session management isn't related to widgets, it also applies to QML apps on the desktop. The virtual commitData and saveState methods have been removed, given the two signals which exist since 4.2, and an additional isSessionSaving() method was added instead. Change-Id: I8099e70df133303e74456706827da21f013fcc6a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove QApplication::type() and make QCoreApplication::Type internalJ-P Nurmi2012-11-231-1/+1
| | | | | | | | | | | | These Qt3 legacy application types do not match the application types available in Qt5. Thus, the decision was to kill the confusing and mostly useless type enum. Use for example qobject_cast instead to find out the application type. Task-number: QTBUG-28093 Change-Id: Ia8cf7c3ea98a3cea27f74760d62e519ea10bce9f Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a QEnterEvent containing the mouse position.Friedemann Kleint2012-11-101-1/+1
| | | | | | | | | | | | | Enter handling requires knowledge of the mouse position. Extend the enter handling of QWindowSystemInterface to receive the position (implemented for Windows, XCB and Mac), passing it on to QEnterEvent. Dispatch QEnterEvent from widgets code. Change-Id: I49c07d2b1f46310c877017dd55d4cd7d636bdbce Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Revert "Implement automatic mouse grabbing on mouse button press."Friedemann Kleint2012-09-071-1/+0
| | | | | | | | | | | | | | | | This reverts commit 6b5bbc531b30d8ece25425e39843c6ae1af1d045. Autograbbing mouse shouldn't be done in crossplatform code, as X11 does this automatically. Windows needs platform specific solution. Task-number: QTBUG-26962 Task-number: QTBUG-27039 Task-number: QTBUG-23699 Change-Id: I911df92c4a34deb50b729f50681497046657948b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Revert "Move QWindowSystemInterface out of qpa."Paul Olav Tvete2012-08-031-2/+2
| | | | | | | | | | | | | | This reverts commit 784a877d3cd9a1a75aca9c83146389503a966071. Conflicts: src/plugins/platforms/cocoa/qcocoawindow.mm src/testlib/qtestkeyboard.h src/testlib/qtestmouse.h src/testlib/qtesttouch.h Change-Id: Iebfed179b3eb7f30e4c95edcae5a8ad6fd50330e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Propagate synthesized mouse events in parallel (lock-step) with touchKevin Ottens2012-07-241-0/+1
| | | | | | | | | | | | | | | | | | | | This patch implement the equivalent of 468626e99a90d6ac21cb311cde05c658ccb3b781 in qtdeclarative but for QtWidgets. If a widget doesn't accept a touch event, then QApplication gives it another try by synthesizing a corresponding mouse event. This way QtQuick and QtWidget behave in a similar way, removing the need for platform backends to try to emulate a mouse event from a touch event unconditionally. Also add relevant unit tests and adjust old QApplication ones. Change-Id: Iddbf6d756c4b52931a9d1c314b50d7a31dbcdee9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Move QWindowSystemInterface out of qpa.Stephen Kelly2012-07-191-2/+2
| | | | | | | | Public QtTest headers require it, so all unit tests would have to use private Qt headers otherwise, which is not practical. Change-Id: I5d4466ec30b6a57ebdfc34413e716e657eb51368 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Fix applicationName() being empty in QApplication.David Faure2012-07-161-1/+0
| | | | | | | | | | | | | | | A virtual method was reimplemented to return an always-empty string, probably a leftover from a refactoring. This fix showed that tst_qwidget_window was buggy: between Qt4 and Qt5, a "Before" became "After", which made "Before" unused, and was masking the fact that the app name was empty by default. In addition, the earlier Qt5 change that made the app name default to argv[0] now requires updating this test, now that it's actually working. Change-Id: I5360026821a9b95bedd0ff09dba3d51a22e542b7 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* Clear qt_button_down widget when starting a drag.Friedemann Kleint2012-07-111-0/+3
| | | | | | | | | Prevent pickMouseReceiver() from using the widget from which the drag was started. Task-number: QTBUG-26145 Change-Id: I65d4c295a894193e41c676fb9fd1f7113c2631b5 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Implement automatic mouse grabbing on mouse button press.Miikka Heikkinen2012-07-031-0/+1
| | | | | | | | | | | QWidget::grabMouse() documentation states that Qt automatically grabs the mouse when a button is pressed and ungrabs it when it is released. Implemented this functionality to make Qt5 behavior similar to Qt4. Task-number: QTBUG-25977 Change-Id: I17aa7e8190f4f5224ebc382d62970c86ae492bdb Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Suppress QWindowSystemInterface inclusion warnings.Girish Ramakrishnan2012-07-031-2/+2
| | | | | | | | | | | | | Since QWindowSystemInterface is now part of QPA API. The correct inclusion is: #include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface_p.h> Bulk of the work was done by: find . -type f | xargs sed -i -e 's,#include <\(QtGui/\)\?QWindowSystemInterface>,#include <qpa/qwindowsysteminterface.h>,g' Change-Id: If75fc32611e72ef1cf58505794def375b1acf74a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove references to Q_WS_QWSGirish Ramakrishnan2012-06-201-25/+0
| | | | | | | | | | | | | Affected code includes: src/widgets/dialogs/qmessagebox.cpp src/widgets/graphicsview/qgraphicsitem.cpp src/widgets/kernel/qapplication_p.h src/widgets/kernel/qwhatsthis.cpp src/widgets/kernel/qwidget.h src/widgets/widgets/qdockwidget.cpp Change-Id: Ib9e920b3cc1253b39e4e00d7137c21321ecc0399 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Send key events to pop-up widget in case there is one.Friedemann Kleint2012-06-131-1/+1
| | | | | | | | | | Make QApplicationPrivate::inPopupMode() static for convenience. Task-number: QTBUG-26095 Change-Id: I98dc1e40d357592b790cd51d7aca60c2be9f380f Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Dispatch tablet events to widgetsLaszlo Agocs2012-06-011-60/+0
| | | | | | | | Plus remove some platform-specific tablet leftovers from Qt4. Change-Id: I376abc38d1fe4c253d8803cf0ce007e2d6c298bf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QIcon: move back to QtGuiOlivier Goffart2012-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move the files and tests git mv src/widgets/kernel/qicon* qrc/gui/image/ git mv tests/auto/widgets/kernel/qicon/ tests/auto/gui/image/ - update the include of QIcon git grep -O"sed -i s,QtWidgets/qicon,QtGui/qicon," "QtWidgets/qicon" git grep -O"sed -i s,QtWidgets/QIcon,QtGui/QIcon," "QtWidgets/QIcon" - Adapt QIcon \ingroup documentation sed -i s/QtWidgets/QtGui/ src/gui/images/qicon* - Adapt export macro sed -i s/Q_WIDGETS_EXPORT/Q_GUI_EXPORT/g src/gui/image/qicon* - Update .pri and .pro files - Remove the use of QStyle::alignedRect by copying its content (and adapt slightly - Use QGuiApplication::palette() instead of QApplication::palette() - Add a hook in QGuiApplicationPrivate to call the QStyle::generatedIconPixmap() from QtWidgets Another commit follows to adjust QMetaType::Icon and move the QVariant and QMetaType icon handler back in QtGui Change-Id: I1b63759f892ebc02dfc30f41bb6e76e0b7451182 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* QPA: Add a themeHint for the animations.Friedemann Kleint2012-05-091-7/+1
| | | | | | | | | | | Introduce a flag matching the Qt::UI_Effect enumeration and return it as hint. Replace the separate boolean flags in QApplication by a single integer using the flags. Change-Id: I29e33d4d23d13723ddb1b3f62fe781b9c0747572 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Expose QPA API under qpa/*Girish Ramakrishnan2012-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main reasons for doing this are: 1. _qpa.h end up in the master QtGui include file. QtGui is meant for userland applications. qpa code is neither binary nor source compatible. Inadvertant use of QPA api makes the user code binary-incompatible. 2. syncqt creates forwarding headers for non-private header files. This gives people the impression that this is public API. As discussed on the mailing list, even though QPA api is internal and subject to change, it needs to treated differently from private headers since they will be used by in-qtbase and out-of-qtbase plugins. This commit does the following: 1. The _qpa in QPA header files is dropped. 2. syncqt now treats any file with qplatform prefix as a special file and moves it to qpa/ directory. The recommended way of using QPA API in plugins is: #include <qpa/qplatformfoo.h>. This allows the user include QPA API from multiple modules (for example, qplatformfoo might be in QtPrintSupport) 3. The user needs to explicitly add QT += <module>-private to get access to the qpa api. 4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo includes. This commit does not change the cpp filenames. This requires a more careful merging of existing non qpa cpp files and existing cpp files on a case by case basis. This can be done at anytime. The following files are not renamed as part of this changed but will be fixed as part of a future change: src/gui/kernel/qgenericpluginfactory_qpa.h src/gui/kernel/qgenericplugin_qpa.h src/gui/kernel/qwindowsysteminterface_qpa.h files were renamed using for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done includes were renamed using script for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include <qpa/\L\1.h>,g' \ -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include <qpa/\L\1_p.h>,g' \ -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include <qpa/\2\3>,g' \ -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include <qpa/\2\3>,g' \ $file done Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Windows: Fix warning about retrieving the handle from non-toplevels.Friedemann Kleint2012-04-271-2/+3
| | | | | Change-Id: I967f218c98309e77371717aa16e46995a767caa3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix compilation with Q_DECL_OVERRIDEOlivier Goffart2012-04-201-1/+1
| | | | | | | In C++11, the override keyword is placed after the function declaration Change-Id: I3a079860762f30fa21eb01611c770713f6ba4acb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Implement window modality in QtGuiBradley T. Hughes2012-04-111-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindow already has windowModality() and setWindowModality() as part of its API from commit 516f4e283ba4626d7239630397ef867ab0366071. Platform plugins can use this already to setup modality hints on windows that they create, but it's not enough to implement modality fully. QGuiApplication gets a modalWindow() static method, which is similar to QApplication::activeModalWidget() in that it returns the last modal window to be shown. The modal window "stack" moves from QApplicationPrivate to QGuiApplicationPrivate. The enterModal*() and leaveModal*() functions in QApplicationPrivate are removed and replaced by QGuiApplicationPrivate::showModalWindow() and hideModalWindow(), which are called by QWindow::setVisible() just before calling QPlatformWindow::setVisible(). The virtual QGuiApplicationPrivate::isWindowBlocked() will tell us if a window is blocked by a modal window (and tell which modal window for any interested callers). The default implementation works on the QWindow level. QApplicationPrivate reimplements isWindowBlocked() and adds popup and WA_GroupLeader support. QGuiApplication uses the state set from isWindowBlocked() to block user-input events: mouse press, mouse move, mouse release, wheel, key presses, key releases, enter/leave events, close events, and touch begin, update, and end events. Note also that the modality helper functions in QtWidgets and QApplicationPrivate are left in place and working as they always have. The behavior of QWidget in the presence of modal windows/dialogs should not change. Change-Id: I2c89e6026d40160387787a6e009ae1fdc12dfd69 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Fix some duplication between QGuiApplication and QApplication,David Faure2012-03-091-3/+0
| | | | | | | | | | | for the mouseButtons and keyboardModifiers vars and methods. Implement queryKeyboardModifiers with a new virtual in QPlatformIntegration. Task-number: QTBUG-11243 Change-Id: I9e95841542ac61c73ff72d7682ad962ea8aada42 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add fonts to QPlatformTheme.Friedemann Kleint2012-03-071-4/+2
| | | | | | | | | | | | | | | | - Remove QPlatformFontDatabase::defaultFonts() returning a hash containing widget name ->font and the Windows implementation. - Add enumeration and font accessor to QPlatformTheme. The value returned for the enumeration value overwrites the default font of the font database. - Implement for Windows, Mac and KDE. - Add more Windows palettes. Task-number: QTBUG-23686 Change-Id: I8a2abdfd216df23daa7c9630c54264cdf61295db Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Use QHash<K,V> instead of QMap<K,V> when K is a pointer typeGiuseppe D'Angelo2012-03-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes various internal usages of QMap when the key is a pointer type. Being ordered by the pointer value itself, it makes very little sense to use QMap<K*, V> (esp. in cases where the key is actually allocated on the heap). The usages have been found with the following script: #!/usr/bin/perl use strict; use warnings; use Regexp::Common; use File::Find; use feature ':5.10'; my $container = qr/(?:QMap)/; sub process { return unless (-f and -r and /(\.c|\.cpp|\.h|\.txt)$/); open my $fh, "<", $_ or die "Cannot open $_: $!"; while (my $line = <$fh>) { chomp $line; while ($line =~ /($container\s*$RE{balanced}{-parens=>"<>"})/g) { my $tmp = $1; $tmp =~ s/\s+//g; say "$_:$.: $line" if $tmp =~ /^$container\s*<[^,]+\*,/; } } close $fh; } find( { no_chdir => 1, wanted => \&process }, @ARGV ); Change-Id: Idd9819c3f4c48f98ef92831d5e8e5ac0fa42283c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Handle theme change in QApplication/QGuiApplication.Friedemann Kleint2012-02-231-1/+3
| | | | | | | Re-initialize palette and fonts. Change-Id: Ib312747886a31e8370f8d99536d52cbcf8afe8a4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Fix ref counted window close handling.Stephen Kelly2012-02-161-0/+2
| | | | | | | | | | Instead of refcounting QWindow visibility, we ask the Application subclass whether quitting is appropriate. Task-Id: QTBUG-24120 Change-Id: Idd19cc1a3e5742fddded89c7638aaaa5e47c568d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Move desktopSettingsAware to QGuiApplication.Friedemann Kleint2012-02-151-1/+0
| | | | | | | | | | | | For use by the QPA plugins. Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Morten Sørvig <morten.sorvig@nokia.com> Task-number: QTBUG-24204 Change-Id: I7f35274eedb55fcb60ad289768234bc302286d01 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Handle TouchCancel in gui and widgetsLaszlo Agocs2012-02-101-0/+1
| | | | | Change-Id: I31739840348d88ae408ac1aae2399f6328ccdd43 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Use Q_OS_WINCE instead of Q_WS_WINCEAndreas Holzammer2012-02-071-1/+1
| | | | | | | | | Window system defines have been deprecated, so use Q_OS_WINCE instead. Change-Id: I52059d0f854fe783ac20610ab248800c3e1e827c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove QInputContextPekka Vuorela2012-02-031-7/+0
| | | | | | | | | | This has only been around as compatibility interface for Qt4 but is now replaced by QPlatformInputContext. Change-Id: I677dbbea46311bf39f6c5ca9dc3fb5009abe924a Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add the event loop quitlock feature to QtCore.Stephen Kelly2012-01-311-2/+0
| | | | | | | | | | | | | | | | A feature of a ref-counted quit (managed by a quit-lock class) is added to both QEventLoop and QCoreApplication. This allows, for example, an event loop to quit() when there is no more work for it to do. quitOnLastWindowClosed is implemented in terms of the refcount in QCoreApplication so that jobs can be completed before the application quits. Change-Id: I14c8f4e7ee12bbf81a6e5849290d4c8ff37fa110 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Introduce QGuiApplicationPrivate::windowForWidget.Friedemann Kleint2012-01-251-3/+15
| | | | | | | Change getHWNDForWidget() to take a const QWidget *. Change-Id: I6b0d0bce70487304dfcd4e7a6a039fe8c7ca4aae Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove unused touch-related code in QApplicationPrivate headerLaszlo Agocs2012-01-091-156/+0
| | | | | | | | | For X11 and Windows the touch handling code lives in the platform plug-ins. The RX71 code is replaced by the generic evdev touch support provided by the touchscreen plug-in. Change-Id: I12c9fd3be8b466565cac7abebbb70805f1e28b5f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Removed QApplication::setInputContext()Pekka Vuorela2012-01-051-0/+4
| | | | | | | | Obsoleted by platform input context. Setting a custom QInputContext wouldn't work properly anymore. Change-Id: I966573a82fdd7530544878513a655eae7b3ad67b Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove declaration which is exported from QtGui.Stephen Kelly2011-12-191-1/+1
| | | | | | | Fixes static build. Change-Id: I6f82ded7bf6cb3b72b0ef987e781c7e8f9ed932b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove redundant touch processing in QtGui and widgets.Laszlo Agocs2011-12-141-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The duplicated hash tables in QGuiApplicationPrivate and QApplicationPrivate are now unified into one single hash table in QGuiApplicationPrivate. This also reduced the number of lookups. The extra processing needed to keep the touch points' first/lastPos values in sync is now done only once, in QGuiApplication. This eliminates the performance penalty (for widget-based apps) that was introduced during the QPA migration. As an added bonus the patch adds support for touch events arriving simultaenously from multiple devices. This was broken before: As there is no guarantee that two devices/drivers will not send touch points with the same ID, using structures with only the ID as key is wrong. The proper key is composed of the device ID (that is, a QTouchDevice pointer) and the touch point ID. The exported internal function qt_translateRawTouchEvent() has been removed. This function cannot work properly in the QPA world: It injected touches into the widget subsystem (QApplication) only which is wrong, and would result in half-filled touch events due to not routing the injected data through QGuiApplication. Autotests using this function are migrated to QWindowSystemInterface::handleTouchEvent(). Change-Id: I7632781d77f9e0ac4626fd7c9933511c94492156 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Extend touch events.Laszlo Agocs2011-12-091-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The capability flags indicate which information is valid in the touch points. Previously there was no way to tell if e.g. the value returned by pressure() is actually the value provided by the driver/device or it is just something bogus due to pressure not being supported. The points' flags return information about the individual touch points. One use case is to differentiate between touches made by finger and pen. Velocity, if available, is now also exposed. Each touch point can now contain an additional list of "raw" positions. These points are not reported individually but are taken into account in some way by the underlying device and drivers to generate the final, "accurate" touch point. In case the underlying drivers expose these additional positions, they are made available in the lists returned by the touch points' rawScreenPosition(). The raw positions are only available in screen coordinates to prevent wasting time with mapping from global positions in applications that do not use this data. Instead, apps can query the QWindow to which the touch event was sent via QTouchEvent::window() and can call mapFromGlobal() manually if they need local raw positions. The capability and device type information is now held in a new QTouchDevice class. Each touch event will contain only a pointer to one of the global QTouchDevice instances. On top of type and capability, the new class also contains a name which can be used to differentiate between multiple touch input devices (i.e. to tell from which one a given QTouchEvent originates from). The introduction of QTouchDevice has three implications: The QTouchEvent constructor and QWindowSystemInterface::handleTouchEvent need to be changed (to pass a QTouchDevice pointer instead of merely a device type value), and each platform or generic plug-in is now responsible for registering one or more devices using the new API QWindowSystemInterface::registerTouchDevice. Change-Id: Ic1468d3e43933d8b5691d75aa67c43e1bc7ffe3e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make input events work for widgets on waylandJørgen Lind2011-11-281-1/+1
| | | | | | | Wayland windows does not know about their position Change-Id: Ia37dd0fe6e33073eeeba22c88da9bd4bcad5421f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Move QScopedLoopLevelCounter to qthread_p.hBradley T. Hughes2011-11-241-12/+0
| | | | | | | | | | ... and use it in QCoreApplication::notifyInterna() instead of "reinventing" the wheel there. The constructor and destructor for QScopedLoopLevelCounter are inline, so the class does not need to be exported. Change-Id: I7af5a4ef0987f277bcc50c1057f3c74152f3d79d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Pass all key events through the shortcutmapLars Knoll2011-11-211-4/+0
| | | | | | | This has to happen in QGuiApp, not QApp. Change-Id: If8a6e81df3ae9b601733d077cce57d2d21572f74 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Prevent timestamps in widgets' touch events from disappearingLaszlo Agocs2011-11-041-1/+2
| | | | | Change-Id: I096914eb2b02ad9c4a5c0462a1f4b76ef17c3957 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Widgets: Remove Q_WS_QPA and qpa-sections from .pro files.Friedemann Kleint2011-10-211-27/+0
| | | | | | | | | | | | Enable compilation without -qpa. - Remove conditionals from Q_WS_QPA sections. - Rename precompiled header. - Remove gui-related Q_OS_SYMBIAN-#ifdef sections. - Leave other Q_WS code in for reference. Change-Id: I16326b631fff483aec8edd2f7a2e7a1822eab814 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>