summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
Commit message (Collapse)AuthorAgeFilesLines
...
* Added screenChanged() signal and handle screen destruction in QWindow.Samuel Rødal2011-11-292-2/+28
| | | | | | | | It can be useful to get a signal when the QScreen changes, for example when having bindings to QScreen properties in QML. Change-Id: I919dd12c656485b28b393aec5eedac4c01593afc Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Introduce QWindowSystemInterface::handleSynchronousCloseEventGunnar Sletta2011-11-252-0/+9
| | | | | | | | | | | | And use it from the Cocoa backend. In general, for threaded GL rendering to work, any function that affect the surface must be synchronous, so the implementor (such as QQuickCanvas) can pick it up and block until the GL context has released the surface. Otherwise, we will crash. Change-Id: Id8484dac7452fe96fa80ade4ea321145f32124b4 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fixed memory leak in windowing system event handlingGunnar Sletta2011-11-251-4/+4
| | | | | | | | processWindowSystemEvent does not delete the event, so allocate it on the stack instead. Change-Id: Iffda940ffc86ef1fabfbf101e08956fa07c49689 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add a note in the QScreen documentation about logical vs physical DPI.Samuel Rødal2011-11-241-0/+11
| | | | | Change-Id: I1d536711cbbc0ea8a21c6917e5e0066c1ad4ccae Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* emit width/height changes for the new rectGunnar Sletta2011-11-241-4/+4
| | | | | Change-Id: I789a45bc60aaa949d18e9fb72a186a259548ec1d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fixed regression in tst_qscreen.Samuel Rødal2011-11-231-1/+18
| | | | | | | | | The ScreenOrientation enum was changed so that the values are power of twos, angleBetween() needed to be fixed in order to reflect this. Task-number: QTBUG-22554 Change-Id: Ia45dd6643b40b14204abf967b00c0d04834736a3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Code cleanup in QVariant and QMetaType.Jędrzej Nowacki2011-11-221-148/+7
| | | | | | | | | QMetaTypeGuiHelper was generalized and renamed to QMetaTypeInterface. From now all types will have common interface which can be used for basic operations. Change-Id: I50d67f4a8081fa0f75c9d530a8211593ec37bc55 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add some properties to QWindowAlan Alpert2011-11-223-1/+72
| | | | | | | | x,y,width,height,visible and orientation Includes slot setters and notify signals for maximal QML compatibility. Change-Id: I124399093c00f8ad1485d4fbae816dfbe3027eff Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove handlesInputPanelVisibility() deprecation mechanismJoona Petrell2011-11-214-25/+4
| | | | | | | Task-number: QTBUG-21964 Change-Id: I508ba690c90369d31ca33390d3001064857fb62e Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Pass all key events through the shortcutmapLars Knoll2011-11-212-12/+20
| | | | | | | This has to happen in QGuiApp, not QApp. Change-Id: If8a6e81df3ae9b601733d077cce57d2d21572f74 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Get rid of unused inputMethodEvent functionJoona Petrell2011-11-212-6/+0
| | | | | | | | | In Qt5 input method events are meant to be sent directly to QInputPanel::inputItem() instead of the focused QWindow. Change-Id: Idc8fe458973f066b578f6374ca33ce6f950bf9cf Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* qtbase: Warnings fixes.Friedemann Kleint2011-11-181-1/+1
| | | | | Change-Id: Ie97e36bc168b3de3cae2d0eb615e777884529a06 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Call invalidateResource() on QOpenGLMultiGroupSharedResource-owned resourcesKent Hansen2011-11-172-0/+2
| | | | | | | | | Commit 202127f860208c21145e05685bc54219e1655dbd ensured that QOpenGLMultiGroupSharedResource-owned resources are deleted, but it was missing a call to invalidateResource(). Change-Id: I166ce8a7298772408081331fe1a91bd2cd88aebb Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Adding a "helper assert" for when you can create QWindowJørgen Lind2011-11-151-0/+5
| | | | | | | | maybe if your trying to instansiate a QWindow before the QApplication has been instansiated. Change-Id: I68ed4ad1dbdfedc242a7cb27c1381d50a3d3dfa4 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Hide QVariant helper classes in a namespace.Jędrzej Nowacki2011-11-151-0/+2
| | | | | | | | | Moving these classes to an unnamed namespace reduced chances of a name conflict and size of executable. GCC 4.6 in release mode produces a 5kB smaller binary. Change-Id: Ie1819a88180f9db1cd32cc59ea6fe268ecbd5813 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Ensure that QOpenGLMultiGroupSharedResources are cleaned upKent Hansen2011-11-152-23/+13
| | | | | | | | | | | | | | | | | When a GL context group is destroyed, all multi-group shared resources associated with the group should be cleaned up. Otherwise we could get a double deletion in the resource's destructor, because it still retained a pointer to the deleted group. The missing cleanup resulted in a crash when the global static qt_gl_functions_resource was destroyed, first seen in the tst_examples autotest in qtdeclarative. It possibly didn't manifest before because it's event loop-dependent (the contexts are deleted via deleteLater()). Change-Id: I6b1e0bfdfbbb2bff8e795f545e680fcdfa094768 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Document QPlatformInputContextPekka Vuorela2011-11-151-0/+84
| | | | | Change-Id: I8f7599ed1f03d29a11713c7a11ed5b61a17e3dfe Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Support 31 mouse buttons (with platform plugins xcb and xlib).Rick Stockton2011-11-141-4/+4
| | | | | | | | | | | | | This commit includes changes for mouse button support within the XCB and XLIB platform plugins. Support in other platform plugins will be added in the future. The namespace update is prerequisite to compile the the Plugins, and the update in qguiapplication.cpp is required for the enhancements to actually work. Task-number: QTBUG-22642 Change-Id: Ie18fca3b9c86d0b6abbf2103a4f8582e6ce83e7d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Factor out QPlatformTheme from QPlatformPlugin.Friedemann Kleint2011-11-1111-37/+520
| | | | | | | | | | | | | | | | | | Implement QCocoaPlatformTheme. The menus and dialog API is moved from the platform to the theme plugin. (Both APIs contain references to QtWidget classes, which we are working towards removing.) The theme plugin is created after the platform plugin, first by asking the platform plugin, then by looking for a separate plugin if the platform does not specify a theme. Initial-patch-by: Morten Sorvig <msorvig@trolltech.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Change-Id: I2778cdd3a205c4ce35ead93e39fe6b4cd58a39f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Document QInputPanel APIJoona Petrell2011-11-111-0/+122
| | | | | | Change-Id: Ie64215529139e18a0a575e149289b6fa9a699a69 Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Document QInputMethodQueryEvent classPekka Vuorela2011-11-102-10/+28
| | | | | Change-Id: I6e98f9e690b733a06ee165e5b01ab6a5a784791b Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add QPolygonF to metatype system.Jędrzej Nowacki2011-11-091-2/+4
| | | | | | | | That was strange that QPolygon was know to QMetaType class but QPolygonF not. Change-Id: I67bb99644b8b1d0fe1aec730619d8048cb78219b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make usage of internal QVariant space.Jędrzej Nowacki2011-11-091-305/+142
| | | | | | | | | | | | | | | | | | | | | | Each QVariant instance has internal storage which may be used for well-know basic types. This patch changes the behavior by delegating type dependent operation to QMetaType class which knows more types than QVariant itself. The patch significantly reduce amount of code in QVariant implementation. There are few side effects of this patch: - better performance: * for Core types when using Gui (QGuiVariant is able to construct Core types) * for small custom types (QVariant::Private::Data is used for all types that has size small enough) - comparing two QVariants can give different result for small custom types (binary comparison instead of pointer comparison) Change-Id: Ic17fa500d6a882110bfba896fd456c8e6c7a63a9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Support tentative commit string with input method.Pekka Vuorela2011-11-052-0/+22
| | | | | | | | | Tentative commit string allows input method to notify editor what is expected to be committed in the place of preedit. This commit adds such support in QLineEdit. Change-Id: If855619bc6843652db0d6254f7e7063bb8ad0936 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add Q_PROPERTY declarations to QScreen.Samuel Rødal2011-11-012-19/+62
| | | | | | | | This means we can expose the API to QML in a simple way. Change-Id: Ibc36711071d288ed78ce833a64d6be2f22fc4b62 Reviewed-by: Leonardo Sobral Cunha <leo.cunha@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Re-added hellogl_es and ES 1 support for QOpenGLContext.Samuel Rødal2011-10-311-2/+6
| | | | | Change-Id: I576cf3595cdeeefb4ed840bb3b2b7097b3609cc7 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Gui/OpenGL: Remove remains of qpa from profiles.Friedemann Kleint2011-10-311-52/+46
| | | | | Change-Id: Iff2531a19030bd782ee4cd9bbe529d18666503f9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix most warnings about assignments of QAtomicInt.Friedemann Kleint2011-10-313-7/+4
| | | | | Change-Id: Ide409d72d2637b68ec2a85aaca4bc783a7e911e7 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Replace implicit QAtomic* casts with explicit load()/store()Bradley T. Hughes2011-10-275-22/+22
| | | | | Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix compiler warnings.Friedemann Kleint2011-10-272-6/+9
| | | | | | | | - Fix gcc 4.6.X warnings about assigned but unused variables - Remove trailing ';' from inline functions (Clang) Change-Id: I8670afd6b149748a740f22c65de137762e9f18e1 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Do not call setCursor on Desktop or if there is no platform window.Friedemann Kleint2011-10-271-4/+10
| | | | | | | Fix a crash on Windows. Change-Id: I2b88e113d7149444ebc8946c0ee0eba7a9b5bbc2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Native file dialog support for MacMorten Sorvig2011-10-272-0/+16
| | | | | | | | | | * New API: QPlatformDialogHelper to support native dialog on QPA. (Currently, It supports only file dialog.) * Modify QDialog* and QFileDialog* to support native dialog. * Add native file dialog support to cocoa platform plugin. Change-Id: I957f046748a27a33fd9f8af3c525feabd1b0f582 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Fix spellingMorten Sorvig2011-10-261-2/+2
| | | | | Change-Id: If9630ffa3a1c411b2e56b41ed35c272177343274 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* QtGui: Remove Q_WS and qpa.Friedemann Kleint2011-10-252-64/+2
| | | | | | | | | Enable compilation without -qpa. Remove QT_NO_FREETYPE and QT_NO_FONTCONFIG when building. Change-Id: I0e017cc47ee06b885be65deaeb67a449a119b8be Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QWindow: Re-create platform window only if screen actually changes.Friedemann Kleint2011-10-221-6/+10
| | | | | Change-Id: I3b7dd8b1307aa3cc9357dca861ea407644c5a2e9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add virtual QWindow::focusObject() methodLars Knoll2011-10-222-0/+10
| | | | | | | | | | The method allows to retrieve the object that currently has the input focus inside the Window. This is e.g. required to correctly determine the context for keyboard shortcuts. Change-Id: I9e05ef62717973bac275ce34cc70fb86aa2d1e5b Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix two typos: docu for "deprecated since" and Q_DEPR... -> QT_DEPR...David Faure2011-10-221-1/+1
| | | | | | | | Shows that there should be an automated build with QT_DISABLE_DEPRECATED_BEFORE set to 0, too... Change-Id: If154786ea26bcbfab41efcd7001c222cc258a8af Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Fix compiler warnings when using QT_DEPRECATEDSergio Ahumada2011-10-211-0/+2
| | | | | Change-Id: If62cff5d1cbd1c8051d709db8747777606797056 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix some compiler warnings on MacSergio Ahumada2011-10-211-0/+2
| | | | | Change-Id: I52b5c1822f9530f75eeebfcafbade6f89062e369 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Provide API for "placement new" construction of meta-typesKent Hansen2011-10-191-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By making it possible to specify the place in memory where a type should be constructed, any meta-type can be allocated on the stack, for example. In the QML/JS QObject binding, this makes it possible to call slots and access properties from JavaScript without having to perform any mallocs (e.g. due to QVariant creation) in the C++ <--> JS value conversion, in the best case. In addition to QMetaType::construct() and QMetaType::destruct(), this change introduces QMetaType::typeSize(), which returns the size of a type in bytes. This can be used to prepare a suitable buffer for constructing a type using construct(). Benchmarks indicate that in-place construction is 2-5x faster than normal construction for core and GUI types on linux-g++. Note that there is already a QMetaType::construct() function in Qt 4, which has been renamed to QMetaType::create() in Qt 5. In order to avoid existing usages of construct() in user code to call the Qt 5 construct() (when they really meant to call create()), the third argument ("copy") of construct() is made mandatory. Hence, calls to QMetaType::construct() written for Qt 4 will cause a compile error when compiled with Qt 5, and the user must adapt his code. Task-number: QTBUG-12574 Change-Id: I836f06f6ee1c1c3edbd199a03424c78c942bdd3e Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Destroy generic plugins on exit.Laszlo Agocs2011-10-192-0/+9
| | | | | Change-Id: I9037cabae74f9a7d8743630d0f530aaa1593266f Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* QSurfaceFormat: Use version in comparison and debug, fix setter.Friedemann Kleint2011-10-181-5/+13
| | | | | Change-Id: Id123ca9366b97a172e08a4608ccdffafb7caaf09 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Make some more methods privateLars Knoll2011-10-181-9/+7
| | | | | Change-Id: I0644ee287201866596dccd96e443e7e62fd89360 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Move QShortcutMap to QtGuiLars Knoll2011-10-183-0/+814
| | | | | | | | | QShortcut stays in QtWidgets, what we need in QtGui is only the basic functionality of the shortcut map. QML can integrate directly with the map where required. Change-Id: Ie39e9242f24cbebf824e5c3d2926880325ea4187 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Do not call swapBuffers when surfaceHandle is NULL.Laszlo Agocs2011-10-181-1/+3
| | | | | | | | | | Calling swapBuffers with the surfaceHandle of 0 returned by QWindow during application exit causes a crash when using GLX. The patch avoids swapBuffer calls to platformGLContext when there is no surface handle anymore. Change-Id: I09c5bbafd4e7af6648ca54a58ed0267d0a2f343d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove stale documentation.Casper van Donderen2011-10-184-6/+6
| | | | | Change-Id: I85139e0334b648bee0d18129cef9387dcc6c3222 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Fix TouchPoint::lastPos() after TouchPointStationary only events.Jocelyn Turcotte2011-10-171-1/+5
| | | | | | | | | | | | | | | | | lastPos is copied from the last point's position, and the position has to be resolved according the the receiving item's transformation. However, if a QTouchEvent contains only stationary points, it won't be delivered, it's pos()/rect() will still be uninitialized, and the touch point of the next event will be delivered with the uninitialized pos() as it's lastPos(). This patch makes sure that the lastPos() won't be filled with a previous incomplete stationary point state even if the platform is sending us stationary-point-only touch events. Change-Id: Ia7d10423c8fbe78348edbb0a89fbfa66d1b8b5d1 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Use a QFunctionPointer for getProcAddress()Casper van Donderen2011-10-172-10/+3
| | | | | | | | qdoc does not understand the void (*) syntax, there is a typedef to QFunctionPointer that does work. Change-Id: Idbe9d43d00f8676304d088d72795b6ddb7e4ee72 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Avoid using 0 as the default winId in QPlatformWindow.Laszlo Agocs2011-10-141-1/+8
| | | | | | | | | | | | | | | | | | | When the platform plugin does not reimplement QPlatformWindow::winId() to return a non-zero value, the default implementation provides a WId of 0. This breaks various scenarios with QWidgets which, for example in nativeParentWidget(), rely on internalWinId() being non-zero for TLWs. As a result, apps like collidingmice will crash with the 'minimal' platform plugin when they try to do markDirtyOnScreen for the graphics view's viewport widget because viewport()->nativeParentWidget() unexpectedly returns null, even though it should return the QGraphicsView. The patch makes the default value WId(1) in order to to avoid this. Change-Id: Iafef2e510e32b5610b8cef742313e9119ed64963 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Accessibility plugin for mac and xcb.Frederik Gladhorn2011-10-141-1/+1
| | | | | | | | | | Instead of creating new instances of the class whenever accessibility() is called, create one on startup. Change-Id: Idd5b06ee935d7acf4934b98882d254a1ef0ca04e Reviewed-on: http://codereview.qt-project.org/6435 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>