summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-271-1/+1
|\ | | | | | | Change-Id: Icdd71e9713725bda9c305e338f5c8b41a92ed8e8
| * Fix propagation of locale from widget to its childrenEdward Welbourne2017-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the condition in QWidgetPrivate::resolveLocale() to decide whether to propagate locale: make it match setLocale_helper()'s condition when deciding whether to propagate to descendants. This lead to a QDateTimeEdit's calendar popup not getting told what locale to use correctly, unless we setLocale() on it overtly, which then blocked propagation of locale changes to it unless QDateTimeEdit manually propagated the changes. Fix the documentation of WA_WindowPropagation to mention locale as also being propagated (which it was in several places, only neglecting this one in resolveLocale). [ChangeLog][QWidget][Qt::WA_WindowPropagation] Propagate locale consistently, along with font and palette, within the widget hierarchy. Previously, locale was propagated on ancestral setLocale(), but not on creation of the descendant. Task-number: QTBUG-59106 Change-Id: I92270f7789c8eda66a458274a658c84c7b0df754 Reviewed-by: David Faure <david.faure@kdab.com>
* | Set default fbo redirect correctly for QOpenGLWidget viewportsLaszlo Agocs2017-03-181-0/+14
| | | | | | | | | | | | Task-number: QTBUG-59318 Change-Id: Icf2ea4e5ebdeec31750edc8b34a9b9f6bfb64744 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | When changing screen, only update the font if dpi has changedOlivier Goffart2017-03-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally, this might avoid unnecessary work in a quite common case. But if high dpi scaling is set, the dpi (in logical pixels) does not change. However this event is sent before QGuiApplicationPrivate::processWindowScreenChangedEvent has had time to change the geometry, and might cause a problem in QMenu Amends f3a4b4258f2d207b5a8e73d62822a3afe1bf8a72. Task-number: QTBUG-59484 Change-Id: Ie4ceedcb0754613cf239ae86b225c4139b70d0cc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-131-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network.pro mkspecs/features/mac/default_post.prf src/corelib/io/qfilesystemengine_win.cpp src/corelib/io/qprocess.cpp src/corelib/io/qprocess.h src/corelib/io/qprocess_p.h src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/corelib/thread/qmutex.cpp src/platformsupport/fontdatabases/windows/windows.pri src/plugins/platforms/eglfs/eglfsdeviceintegration.pro tests/auto/corelib/io/io.pro Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
| * Fix UB in QWidgetItemV2::~QWidgetItemV2Olivier Goffart2017-03-021-1/+1
| | | | | | | | | | | | | | | | | | We might get there because 'wid' is already partially deleted (called from ~QObject). In that case, it is an undefined behavior to call a QWidget member function on it. Use QObjectPrivate::get instead. Change-Id: I6da314bf8385684d1332aa031a2d92012941303b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Doc: QSizePolicy: Fix documentation warningsTopi Reinio2017-03-081-1/+1
| | | | | | | | | | | | | | | | | | warning: Can't link to 'controlType()' warning: Can't link to 'horizontalPolicy()' warning: Can't link to 'verticalPolicy()' Change-Id: I6b31acebf183defee7b4ab36976034ed4a3fc98a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QWidgetWindow::event(): Call base implementation for QEvent::WindowStateChangeFriedemann Kleint2017-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | The base implementation takes care of updating visibility and emitting signals. Task-number: QTBUG-59313 Change-Id: I270b37c894420902488d89dc0c79f4c12b8d9a29 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Add feature.label and feature.formlayoutStephan Binner2017-03-034-4/+16
| | | | | | | | | | | | Change-Id: Ic8dc0aee7f3fc0d8218ba709352b1378078c6070 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Build fix for -no-feature-shortcutPaul Olav Tvete2017-03-031-2/+4
| | | | | | | | | | Change-Id: I99144b114b3c2eacb56b522b3059aa53a6bbd969 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix DPI of QWidget with parent on a different screenOlivier Goffart2017-03-021-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a floating QWidget has a parent on a different screen, its DPI was still inherited from the parent instead of taken from the screen. The only reason we did was in case there is a customDpi set. (customDpi is a private thing that is only used in designer to change the appearance of the previewed widget) So instead of recursing into QWidget::metric for each ancestor, just use a for loop to find if one parent has a customDpi. If no customDpi is found, then return the DPI of the right screen. Task-number: QTBUG-58959 Task-number: QTBUG-48242 Change-Id: Ie6e9e48cdd10234994c0919ba3aea9b0cdb52494 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QSizePolicy: inline toControlTypeFieldValue()Marc Mutz2017-02-272-25/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation now uses the relaxed-constexpr qCountTrailingZeroBits() function from QtAlgorithms, making the QSizePolicy(Policy, Policy, ControlType) constructor constexpr on C++14 compilers. The explicit check for DefaultType remains to keep the constructor C++11-constexpr when called with just (Policy, Policy). Extend the constExpr tests a bit. Change-Id: I59690f0921d9bdee08e3615d0d1f4a9b92870c32 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | QSizePolicy: simplify implementationMarc Mutz2017-02-271-17/+8
| | | | | | | | | | | | | | | | | | | | Even though we revoke its Q_COMPILER_UNIFORM_INIT for certain bugs that affect existing usage in Qt, it turns out that MSVC 2013 supports enough of braced initialization to make the macro magic in Bits::transformed() moot. Change-Id: I824d7fa298a2b95b4ad45c9e259e91c5ececfc0c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QSizePolicy: mark as relocatable typeMarc Mutz2017-02-271-0/+2
| | | | | | | | | | | | | | Use Q_RELOCATABLE_TYPE now that we have it. Change-Id: I04bb946695ebb9f0899bb73becbef301805389ef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Make QPlatformSurface events work with QWindowContainerLaszlo Agocs2017-02-271-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Embeddeding a QWindow via QWidget::createWindowContainer() fails to deliver the SurfaceAboutToBeDestroyed event. This breaks any OpenGL or Vulkan based QWindow that releases resources upon this event, and is particularly critical with Vulkan where the only way to do properly ordered swapchain - surface cleanup is via this event. In the non-embedded case close() eventually ends up in an explicit destroy() in QWindow. In the embedded case destroy() only gets called from ~QWindow. This then silently breaks since the subclass' reimplemented event() virtual is not getting called anymore. To remedy the problem, simply add an explicit destroy() to QWindowContainer. Task-number: QTBUG-55166 Change-Id: I1671e8f4d39f6c44e19eca7b9387f55fe3788294 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | QApplication: Remove code duplicationGabriel de Dietrich2017-02-241-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We always send mouse move events through the application event filters even if the widget has no mouse tracking enabled. This code portion is an almost verbatim copy of QCoreApplicationPrivate::sendThroughApplicationEventFilters(). The only difference is that previously the filter and the widget had to be in the same thread. Now, we compare the filter's thread to the application's. This is without consequence since widgets must live in the application thread. Change-Id: Ifee9c041e06d80ea0c2d2a947231e58ee4dfa24d Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QSizePolicy: plaster API with Q_DECL_NOTHROWMarc Mutz2017-02-232-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is mostly straight-forward, but some things are worth noting: 1. Yes, this is necessary. The noexcept operator looks for noexcept tagging, not at the contents of the function to determine whether to return true. The more conditionally-noexcept functions are used, the more important it becomes that low-level classes are correctly marked noexcept. In that, it is like constexpr. 2. In accordance with the rules governing noexcept specifications for the standard library itself, the set*Stretch() functions are not marked as noexcept, since they have preconditions and thus a narrow contract. Narrow-contract functions should not be noexcept. All other functions have wide contracts (ie. no preconditions). Change-Id: I853e0fc2d98cf3fcb16402a18ab136cccca24d89 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | make TabletMove hover events conditional on QWidget::tabletTrackingShawn Rutledge2017-02-232-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the tabletTracking property in the same way that mouseTracking already existed: there is a WA_TabletTracking attribute, and a TabletTrackingChange event to notify when it changes. So for widget applications it's an opt-in feature. QtQuick applications don't yet make use of tablet events, but when they do in the future, we don't yet have a mechanism to turn the move events off; it remains to be seen whether that will be necessary. [ChangeLog][QtWidget] QWidget now has a tabletTracking property, analogous to mouseTracking, which will enable TabletMove events while the stylus is hovering, even if no button is pressed. This allows applications to show feedback based on the other tablet event properties such as rotation and tilt. Task-number: QTBUG-26116 Change-Id: Ie96e8acad882b167e967796cdd17f1ad747a2771 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | handle TabletMove events during stylus hoverShawn Rutledge2017-02-231-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main reason for this is to get feedback about the stylus orientation (angles and rotation) before the user presses it. For example an application might provide an image of the brush which rotates along with the stylus. As with mouse events, applications can distinguish hovering by the fact that no buttons are pressed. On the xcb platform we need to stop blocking the hover events, and in QWidgetWindow we need to send the event to the widget being hovered, while keeping the existing "grab" behavior: after pressing the stylus (or any button on the stylus or on the tablet), keep sending the events to the same widget until release. Task-number: QTBUG-26116 Change-Id: Iaed8b3b94961290dbb29b5fd2ea892fed7221685 Reviewed-by: Dmitry Kazakov <dimula73@gmail.com> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | QSizePolicy: make (Policy,Policy) ctor constexprMarc Mutz2017-02-232-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, that ctor also takes a ControlType argument (defaulted), and calls the non-constexpr, non-inline function setControlType(). In order to make at least the two-arg version constexpr, I added a use of the ternary operator to check for type == DefaultType, making all calls of the ctor that use type == DefaultType constexpr. For init'ing an aggregate type without ctor in the ctor-init-list, I needed to require uniform initialization, too. C++11-style constexpr cannot call void functions, so I needed to extract the transformation part of setControlType() into a new function that returns the result instead of storing it directly. Saves a surprising 2K in QtWidgets text size on GCC 4.9, AMD64 Linux stripped release builds. Change-Id: Ib4adf5fd6e54d5345dbfe1c298554278faf13c58 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | QSizePolicy: add C++14-style constexpr where possibleMarc Mutz2017-02-221-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is straight-forward, since, unlike with transposed(), we can assume that every compiler that supports C++14 constexpr also supports C++11 uniform initialization. For Clang and GCC, this is clear. For MSVC, we might need to reconsider this, as, according to qcompilerdetection.h, 2015 still does not support uniform initialization (but not C++14 constexpr, either), and we don't know what 2017 will support. Change-Id: Idac7aa929d275645478a926896dca0dff166e114 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QWidget: update the font when the screen is changedOlivier Goffart2017-02-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The screen may change the dpi so the font dpi is also changed. We must tell QWidget that the font has changed by sending the FontChanged event to all sub widgets so they can update their geometry. Task-number: QTBUG-48242 Change-Id: Ibcdcc0c96429b8cd16311928298294f47a23e816 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Lazily create QPlatformWindow for Qt::Desktop windowsTor Arne Vestbø2017-02-161-7/+12
| | | | | | | | | | | | | | | | | | | | QDesktopWidget only needs a QWindow to access its screen, and has no use for the platform window. To keep old code working that may have called winId() on the QDekstopWidget we still ensure it gets created lazily, even if that will just create hidden fake windows on many platforms. Change-Id: I2d05b96dfeebeaf3f1278cfef6301ef4cb855a57 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Fix minor typos in apidocFrederik Schwarzer2017-02-151-1/+1
| | | | | | | | | | Change-Id: I5ce9599a60ea336b469807df075e491f0e6df680 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-141-9/+4
|\| | | | | | | Change-Id: I2bd2e61bae1eab4fc74fa6accd741ed9ae1f0669
| * QFormLayout: take the correct row in takeRow()Marc Mutz2017-02-081-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I didn't even try to understand what the old code was trying to do; once you're told by a user that the code is wrong, you see that it is. Fixed by just using the row as passed to takeRow() instead of trying to do some storage-index calculations. The m_matrix indexing operator does it all for us. Added a test that checks that the expected field widget gets returned. Fixed expected test data that was wrong, and just checking that the implementation behaves as implemented, instead of as documented. Amends change 8fbae648db3bc51bafacfe1f88e40561d357e60a. [ChangeLog][QtWidget][QFormLayout] The functions takeRow() and removeRow(), new in 5.8.0, now take and remove the correct row. Task-number: QTBUG-58693 Task-number: QTBUG-15990 Change-Id: I7185ccbc6c03e2579741cad5c0c821d3ed165474 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Prevent Qt::ForeignWindow from propagating into QWidget for non-toplevelsTor Arne Vestbø2017-02-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | Qt::ForeignWindow implies Qt::Window, which QtWidgets interprets as a top level window, but this is not the case on a QtGui level. A foreign window can be a child window as well, so we have to make sure the QWindow state is not propagated to QWidget, which would result in the QWidget becoming top level. Change-Id: Ie0c2d769ce92e6988a4d62da46f5fc2da74bdf08 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add QPlatformWindow::isForeignWindow()Tor Arne Vestbø2017-02-091-3/+6
| | | | | | | | | | | | | | | | Simplifies code at call sites and allows for refactoring how to decide if a window is foreign or not at a later point. Change-Id: Icc51a83bac187f4975535366b53b4990832b6c82 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix some qdoc warnings for 5.9Friedemann Kleint2017-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings: src/network/access/qhstspolicy.cpp:158: warning: Undocumented parameter 'expiry' in QHstsPolicy::setExpiry() src/network/access/qhstspolicy.cpp:178: warning: Undocumented parameter 'include' in QHstsPolicy::setIncludesSubDomains() src/network/access/qhstspolicy.cpp:178: warning: Can't link to 'includeSubdomains()' src/widgets/kernel/qsizepolicy.cpp:402: warning: Cannot find 'transposed(...)' in '\fn' QSizePolicy QSizePolicy::transposed() src/widgets/kernel/qsizepolicy.h:165: warning: No documentation for 'QSizePolicy::transposed()' src/widgets/util/qundostack.cpp:164: warning: Undocumented parameter 'obsolete' in QUndoCommand::setObsolete() Fix the signature of the QStaticByteArrayMatcher member functions. The warnings src/corelib/tools/qbytearraymatcher.cpp:372: warning: Cannot find 'indexIn(...)' in '\fn' QStaticByteArrayMatcher::indexIn(const char *haystack, int hlen, int from) src/corelib/tools/qbytearraymatcher.cpp:382: warning: Cannot find 'indexIn(...)' in '\fn' QStaticByteArrayMatcher::indexIn(const QByteArray &haystack, int from) remain, though since apparently qdoc is thrown off by the constructor. Change-Id: I157359a881ff3fbc80d2eeb52dd5c27249d009c4 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'gerrit/dev' into HEADOswald Buddenhagen2017-02-015-48/+94
|\ \
| * | QSizePolicy: implement transpose() via transposed()Marc Mutz2017-01-311-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | Having two implementations was nice for testing, but now remove one of them. Change-Id: I70dc7d16496427dd36ba2464c9f650ec865202b1 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
| * | QSizePolicy: add a transposed() methodMarc Mutz2017-01-282-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some situations, this allows for nicer code. It's also possible to make this constexpr in C++11, whereas the mutable transpose() would require C++14-style constexpr. The new function should also be faster, since it just swaps the member variables. Because of constexpr-function limitations, the way the return value is constructed needs to depend on the level of the compiler's C++11 support. This is not the only class that requires uniform init to provide a fully constexpr interface (QUuid and QBasicAtomic come to mind), so this should probably be generalized across Qt at some point. Added tests. [ChangeLog][QtWidgets][QSizePolicy] Added transposed() method. Change-Id: Ic1077a0d5a861e7c63bd1daeeb42b97c3a2f71ef Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
| * | QSizePolicy: add some constexprMarc Mutz2017-01-281-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add a basic test for constexpr expressions involving QSizePolicy. GCC < 4.8.0 has problems with initializing variant members in constexpr ctors: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54922 Instead of revoking its Q_COMPILER_CONSTEXPR, which is a source-incompatible change, simply note the fact so we can selectively provide constexpr for QSizePolicy. Change-Id: Iba8e5a7cdf847d73e8e2b6bb6211fb3c9846aa0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/devLiang Qi2017-01-263-13/+15
| |\ \
| | * | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-253-13/+15
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/common/msvc-desktop.conf mkspecs/common/msvc-version.conf mkspecs/common/winrt_winphone/qmake.conf mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/qt.prf mkspecs/features/uikit/default_post.prf mkspecs/features/winrt/default_pre.prf mkspecs/winphone-arm-msvc2013/qmake.conf mkspecs/winphone-x86-msvc2013/qmake.conf mkspecs/winrt-arm-msvc2013/qmake.conf mkspecs/winrt-x64-msvc2013/qmake.conf mkspecs/winrt-x86-msvc2013/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/gui/kernel/qwindowsysteminterface.cpp src/network/kernel/qhostaddress.cpp src/plugins/platforms/mirclient/qmirclientplugin.cpp src/plugins/platforms/mirclient/qmirclientplugin.h src/widgets/util/qsystemtrayicon.cpp tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp tools/configure/Makefile.mingw tools/configure/Makefile.win32 Done-with: Jake Petroules <jake.petroules@qt.io> Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I4be3262d3994e11929d3b1ded2c3379783797dbe
| | | * QQuickWidget: fix drag and dropOleg Yadrov2017-01-201-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickWidget did not receive mouse release events after drag and drop because the logic was so: 1) QWidgetWindow::handleMouseEvent() was called on press and qt_button_down was set to the corresponding QQuickWidget; 2) After drag started, qt_button_down was set to 0 in QApplicationPrivate::notifyDragStarted(); 3) On mouse release QWidgetWindow::handleMouseEvent() was called again, but because qt_button_down was 0 QApplicationPrivate::pickMouseReceiver() returned 0 and as a result QWidgetWindow ignored the event and did not propagate it to QQuickWidget for further processing. The step 2 is a widgets-specific fix for QTBUG-26145 that does not work for QQuickWidget (QtQuick has its own focus system). Note that because Widgets and QtQuick do not share the sources, there is no possibility to cast the pointer to check whether qt_button_down is a QQuickWidget or some other QWidget-derived class object, so we have to use QObject::inherits() method to check that. Task-number: QTBUG-56713 Change-Id: I599b843e903c64329e6178752e0dc49f674bb890 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | | * QWidget::winId(): Remove documentation bit about macOSGabriel de Dietrich2017-01-191-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Carbon port has been removed since 5.0, so there's only one framework against which we can build Qt. Change-Id: I38ce410f50cd4eda7abcc50ac4c4c7a23b3e1f45 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | | * docs: Mention that QWidget::ensurePolished() also affects childrenSergio Martins2017-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I083d1c503039010024c89db59003fb6fca050c26 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Martin Smith <martin.smith@qt.io>
| | | * Make shortcuts work for platform menu barsDmitry Shachnev2017-01-191-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a platform menu bar is used, the QMenuBar is hidden, so shortcuts for QActions attached only to it do not work. Extend the macOS-specific code to treat such menubars as visible to other platforms, to make the shortcuts work. The exception is made for internal QMenuBar shortcuts, which are forwarded to the platform menu. A follow-up change will add support for this to QDBusPlatformMenu. The updateGeometries() method is called for platform menu bars too to make sure the internal shortcuts are registered even if the global menu is in use. Add two cases to the tst_QMenuBar::activatedCount() test to test both native and non-native menu bars when possible (it now passes with native menu bars too). Change-Id: I2d7128512719ac199cd3f8f7ba28333d04d84ed4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | | * Silence maybe_uninitialized warning with gcc -OgAllan Sandfeld Jensen2016-12-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC produces false positives for maybe_uninitialized when compiling with -Og in these three places. Simply initialize the variables to silence it. This should be entirely cost-free for normal compilation. Change-Id: Iab778a6ba25993f78f190e928c1fcc2dbd8b2fcd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Make wheelScrollLines a QStyleHintAllan Sandfeld Jensen2017-01-251-10/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | The number of lines to scroll on a wheel click have previously been a QPlatformTheme hint and QApplication setting, this patch moves it to QStyleHint so it may be easier read by QGuiApplications. Change-Id: I80673c7b99d78c6407b1202b3742e1cb5fef0583 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* / / Widgets/qwidgetbackingstore.cpp: Fix developer build with MinGWFriedemann Kleint2017-01-271-17/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | In showYellowThing_win(), replace the switch by an array of COLORREF and simplify the code accordingly, fixing: kernel\qwidgetbackingstore.cpp: In function 'void showYellowThing_win(QWidget*, const QRegion&, int)': kernel\qwidgetbackingstore.cpp:188:39: error: 'brush' may be used uninitialized in this function [-Werror=maybe-uninitialized] FillRect(hdc, &winRect, brush); ^ Change-Id: Id60be0e01e1edb2fa939d64abaf2e58357bcc14d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Remove qtypetraits.h's contents altogetherGiuseppe D'Angelo2017-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that QFlags can use an (un)signed int matching the underlying type as identified by the compiler and not by us. Requires fixing a few warnings about sign conversion due to QFlags misusages in qtbase that were either plain wrong, or were relying on the enum being backed by an (un)signed int when it wasn't. Keep qtypetraits.h in the source tree in order to prevent source breaks if some downstream #includes it (note however that it did not contain any public API). Change-Id: Ib3a92b98db7031e793a088fb2a3b306eff4d7a3c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Widgets: report focus object change to QtGui before sending widget eventsTor Arne Vestbø2017-01-101-17/+14
| | | | | | | | | | | | | | | | | | | | Updating the focus child means the focus object of the window has changed. We need to report this to QtGui immediately so that it can e.g. inform the input context of the new focus object, before widgets reacting to the focus events start calling update() on the input method. Change-Id: Ie3f7b835591e71519e3f384c2abdad53242c9736 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | doc: Fix all remaining "Cannot tie" errors in QtBaseMartin Smith2017-01-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Most of these involved moving or removing extraneous aide-memoir comments left by programmers between qdoc comments and their functions. There were also some cases where Q_CLANG_QDOC had to be tested to make something visible to clangqdoc. And there were a few functions that should not have been documented at all. Change-Id: I3bf7c397a9e5ddbffc40cc1fee7f19cad71a1ae7 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | doc: Removed a \fn command and a misplaced commentMartin Smith2017-01-051-3/+0
| | | | | | | | | | | | | | | | | | They were preventing clangqdoc from matching two qdoc comments with the functions they are meant to document. Change-Id: Idfe9d0ab328e938d66e5da75d065974329be616d Reviewed-by: Martin Smith <martin.smith@qt.io>
* | doc: Removed two cases of // staticMartin Smith2017-01-051-2/+0
| | | | | | | | | | | | | | | | | | They were preventing clangqdoc from matching two qdoc comments with the functions they are meant to document. Change-Id: I51fea7957debc6fbfc89eb1a531ba8f39a34410a Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Split QPlatformWindow::isEmbedded into isAncestorOf to separate concernsTor Arne Vestbø2017-01-051-7/+0
| | | | | | | | | | | | | | | | | | | | | | The function was doing two things, both checking window ancestry and whether or the window was a direct child of non-Qt window. The former has now been split of in a QPlatformWindow::isAncestorOf(), which simplifies the code in e.g. QApplicationPrivate::isWindowBlocked(). Change-Id: I259a190e03ef8def23356005474eeeee74c9ae89 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Q_ENUMS -> Q_ENUM and Q_FLAGS -> Q_FLAGAlbert Astals Cid2017-01-022-2/+3
| | | | | | | | | | Change-Id: I3cdc7338354da40ab20bdaeb9d5745264ea27228 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Add needed includes to qdesktopwidget_p.h and qwidgetwindow_p.hKimmo Ollila2017-01-022-0/+2
| | | | | | | | | | | | | | | | The template definitions are required here as we are using an object of type QPointer below when doing static cast of QPointer::data() Change-Id: I41e2b6f59667574ca3c5d75c5dddb203790adbce Reviewed-by: Lars Knoll <lars.knoll@qt.io>