summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* QWidget: Don't rely on topextra to determine if window is top levelTor Arne Vestbø2021-10-141-1/+1
| | | | | | | | | | Doing so results in bailing out early for a widget that hasn't been shown yet, or otherwise resulted in creating extra and topextra, which means the normalGeometry will not reflect the widget's geometry. Pick-to: 6.2 Change-Id: Ieb85e9a6109ae34fe20d79e3c12f4517f827a590 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Call QWidget close handling in QWidget::close for non-toplevel native widgetsDoris Verria2021-10-141-2/+4
| | | | | | | | | | | | | | Since commit 7ba75d0 we close the QWindow in QWidget::close for native widgets and trigger the closeEvent in QWidgetWindow. However, if the widget's window handle is not a top level window, QWindow::close() will not close the window, failing in this way to deliver the closeEvent and call the close handling in QWidgetPrivate::handleClose. To fix, call handleClose() from QWidget::close for such widgets. Task-number: QTBUG-74606 Pick-to: 6.2 Change-Id: Ied342eced3340aaf19b5443762935b1a5fc5c27b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix references to QGuiApplication::lastWindowClosedTor Arne Vestbø2021-10-131-1/+1
| | | | | | | | | The signal is emitted from QGuiApplication these days. Pick-to: 6.2 Change-Id: I7423cd4808e8df86960f225fd6e4a12a1a4f11f3 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* widgets: Fix typos in documentationJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 5.15 6.2 Change-Id: I6b77f0ec043d08da3b7958d780dce9595daf97a6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Don't clear focus if setParent doesn't change the parentVolker Hilsheimer2021-09-281-5/+7
| | | | | | | | | | | | | | | | | | | | QWidget::setParent might be called to change the window flags, without changing the parent. For those cases, we don't have to clear the focus. Decouple the newParent state from the wasCreated flag. In most places where newParent was tested, wasCreated was either tested previously and can't be false anyway, or the code executed is irrelevant for widgets that are not yet created (there can't be a paint manager). In the remaining case, test wasCreated explicitly to maintain existing logic. Add test for the cases where the previous code broke the focus, both for QWidget and QDialog. Fixes: QTBUG-93005 Pick-to: 6.2 Change-Id: I39dc179c2d348054de3927aa8b69eecef4935511 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Deduplicate maybeQuitOnLastWindowClosed handlingTor Arne Vestbø2021-09-171-26/+0
| | | | | | | | | | | | | | | | | | The functionality now lives in QGuiApplication, and is triggered by QGuiApplication and QApplication after dispatching the close event to the window. The slight difference between how a Qt GUI and Qt Widget app determines if a window should contribute to the close-on-quit behavior has been abstracted into a QWindowPrivate helper. The additional checks that were in place for skipping out of the whole maybeQuitOnLastWindowClosed machinery have been kept. Task-number: QTBUG-53286 Change-Id: I81bd474755f9adb3a2b082621e5ecaa1c4726808 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Always reset close-status of QWidget when trying to closeTor Arne Vestbø2021-09-151-5/+7
| | | | | | | | | | | | | | | | | Move the status setting and resetting back into handleClose so that we don't end up with it being set if handleClose is never called in response to a close attempt. This can happen when QWindow's platform window has already been destroyed. Since QWindow::close handles that case gracefully and returns true, we can safely call it multiple times. Add test coverage to verify that we get exactly those close event calls that we want. Change-Id: Ica77bf17c26d923c3b79b1e5a688addbc88a6277 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Compute NSWindow background color without checking styleMaskTor Arne Vestbø2021-09-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The check for styleMask == NSWindowStyleMaskBorderless to decide whether to clear the NSWindow background was broken, as NSWindowStyleMaskBorderless has the value 0, but is only supposed to be compared to its companion NSWindowStyleMaskTitled (with value 1). A window can perfectly well be NSWindowStyleMaskBorderless and NSWindowStyleMaskMiniaturizable e.g., so by comparing directly to NSWindowStyleMaskBorderless instead of masking to the first bit first we ended up making miniaturizable windows non-translucent. We now check the Qt::FramelessWindowHint directly, and also whether the window is opaque. Ideally we'd have QWindow flags that could plumb WA_NoSystemBackground from Qt Widgets, as well as a background color property on QWindow to control the system background, but in the meantime we'll have to use the FramelessWindowHint heuristic. The QWidget docs have been updated to reflect this. Task-number: QTBUG-95042 Pick-to: 6.2 Change-Id: I0d40eecace60883c205ebb8c76cef1092cdf1144 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Close QWidget during destruction via QWindowTor Arne Vestbø2021-09-131-1/+5
| | | | | | | | | Ensures that the QWindow and platform machinery is involved in closing the widget. Change-Id: I4ca4ed0b1b31b835d62d2fc0a2158e34e15d710e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Split up close handling in QWidget into a pre and post stepTor Arne Vestbø2021-09-071-11/+20
| | | | | | | | | | If we are the one initiating the close (from Qt Widget land), we want to mark the widget as closing as early as possible. Clarified the role of close_helper by renaming it to handleClose. Change-Id: Iae250a0ae1583d743c59e99fcb99fdf18d2a1882 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: add more notes about full screen windows on macOSVolker Hilsheimer2021-09-031-3/+10
| | | | | | | Fixes: QTBUG-68069 Pick-to: 6.2 5.15 Change-Id: I8fc99f708cfa19a9c8cc8d13f6889549c79dd3b3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: fix qdoc warnings from wrong parameter typeVolker Hilsheimer2021-09-031-2/+2
| | | | | | | QWidget::addAction takes a QKeySequence, not a QShortcut. Change-Id: Ia10adcf50133b306d484a122ed17dddcf94372a6 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QWidget: close the QWindow in QWidget::closeVolker Hilsheimer2021-09-021-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | We want to close the window, end full screen mode on macOS, and free platform resources. This is all done by QWindow::close. QWindow::close closes the platform window, triggering a closeEvent to QWidgetWindow, which then calls QWidgetPrivate::close_helper. This way, closing a window via QWidget::close, QWindow::close, or interactively by the user are all equivalent. The QCloseEvent generated by the widget needs to be spontaneous for window-system generated events (i.e. the user clicked the close button), and non-spontaneous if the window closes because of a call to QWindow::close. To keep track of whether the event originated in an explicit call to QWindow::close, add a boolean to the QWindowPrivate. Add a test case that verifies that the window resources is destroyed, and that events are delivered as they should. Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Fixes: QTBUG-46701 Pick-to: 6.2 Change-Id: Iacb6a2c8d5e880b16b0c8f0c9257ed94bed36f5b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Minor cleanup in QWidget docsPaul Wicking2021-07-261-2/+3
| | | | | | | | | | | * Add missing . in \brief to silence warning. * Move relevant text about behavior change since 4.7 from the end to the start of the documentation block. Task-number: QTBUG-85839 Pick-to: 6.2 5.15 Change-Id: Id3671413f17d06023035c15fc7d5badbde59c5a6 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* QWidget: copy Q{Menu,ToolBar}::addActions() functionsMarc Mutz2021-07-131-0/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since any QWidget can have actions since at least Qt 5.0, it makes no sense to keep the addActions(text) etc. convenience functions that have traditionally existed in QMenu and QToolBar only in these two classes, where, to add insult to injury, they were just copies of each other, increasing library size for no real reason. So, add them to QWidget, too. This will allow us to de-duplicate the code between QMenu and QToolBar, too, which will be done in a follow-up patch, subject to BC constraints. [ChangeLog][QtWidgets][QWidget] Added the same addAction(text) overloads that previously existed only on QMenu and QToolBar, with the following two differences: First, the QKeySequence object, if any, is now available on all overloads, not just the ones taking a slot, but has changed position to allow, secondly, passing an optional Qt::ConnectionType parameter which will be passed to the QObject::connect() call. In addition, the function template overloads are now properly constrained so that they exist if and only if the corresponding QObject::connect() call does, too. Change-Id: Ifc3c2789600cf603192de8224fecbf9c88d91970 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Repolish child widgets when parent style sheet changesVolker Hilsheimer2021-07-051-1/+10
| | | | | | | | | | | | | | | | | | | If a child widget that is affected by the parent's style sheet is polished (because it's been shown explicitly, for instance by a layout), then it must be repolished when the parent's style sheet changes, even if the parent itself has not been polished yet. Since the style sheet is set on the parent widget, we must repolish the parent (which will repolish the entire widget tree), not just the individual children and grand children. Fixes: QTBUG-76945 Task-number: QTBUG-39427 Task-number: QTBUG-18958 Change-Id: I7bca9ee1badc07202fa05dc97f440f4ca6c9517d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Do not alter a widget's backing window's format once createdLaszlo Agocs2021-06-181-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing anything on a QWindow's QSurfaceFormat has zero and null effects once the underlying native window has been created. Letting QWidget update the format is wrong in this case, because we always expect that the value returned from QWindow::format() reflects reality. (reality being the settings with which the underlying native resource was created, which is typically frozen after QWindow::create(), not the state of some QWidget attribute. There are certain exceptions to this, such as when preparing to recreate the underlying native window, in which case one will want to update all relevant fields of the format based on the current values of the widget attributes, which is exactly what QWidgetPrivate::create() implements, and that's good.) Such a mismatch can have fatal consequences when OpenGL and friends are involved, but this always depends heavily on the platform and windowing system. For example, claiming that the alpha buffer size is 0 when the native window was created with 8, or vice versa, can break OpenGL-related code (both in Qt itself and in applications), that tries to create a QOpengGLContext configured based on what QWindow::format() returns. If that format describes settings that are incompatible with the actual underlying native window, we end up with the classic Invalid pixel format, EGL_BAD_MATCH, and alike errors. This is exactly what is happening when a QOpenGLWidget (or QQuickWidget) is placed in a QDockWidget where one of the ancestors is forced to native (winId() was called or WA_NativeWindow was set). When undocking, various code paths in QWidget will try to update the opaque flag of the widget, which in turn calls updateIsTranslucent. Now, if this function unconditionally changes the alphaBufferSize in the QWindow's QSurfaceFormat (even though this is completely futile to do, it has no visible effect in practice), we get the problem described above: rendering breaking down due to OpenGL contexts created with a pixel format incompatible with the native window. Prevent all this by not touching the format once the QWindow has a QPlatformWindow. This is the right thing to do, regardless of the bug in question: a window's (or context's or any other native resource wrapping class's) format must describe the underlying native resource and must never deviate, unless we are preparing to create a new native resource underneath. When it comes to the autotest, this changes the test added in 555661b625c40f21a6a3e4c73e928a6e8a46db20: the autotest logic is inverted because what we should test for is that the QSurfaceFormat stays untouched once the application makes a - futile - attribute change on the widget. Fixes: QTBUG-85714 Pick-to: 6.2 6.1 Change-Id: I7bf90711867e8a0fd474895625bf9530a7821fd5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Partially modified to use C++11 standard nullptrXiao YaoBing2021-05-271-1/+1
| | | | | Change-Id: Ibfd76357ceb56b347afe7122fc252b866b21cb11 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-05-261-4/+4
| | | | | | Task-number: QTBUG-93990 Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix build without features.imTasuku Suzuki2021-04-141-4/+4
| | | | | | | invalid conversion from ‘int’ to ‘Qt::InputMethodHint’ [-fpermissive] Change-Id: Icc67470ff6ef788b4f1b2eae46c6372b7f40c0d2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Assert that QWidgetPrivate::create creates a windowVolker Hilsheimer2021-02-251-0/+1
| | | | | | | | | | | | | Assert the expected side effect of createTLSysExtra, which might not allocate a window, but must do so in this case (as we have already returned if the QWidget is not a window). Fixes static analyzer warning 2f3bbfe8addb586445e96f8906d6769e Pick-to: 6.1 Change-Id: I4d5b8651b3510eff8e4a7b25889c0521ba6a4247 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Widgets: fix setTabOrder for QAbstractSpinBox-like widgetsIvan Solovev2021-01-141-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setTabOrder was not considering the case, when a child widget has its focus proxy set to its parent widget. This happens, for example, for the QLineEdit that is nested inside the QAbstractSpinBox. For such cases the lastFocusChild was calculated incorrectly, and, as a result, such child widgets were not correctly positioned in the focus chain. This could lead to an error while backtabbing. Here is a brief example. Suppose we have 3 widgets arranged like this: auto spinBoxOne = new QDoubleSpinBox; auto spinBoxTwo = new QDoubleSpinBox; auto button = new QPushButton; Then the default widget focus order is: - spinBoxOne - lineedit (from spinBoxOne) - spinBoxTwo - lineedit (from spinBoxTwo) - button Before this commit setting the explicit tab order changed the focus order in the following way: QWidget::setTabOrder(spinBoxOne, spinBoxTwo); QWidget::setTabOrder(spinBoxTwo, button); - spinBoxOne - spinBoxTwo - button - lineedit (from spinBoxOne) - lineedit (from spinBoxTwo) In this case, backtabbing from spinBoxOne actually leads us to lineedit (from spinBoxTwo), which refers to spinBoxTwo. And so we're stuck in a loop. This commit fixes the issue by handling such special case, and preserving correct focus order. Note: the actual unit-test in this patch uses QLineEdit instead of QPushButton, because one can't tab to buttons on macOS by default. However the general idea is the same. Pick-to: 6.0 5.15 Fixes: QTBUG-81097 Change-Id: I5d16da7733a4d63f809cab28b8ca9e116b87cffa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QWidget: mark obsolete function isTopLevel() as deprecatedChristian Ehrlicher2020-12-091-3/+3
| | | | | | | | QWidget::isTopLevel() is deprecated and can be replaced 1:1 with isWindow(). Sadly it's was not marked with Q_DECL_DEPRECATED in 5.15 Change-Id: I4508fbde41927f3b82e47a75011179548325029d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix links to Application ExampleVolker Hilsheimer2020-12-021-4/+5
| | | | | | | | | | The example was renamed in 6cb36d825d365988ea7a601218bdd3a329290469. Pick-to: 6.0 Change-Id: Ic9daac60002c9988dfeb5c7dcde74edb69388f37 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Replace qt_make_unique with std::make_uniqueAllan Sandfeld Jensen2020-11-231-7/+5
| | | | | | | We can depend on C++14 now. Change-Id: Iee9796cd22dbfbb70d4bdb25f0eee1662a026d6d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* widgets: Don't report new focus object during clearFocus() unless neededTor Arne Vestbø2020-11-201-6/+7
| | | | | | | | | | | | | | | We do not unconditionally clear focus_child like the existing comment said. We only do it if the focus_child was the widget that is clearing focus. So in many cases we'll end up with the same focus object as before. We can not report that as a focusObjectChanged to the window, as that will potentially trigger a reset or cancel of the current input method for the (unchanged) focus object. Fixes: QTBUG-86976 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I54367e46eda7a94d967f58960bd926c195dc09cc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-9/+9
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Give QWidget::updateMicroFocus a parameter with defaultVolker Hilsheimer2020-11-161-4/+4
| | | | | | | | This allows for potential optimizations in widgets, e.g. no need to for the input method to query all data when only the cursor position changed. Change-Id: Idd1e554acd776ed4d225197ce80915d651ede904 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Fix documentation warnings for Qt WidgetsTopi Reinio2020-11-121-1/+1
| | | | | | | | | | - Exclude forwarding headers to Qt GUI as they caused the headers to be parsed twice. - Drop documentation for removed example Task-number: QTBUG-86295 Change-Id: I08eb46b7c7f813f103cc545f931896be99a3ccec Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix broken link in QWidgetVolker Hilsheimer2020-11-091-1/+1
| | | | | | | \l expects the link target first, then link text second Change-Id: I4d8638c2c441c6d2949b1f011422c191df3ff619 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove usages of Q_FOREACHAllan Sandfeld Jensen2020-11-021-1/+1
| | | | | | | The last places outside tests, tools and qnx platform code Change-Id: I9918861888cf58bf5dbae5603febb8885fc67709 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* doc : remove redundant ')'Hiweed Mandriva2020-10-291-1/+1
| | | | | | Change-Id: I84a1a08889e04b4d6a33384a3f91d5bf3976871c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Hiweed Mandriva <hiweedmandriva@163.com>
* doc : fix typo 'consise' => 'conciseHiweed Mandriva2020-10-291-1/+1
| | | | | Change-Id: Ife2fc3b61b03b741b41bd703c3caf8180c6868fa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Expunge WA_GroupLeaderShawn Rutledge2020-10-271-14/+2
| | | | | | | | | It's been deprecated since Qt 4.1. Task-number: QTBUG-85816 Change-Id: Iafc6340716556f54fc5472c60035bb57461b842f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Rename the new platform APIs from QPlatformInterface to QNativeInterfaceTor Arne Vestbø2020-10-071-1/+1
| | | | | | | | | | | | We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix conversion warnings when setting alpha to QColorFriedemann Kleint2020-09-151-1/+1
| | | | | | | Adapt to 5bb4baae0379d5903f547f0399be9620f5ab06a0. Change-Id: Id65f87740f9de8e0d3624ff63c431dcad642f3a5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Port from devicePixelRatioF() to devicePixelRatio()Morten Johan Sørvig2020-09-101-8/+8
| | | | | | | This ports all of QtBase. Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Change QWidget::enterEvent signature to take a QEnterEventVolker Hilsheimer2020-09-051-5/+3
| | | | | | | | | | | | | | | | | | | This is a source incompatible change for widget implementors. Leaving the old enterEvent as a virtual overload is problematic due to shadowing. Best to make a clean cut, widget reimplementors will get a compile time warning if they mark their override as such, or if they try to call the parent class implementation. Addresses ### Qt 6 comment. [ChangeLog][QtWidgets][QWidget] The virtual enterEvent handler now receives a QEnterEvent, which contains information about mouse position and button states, rather than a plain QEvent. Change-Id: I233f594fd79c0c090983b3db8532913d00132fde Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Qt namespace: purge deprecated enum members and a typedefEdward Welbourne2020-08-281-1/+0
| | | | | | | | | | | | | | Since 5.0 - WFlags Since 5.6 - ItemIsTristate Since 5.14 - WA_NoBackground, WA_MacNoClickThrough, WA_MacBrushedMetal, WA_MacMetalStyle, WA_MSWindowsUseDirect3D WA_MacFrameworkScaled, ImMicroFocus Since 5.15 - MatchRegExp, MidButton (really since 5.7.0), WA_ContentsPropagated (really since 4.5.1, as are the following), WA_WState_DND, WA_ForceAcceptDrops. Change-Id: Ib1db3d85bf28823c704b5f3857546764b158e1ed Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Mark some Qt namespace enum members properly as deprecatedEdward Welbourne2020-08-271-2/+1
| | | | | | | | | | | | | | | | A comment is not good enough, Some of the enum members were even still in use, or mentioned in documentation. WA_ContentsPropagated, WA_WState_DND and WA_ForceAcceptDrops have been deprecated since 4.5.1; and at least the last has been an \omitvalue in the docs for even longer. (WA_ShowModal and WA_GroupLeader have been similarly marked, but are in use, see QTBUG-85816.) Push back to 5.15.1 in order to be able to remove these at Qt 6. Pick-to: 5.15.1 Change-Id: I6ea3839767e5f5158b0fed508f65798470191908 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename confusingly named QFont/QPalette::resolve overloadsVolker Hilsheimer2020-08-251-16/+16
| | | | | | | | | | | | | | | Having three methods with the same name doing different things is unnecessarily confusing, so follow the standard naming convention in Qt and call the getter of the resolve mask resolveMask, and the setter setResolveMask. These methods were all documented as internal. The publicly documented resolve() method that merges two fonts and palettes based on the respective masks remains as it is, even though 'merge' would perhaps be a better name. Change-Id: If90b1ad800834baccd1dbc38fc6b861540d6df6e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QWidget: drop an unncessary const_castGiuseppe D'Angelo2020-08-241-1/+1
| | | | | | | Thanks to the newly introduced indexOf overload. Change-Id: I00377591dba4104f1dfd34816cc74efcf5220a4d Reviewed-by: David Faure <david.faure@kdab.com>
* Fix a number of qdoc warningsFriedemann Kleint2020-08-201-2/+2
| | | | | | | | | | | - Remove obsolete functions and enumeration values - Remove QObject * parameter from QMetaProperty accessors - Fix renamed enumerations in QSsl - Fix list items to be \li - Fix function signatures and variable names Change-Id: I37c7e6bf2c8ff92bc7b82620bae0a27796f866ab Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Introduce QWidget::setScreenVolker Hilsheimer2020-08-171-22/+22
| | | | | | | | | | | | | | | | | | Follows the QWindow semantics, and is a replacement for creating a QWidget with a QDesktopScreenWidget as the parent. We can now remove much of the special handling of QDesktopWidget and the Qt::Desktop window type, and get rid of QDesktopScreenWidget. Add a manual test that allows local testing. Our CI environments only have a single screen, and no multi-head display server setup which is the primary case where QWidget::setScreen is interesting. For the more common case of a virtual desktop, QWidget::setScreen has no real impact (just as QWindow::setScreen doesn't). Change-Id: Id0099e069d316741bacd8c795c396ccad37be297 Fixes: QTBUG-85483 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Change QPixmap::grabWindow with QScreen::grabWindowAndy Shaw2020-08-141-1/+1
| | | | | | Change-Id: I68df86314cb8c3602d7ddbcf1e4527cf247d5fa1 Pick-to: 5.15 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add QXcbWindow platform interfaceTor Arne Vestbø2020-07-201-24/+46
| | | | | | Task-number: QTBUG-84220 Change-Id: I8bb4288f1ac06d77fb4f43ae091fa1712f694eeb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Allow Windows accessibility backend to receive focus updatesAndre de la Rocha2020-07-151-5/+0
| | | | | | | | | | | | | | | | The removed code no longer applies to the current Windows accessibility backend, and was causing it to miss focus change events when the application UI contained one or more widgets associated with native window handles, or when the Qt::AA_NativeWindows application attribute was set. This caused accessibility tools like Narrator to miss changes in the focused widget. Fixes: QTBUG-81862 Pick-to: 5.15 Change-Id: I6e42d09c54e9e1338fc4b103eba8a0b2c4309e7f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Change QWindow/QWidget::map(To/From)(Global/Parent) to operate in floatFriedemann Kleint2020-07-141-12/+64
| | | | | | | | | | | | | | | Change the functions to operate in float and add the QPoint versions as overload calling them. This is more in-line with the event accessors using float and allows for removing some workarounds using a delta when converting touch points. Leave QPlatformWindow::map(To/From)Global() as is for now and add helpers for float. Change-Id: I2d46b8dbda8adff26539e358074b55073dc80b6f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove support for users to create their own Qt::Desktop type widgetsVolker Hilsheimer2020-07-131-20/+15
| | | | | | | | | | [ChangeLog][QtWidgets][QWidget] Creating QWidget instances with the Qt::Desktop window type set is no longer supported. Change-Id: I712861d7104c4ae5cbdd5d54cd0134bf69eb144e Task-number: QTBUG-62094 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move method only used in keypad navigation to a better placeVolker Hilsheimer2020-07-071-25/+14
| | | | | | | QDesktopWidget in particular doesn't use that code anymore. Change-Id: I8eed752175c5478663b25872c7ffe78c814245d7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>