summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget_qpa.cpp
Commit message (Collapse)AuthorAgeFilesLines
* qpa: Merge qwidget_qpa.cpp into qwidget.cppTor Arne Vestbø2014-05-151-1122/+0
| | | | | Change-Id: I8424ec7290b366f4c76999a956fce1428fc56626 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Forward "_q_platform_*" QWidgets's properties to QWindow.Tomasz Olszak2014-04-091-0/+5
| | | | | | | | | | | This way we can customize QPlatformWindow by using dynamic "_q_platform_" properties in corresponding QWindow. Change-Id: I987b7a17d252541fe766af6aa37a6cffb67f1807 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Improve QWidget::metric for PdmDevicePixelRatio.Morten Johan Sørvig2014-04-051-6/+9
| | | | | | | | | | | | | | Use QWindow::devicePixelRatio() which is the most accurate devicePixelRatio accessor since it can ask the platform native window directly Fall back to qApp->devicePixelRatio() if the window pointer is not valid. Task-number: QTBUG-37606 Task-number: QTBUG-38078 Change-Id: Ief1468a0c6ced07439f55329ab056883016241cc Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Delete the OpenGL context before the window.Morten Johan Sørvig2014-03-201-4/+2
| | | | | | | | Fix a crash-on-exit on Mac, where deleting the context references the attached NSView. Change-Id: Iac38184dab7a406e4072452fd9a6b175e6968ade Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* QQuickWidget: fix crash on exitPaul Olav Tvete2014-03-131-1/+12
| | | | | | | | | | Make sure that the correct context is current when freeing GL resources. Otherwise, on shutdown, QOpenGLVertexArrayObject would try to use the previously current context, which mmay already have been deleted. Task-number: QTBUG-37385 Change-Id: Ib2332f54636738a1a4b1041a7dcbffd0af00261d Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QQuickWidget move/resize fixPaul Olav Tvete2014-03-131-2/+7
| | | | | | | | | | Make sure the alphamask in the backingstore is updated whenever the geometry of a QQuickWidget/QOpenGLWidget child changes. Task-number: QTBUG-37372 Change-Id: I70e94664bd7da774694645f604e1a7277fe563c7 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
* Destroy backingstore before windowPaul Olav Tvete2014-03-081-4/+6
| | | | | | | | | | | | The window is created before the backingstore, so the destruction should happen in the reverse order. Also, the backingstore is created based on a pointer to a QWindow, so the dependency is from backingstore to window. Thirdly, this fixes a crash when using QQuickWidget/QOpenGLWidget. Task-number: QTBUG-37045 Change-Id: I6e782c553fddfeef877be30ca2610aff75a425a0 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix issue where revealed widget children do not receive paint event.Chris Colbert2014-03-041-11/+0
| | | | | | | | | | | | | | | | | | | | When a child of a widget is spontaneously revealed due to a call to the parent 'resize' method, the child will not receive a paint event if it has the WA_StaticContents and WA_OpaquePaintEvent flags set. This is caused by the backing store being pre-emptively resized by the call to setGeometry_sys, which causes QWidgetBackingStore::sync to skip the block which handles the static contents. There doesn't appear to be any reason to preemptively resize the backing store, since it is always resized as-needed during the the 'sync' method. This change-set removes the code which preemptively resizes the backing store. Task-number: QTBUG-35282 Change-Id: Ie9942854ca5322dfe0f98ed8100810161576be80 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QQuickWidget show/hide/raise fixPaul Olav Tvete2014-03-011-2/+13
| | | | | | | | | Make sure the alphamask in the backingstore is updated whenever the state of a QQuickWidget/QOpenGLWidget child changes. Task-number: QTBUG-37062 Change-Id: Iffa80fc8993499a15bc9e773a162a3f98b81ae03 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Enabling QQuickWidget and QOpenGLWidgetPaul Olav Tvete2014-02-121-0/+5
| | | | | | | | | Enable child widgets (without a native window) that render to an FBO and are composed with the raster backingstore by the platform plugin. A preliminary version of QOpenGLWidget is included as private API. Change-Id: I8f984a4d7db285069ce3d6564707942c823d890d Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Doc: fix documentation for QWidget::windowHandle.David Faure2014-02-051-2/+8
| | | | | | | | | It's not "preliminary" anymore, and it doesn't return a QPlatformWindow, but a QWindow. Change-Id: Iaa1938728e689d97011dce8cf0d88ff8cb4a83b9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Fixed duplicate QMoveEvent generated for each QWidget::move callAlex Montgomery2014-02-031-1/+4
| | | | | | | | | | Removed QMoveEvent generating code from QWidgetPrivate::setGeometry_sys for widgets with native window handles. A move event is already generated for them by QGuiApplicationPrivate::processGeometryChangeEvent. Task-number: QTBUG-32590 Change-Id: I73313a012851516047ac017f1e15a21774d8ffe2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix bug on X11 with WA_TranslucentBackground and native child windows.Gatis Paeglis2014-01-101-3/+4
| | | | | | | | | | | | | | | | | | | | The native child windows need to inherit the parent's visual in order to have a translucent background as well. Surface with type QSurface::OpenGLSurface should not be forced to use the parent window's visual - the parent visual for instance, might not even be GL capable. Changing WA_TranslucentBackground during runtime is not supported, for two reasons: 1) Other platform plugins seem not to support it 2) It would require recreating X windows. Task-number: QTBUG-29625 Change-Id: Ic1474dd2de99069027481c7db6bf865f9b8d616d Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Avoid crash due to accessing deleted QWidgetWindow objectJian Liang2013-12-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change childWidget->windowHandle() to childWidget->internalWinId() in q_createNativeChildrenAndSetParent() to determine whether should we call childWidget->winId(). This is because in some circumstances Qt will crash due to accessing deleted QWidgetWindow object if we use windowHandle(). Think about the following scenario: 1) create a widget A without parent and add two child widgets B and C to A 2) create a native widget D as the child of B, note that when we set Qt::WA_NativeWindow attribute to it, its QWidgetWindow will be created which means its windowHandle() is not null. 3) create a top level widget E as the child of C and show it. This will make Qt call createWinId() to A and then q_createNativeChildrenAndSetParent() will be called to create A's native children recursively and finally make D's QWidgetWindow object become a child of A's QWidgetWindow object. Please note here that B will not become a native widget just because at that moment windowHandle() of D is not null and Qt will not call winId() to its parent B 4) Set A's parent to another widget which has been shown, setParent_sys() will be called to A and then Qt will call destroy() to A. in destroy() Qt will try to call destroy() to its children recursively with a condition that the child has Qt::WA_NativeWindow been set. But D's parent B is not a native widget right now so B and D is not destroyed. Qt will then deleted the QWidgetWindow object of A, since E's QWidgetWindow object is a child of A's QWidgetWindow object, it will also be deleted. Now E hold a deleted pointer of QWidgetWindow object. This is the source of crash later. Task-number: QTBUG-35600 Change-Id: I97a20a68e626ee62b15bb4eae580e26f8948923b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix QBackingStore object leakingLiang Jian2013-12-161-3/+5
| | | | | | | | | | Check q->isTopLevel() before calling setBackingStore() in QWidgetPrivate::create_sys() to prevent QBackingStore leaking. This is because QWidget::setBackingStore() will return if isTopLevel() is true and the newly created QBackingStore object will be leaked. Change-Id: I2777acd4c317d5019f5b266feae005042026b8be Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Revert "Ensure Qt::WA_Mapped is set in case of obscured native windows."Tor Arne Vestbø2013-11-211-1/+1
| | | | | | | | | | | | | Qt::WA_Mapped maps (sic) to windowHandle()->isExposed(), and we set/update it in QWidgetWindow::handleExposeEvent(). Setting it directly in show_sys shortcuts QPA and assumes showing a window is synchronous on all platforms, resulting in trying to flush the widget backingstore when the window was not exposed yet (due to discardSyncRequest starting to return false). This reverts commit 829b1d13b225e87b8a385397e2b53c7a9f8cda9e. Change-Id: I0bd700d4939bc69ba184d8586435b68ec3dd72fb Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix crash when windowcontainer is used in a dockwidgetGunnar Sletta2013-11-201-1/+5
| | | | | | | | | | | | | The dockwidget's toplevel window would be a parent of the container's window when floating. When plugged back into the mainwindow the dockwidget's window is destroyed and the container's window along with it. Added a function toplevelAboutToBeDestroyed to unparent the containers window before this happens so parentWasChanged will work correctly. Change-Id: I06679cfb3a8fa3834c0db0be5973c012b8277275 Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Ensure Qt::WA_Mapped is set in case of obscured native windows.Friedemann Kleint2013-11-201-1/+1
| | | | | | | | Task-number: QTBUG-33520 Change-Id: I51f9b4634be29fd32f4ad9cc8b5d3e10b19ea2f5 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Add a WindowManagement capability to QPlatformIntegrationLaszlo Agocs2013-09-201-2/+4
| | | | | | | | | | | | | To be set to false by eglfs and similar platforms where no real window management is provided. When this capability is not set, some of the changes done for QTBUG-26903 will be disabled, allowing dialogs to show up at their QDialog-chosen place on platforms where no WM is present and so windows are never repositioned by the system. Change-Id: If1dac3cd11f2a856913a51277431fe3ec644b719 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Move winId!=0 assertion from QWindow to QWidgetAndrew Knight2013-09-091-1/+4
| | | | | | | | | | | | | | | In "very basic platform plugins", the platform window ID can be null, which conflicts with QWidget's special treatment of 0 as a parented widget. Such is the case with EGLFS, which can return a null native window handle for winId on some EGL implementations. Move the assertion winId!=0 into the widget framework, as this assert is not relevant for non-widget applications. A large proportion of basic platform plugin users will see relief from this unnecessary assertion. Change-Id: I25c9d96550cd747c77c9516d773e9cdebf7440ab Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* QWidget: Apply window opacity set before show.Friedemann Kleint2013-08-211-0/+2
| | | | | | | Task-number: QTBUG-33078 Change-Id: Id9111f223a9dc58c88b072c52e36d42db450573a Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Windows/ActiveQt: Pass native parent handle property from widget to widget ↵Friedemann Kleint2013-07-111-0/+8
| | | | | | | | | | | window. Task-number: QTBUG-31672 Task-number: QTBUG-32343 Change-Id: I6b1eca13248da06db739b1a8356a0259f7f4ae6c Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Widgets: Do not create QWindow in createTLExtra().Friedemann Kleint2013-06-141-3/+1
| | | | | | | | | | | | QWidget::setWindowIcon() and similar call createTLExtra() which creates a QWindow without setting the native attributes on the parent, which can cause crashes when setParent_sys() decides to delete the window. Task-number: QTBUG-31672 Change-Id: I4c40ee12741be88b2281df90329ffb698d4009eb Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Fixed crash associated with reparenting a QGLWidgetSamuel Rødal2013-05-221-3/+1
| | | | | | | | | | | | | | | We need to make sure that we don't reset() the context when the QGLWidget is being reparented, as that will lead to the QOpenGLContext being destroyed and not recreated, leading to a crash in makeCurrent(). Also, don't destroy() the widget if it has not yet been created, as in that case there's no ParentAboutToChange event sent. Task-number: QTBUG-31016 Change-Id: I409fff94456802a80bd72b470a6fbaee87505baa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Enable non-client-area mouse events by default for widgets.Friedemann Kleint2013-05-071-0/+3
| | | | | | | | Task-number: QTBUG-30530 Task-number: QTBUG-29012 Change-Id: Iaddbb89bbb198e2b04419407e0871951650552ce Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Set geometry set by QPlatformWindow::initialGeometry() on widget.Friedemann Kleint2013-05-071-0/+7
| | | | | | | Task-number: QTBUG-30855 Change-Id: I15f3dfa0b493874671711cce2190d0710b368796 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix crash when deleting a QMenu on exitGabriel de Dietrich2013-04-231-1/+1
| | | | | | | | | If the application object is an ancestor of QMenu, dereferencing qApp in its destructor will cause a crash. Task-number: QTBUG-30756 Change-Id: I31a33db0fd783bb210a420618911ea8b412e9a0f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Android: Don't crash when displaying multiple top-levelsEskil Abrahamsen Blomfeldt2013-04-181-1/+12
| | | | | | | | | | | | | | | | | | | | | | While the raster platform plugin supports multiple top level windows, this is not supported on the GL plugin, so if you use GL or QtQuick2 in your app and use several top levels, the app would crash with an error message. A problem is that the top-level SurfaceView is a special overlay View and does not support being stacked in a layout. So instead, we let all windows share the same GL surface and draw on top of each other. This works fine for simple use cases. We implement a new platform capability to make sure no top level windows (even combobox popups and dialogs) get non-fullscreen geometries. That has never worked properly with the eglfs plugin. Task-number: QTBUG-30473 Change-Id: Ia1438019638fc739cc93ffe79b46b81631254df2 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Add devicePixelRatio metric to QPaintDevice.Morten Johan Sørvig2013-04-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously QPainter computed the devicePixelRatio based on the physical and logical dpi, and expected that the ratio between them would be either 1x or 2x. This was problematic for paint devices like printers where the physical dpi can be much higher than the logical dpi, and also for QScreen where the physical dpi would have to be defined as a multiple of the logical dpi. Add QPaintDevice::PdmDevicePixelRatio and QPaintDevice:: devicePixelRatio() getter and implement it for the QPaintDevice subclasses. Use it when calculating the highdpi scale transform in qpainter.cpp and when scaling the clip rect in qwidget.cpp. Remove physical dpi scaling for QImage, QPixmap and QOpenGLPaintDevice, reverting to the old behavior. Change-Id: I6c97510613196d4536ff39d08e9750b8782283d4 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@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>
* Windows: Fix drop shadows for widget tool tips.Friedemann Kleint2013-03-181-0/+5
| | | | | | | Change-Id: Ifacee152e291face69964471d75e92b7784be4a4 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-03-051-19/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/generators/mac/pbuilder_pbx.cpp src/corelib/kernel/qtimerinfo_unix.cpp src/plugins/platforms/cocoa/qcocoabackingstore.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
| * Transient QWindows centered; default-constructed geometryShawn Rutledge2013-02-241-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default-constructed geometry does not mean put the window at 0,0, and it does not mean center the window on the screen: it means let the window manager position the window. If the window is explicitly positioned at 0,0 though, that is a higher priority than the transient hint; without this change, the transientFor property had no effect. On X11, transient means use center "gravity" to make the transient window exactly centered. But the user can still override the geometry of a transient window, as with any window. On OSX and Windows, neither transient window functionality nor smart initial positioning are provided, so a window with no position set will be centered on the screen, and a transient window will be put at the center of its transientParent. Change-Id: I4f5e37480eef5d105e45ffd60362a57f13ec55f5 Task-number: QTBUG-26903 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Regression: Fix setting of custom cursors for native widgets.Friedemann Kleint2013-01-211-2/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | Currently, there is no concept of not having a cursor set on a Window. Qt::ArrowCursor is always set instead. This causes bugs when native child widgets are involved, for example setting a cursor on the native widget's parent no longer works since the child's Qt::ArrowCursor applies. Introduce QWindowPrivate::hasCursor tracking whether a cursor has been explicitly set and clear in QWindow::unsetCursor(). Handle 0 in QPlatformCursor::changeCursor() to mean "unsetCursor()": - Windows: Introduce default constructor for QWindowsWindowCursor meaning "0". Search for applicable parent cursor in applyCursor. - XCB: No big changes required, set XCB_CURSOR_NONE for no cursor. - Other platforms: Assume Qt::ArrowCursor when cursor = 0 is passed for now. Task-number: QTBUG-28879 Change-Id: Id82722592f3cd5fe577a5b64dcc600c85cfea484 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* QPA: update backingstore also when moving QWindowsRichard Moe Gustavsen2012-11-301-1/+3
| | | | | | | | | | | | | When moving QMdiSubWindows that contains native widgets (e.g QGLWidget) inside a QMdiArea, garbage is drawn to the screen. The reason is that since we use native QWindow backed widgets, QPA will assume that it does not need to update/scroll the backingstore. But since the backingstore can be shared among several windows, we need to do this to ensure that exposed areas behind the moved QWindow will be updated. Change-Id: I35f4d4069a73ab6cd6d610e25c176c752789a927 Task-number: QTBUG-26162 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Do not hide fullscreen widgets having a 0x0 geometryOliver Wolff2012-11-221-1/+1
| | | | | | | | | | | | It is possible that the widget which is to be shown full screen has a 0x0 geometry if an empty layout with 0 margin is set there. In that case the widget should not be hidden. Task-number: QTBUG-27602 Change-Id: I87fd20cc3a5bac89ceccdf639780c4bc721ce860 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Rename all QWindow properties that have "window" in themShawn Rutledge2012-11-071-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | windowTitle, windowModality, windowIcon and so on are named that way to be similar to the ones in QWidget. However QQuickWindow inherits all of the declared properties, and we would like to have shorter property names in QML. If you are working with a Window then it's obvious the title property is the window title. Unfortunately, there must be patches in many other modules which depend on this one. In order to avoid the need to merge them all at the same time, there is also patch https://codereview.qt-project.org/#change,39001 which temporarily adds backwards-compatible accessors, which can be removed after the other modules are able to build without them. We should not rename windowState to state, because in QML, state usually drives the state machine for animation transitions etc. (although QWindow is not an Item, a user might get confused about it). Related patches are https://codereview.qt-project.org/#change,39001 https://codereview.qt-project.org/#change,37764 https://codereview.qt-project.org/#change,37765 https://codereview.qt-project.org/#change,37766 https://codereview.qt-project.org/#change,37762 Change-Id: Ie4424ec15fbdef6b29b137f90a2ae33f173edd21 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* QPlatformWindow: change API for QPlatformWindow::setWindowStateRichard Moe Gustavsen2012-10-171-73/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation requests the platform window to set the window state if it can, and return the actual window state back. The problem with this approach is that the platform window is created as late as possible, so a call to QWindow::setWindowState would in many (most?) cases never be forwarded to the platform window (instead, the platform window is responsible to check the current window state upon creation). As such, the window state might be left unsynched with the platform window. This patch suggests removing the return value from QPlatformWindow::setWindowState. This will at least be consistent, so that setting/getting state would produce the same result independent of delayed window creation. If needed, we can later add new API to QPlatformIntegration or QPlatformWindow for querying supported/actual window state. Change-Id: Ie43f56169656854a765ce88b47a808f8f3d51bb4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fix setting custom cursor for widgets and windows before showing themMiikka Heikkinen2012-10-161-0/+3
| | | | | | | | | | | | If custom cursor was set before the window was created, it didn't actually get set, and in some cases even caused a crash. Fixed by making sure the cursor is correct when showing widget/window. Task-number: QTBUG-27535 Change-Id: I3bc946a9c406c96af5b86869a3a54893f8980aba Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Show widget cursor after restoring last override cursorMiikka Heikkinen2012-10-041-7/+2
| | | | | | | | | | | | | | | | qwidget_qpa.cpp was setting cursor directly to platform window, so QWindow didn't actually know what cursor was supposed to be shown. Since QWindow now supports setting cursor and has override cursor handling there, set cursor via QWindow instead of platform window. Also changed QGuiApplication override cursor handling so that it will query the cursor from QWindow if there is no override cursor. With these changes, widget's custom cursor will be properly shown when final override cursor is restored. Task-number: QTBUG-24674 Change-Id: I2d2bb1027779256f9d6de560b6533f45e205ffe9 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* fix QWidget::setWindowFilePath on Mac OSJoerg Bornemann2012-10-021-0/+10
| | | | | | | | Task-number: QTBUG-27299 Change-Id: I4dddbb9690aac327ad33477d8cea9afa84d10eb3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Redirect keyboard/mouse grab to the widget parent window.Friedemann Kleint2012-09-221-19/+22
| | | | | | | | | | | | Use the native parent's window if the widget in question does not have one. This should be in line with Qt 4.8 using effectiveWinId(). Remove redundant code in grabMouse(QCursor). Change-Id: Id6ab192e739221fe89f865f4d2f7a6d4671a190b Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.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>
* Fix mapping to/from global coordinates for child/embedded windows.Miikka Heikkinen2012-09-181-0/+8
| | | | | | | | | | | | | | | | | | | | | QWidget's mapToGlobal() and mapFromGlobal() functions assumed that if the widget reports it's a window or if it has no parent widget, it must be a top level window whose coordinates are in global coordinates. This is not true for child QWindows or embedded native windows (QAxWidgets). Changed the logic for mapping coordinates to use equivalent methods from QWindow if widget has a window handle, and changed QWindow's methods to map coordinates using native methods if window is embedded. Also fixed newly failing accessibility autotest. The geometry related failures there popped up because now the position of the rect returned by accessible interface is actually correct while widget geometry still reports position 0,0 before widget has shown up. Task-number: QTBUG-26436 Change-Id: I658fafd0ce01eb1604ba255efeeba3073ca0189f Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Do not call requestActivateWindow() on popups.Friedemann Kleint2012-09-101-4/+7
| | | | | | | | | | | | | | | Showing a compo dropdown would cause the parent to become deactivated (Windows). Introduced by: 8368557b9c0010fb205969d010c9d8549fbee0ae for QTBUG-25852 , QTBUG-23699 . Task-number: QTBUG-27145 Change-Id: I7b89697a2c55d58cc0ab184b61a0cff8bf2275ec Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Propagate initial size constraints to QWidgetWindow.Friedemann Kleint2012-08-211-1/+6
| | | | | | | | | | | Size constraints set on a widget before the creation of the QWidgetWindow were lost (for example, Qt Creator's preference page). Task-number: QTBUG-26745 Change-Id: I7c2f5aed9c8817795603e5ad3c24418d66627bab Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: hjk <qthjk@ovi.com>
* fix QWidget::activateWindow for child widgetsJoerg Bornemann2012-07-311-2/+4
| | | | | | | For child widgets we must use the windowHandle of the toplevel widget. Change-Id: If7bad8ed4bba694806a2c8b77bae3d25cc200b8b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>