summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Remove some redundant code in QActionJake Petroules2017-03-142-3/+2
| | | | | | | | Only 2 bits are needed to represent -1, 0, and 1 in a signed integer, and !(n != -1) implies n == -1 so the second condition was redundant. Change-Id: I200a17fe4e49ebc0eaa9a1988b4625267cef61a4 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Add new API to control whether shortcuts are shown in context menusJake Petroules2017-03-1414-5/+84
| | | | | | | | | | | | | Shortcuts are universally not shown on macOS or mobile platforms, making applications look very obviously out of place. Windows and GNOME desktop environments almost never use them. Only KDE appears to do so commonly; default accordingly. Task-number: QTBUG-49435 Change-Id: Ieac4cee57b15a02be5258f3d07749af6316af62b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Remove QPlatformDrag::platformDropDataAlbert Astals Cid2017-03-1314-39/+10
| | | | | | | | | | | | Its only uses were: * Call it to just store it in QDragManager::QDragManager * qnsview.mm calls it but since it knows it's a QCocoaDrag it can just call a function of that class directly * qxcbdrag.cpp calls it but since it basically was calling itself can just use the class member directly Change-Id: Ic7797c877d77f944a1212a7ea01173393bf903fe Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* xcb: remove code and macros related to Q_XCB_DEBUGGatis Paeglis2017-03-1011-384/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... early spring-cleaning, leaving one block of virtual root debug code that was inappropriately conditioned on Q_XCB_DEBUG; it now gets its own define. Removed Q_XCB_CALL: 1) I don't know anyone who actually uses it. 2) Enabling this feature (via Q_XCB_DEBUG) fails to build (and has been like that for about 1 year). 3) There are better ways to debug X11 client message exchange (see xtrace for example). 4) Using Q_XCB_CALL is a very fragile approach. Grep for example for xcb_change_property and you will see that half of the calls are not wrapped with the Q_XCB_CALL macro. This patch also removes the Q_XCB_NOOP macro. It's unclear what its purpose was. There was a TODO comment in qxcbeglcontext.h suggesting removal of this macro as well. Its evaluation of its parameter, even without Q_XCB_DEBUG, had no side-effects, so its removal should be harmless. Change-Id: I9fa48af454061d8b38f69f308131647cd18f85f4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use new QSemaphoreReleaser in tst_QThreadPoolMarc Mutz2017-03-091-32/+2
| | | | | | | ... replacing a hand-rolled version there. Change-Id: I0db50acd1ecf591d608eb719021a6fcd06aeb226 Reviewed-by: David Faure <david.faure@kdab.com>
* Introduce SH_TitleBar_ShowToolTipsOnButtons style hintJake Petroules2017-03-087-7/+22
| | | | | | | | | | This removes some tight coupling between QMdiSubWindow and QMacStyle in order to allow the latter to be moved into a plugin. Change-Id: I090c2c5774279c0454486c3db2e77f00a646b145 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* ucstricmp: compare null and empty strings equalMarc Mutz2017-03-081-9/+6
| | | | | | | | | | | | | | | | | | | For consistency with ucstrcmp(), which does the same. Before, the two overloads would sort null before empty strings. This behavior was removed in Qt 3.0, IIRC- This does not yet change anything, as all callers seem to work around the problem by handling null strings before calling this function (directly or indirectly). We would have seen a failure crop up if it wasn't so. As soon as we use these functions to compare QStringViews, however, the functions need to deal correctly with a nullptr lhs and/or rhs, so fix them. Change-Id: Ie4e417aade993213169b96b5e7351850c52ae733 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLatin1String: add iteratorsMarc Mutz2017-03-073-0/+199
| | | | | | | | | [ChangeLog][QtCore][QLatin1String] Added iterators, {c,}{r,}{begin,end}(). Change-Id: I0222a3ff44f2aa827c737e2fa3cfbb8aad69b5a7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove workaround for potentially unavailable pasteboard in macOSJake Petroules2017-03-071-10/+0
| | | | | | | | | | | | This was added in 2006 (when Tiger was the latest version of macOS) in order to work around an issue where the pasteboard would not be available when running under a non-graphical session. The latest supported version of macOS is currently 10.10 on which this is not expected to be an issue, so this workaround and therefore the Carbon dependency can be removed. Change-Id: Id5ed0a7e531dda71ce461c8bbbaebd5d4cadbd0e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Remove remaining Carbon includes from QtCore, QtGui and QtWidgetsJake Petroules2017-03-0711-20/+26
| | | | | | | | | Carbon is deprecated and we should not rely on it at runtime or compile time. These headers were only included for a small collection of keyboard key constants which have now been hardcoded instead. Change-Id: Ia2eaa267584b63be8019be3bbf64cba897a985a8 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Remove Carbon API usage from tst_qmacnativeeventsJake Petroules2017-03-073-37/+11
| | | | | | | These code paths are actually never exercised at all. Change-Id: I95a5cfa0173e265573c30378ec2e03a2ddf954e4 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* QString: make ucstrncmp() work for more than 2Gi charactersMarc Mutz2017-03-061-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Required for implementing upcoming QStringView's member functions such as compare(), indexOf(), endsWith(), ... Most implementations of the function body just add the length to the begin pointer to obtain an end pointer and then either no longer use the length, or decrease it in lock-step with increasing the begin pointer. The only exception is MIPS DSP's qt_ucstrncmp_mips_dsp_asm(), which gets the length passed in as an uint, implicitly converted from the int parameter, proving that calling the function with negative length was always undefined behavior, and therefore using an unsigned type does not introduce incompatibilites. I don't stand a snowball's chance in hell to fix the assembler routine, but since the code is only included for MIPS32, we don't need to do anything except be paranoid, add a static_assert that uint is the same size as size_t, and keep calling the old code. Dropped Q_COMPILER_LAMBDA in some places. We require lambdas since 5.7. Also hold lambdas by value, not by reference. This stuff is supposedly completely inlined, anyway, so there's no reason to make the code more complicated with magic lifetime extension of temporaries bound to references. Change-Id: I0c7bdc47648b873992b51b2e9d47d808390320ea Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString: make UnrollTailLoop work with non-int indicesMarc Mutz2017-03-061-8/+8
| | | | | | | | | | | | The extension of ucstrncmp to size_t will introduce the first user of this loop unrolling construct with size_t indices. Instead of choosing between int and size_t, make the index type a new template argument to facilitate a step-by-step transition from int to size_t users. Change-Id: I9d8fa7aaefa572130403bd19e11f52c58dff0a4d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unused Carbon includeJake Petroules2017-03-031-2/+0
| | | | | Change-Id: I62d7fa00da98e2925049fc381f0a592e27f2a245 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Move widget size policy methods to QStyleHelperJake Petroules2017-03-035-58/+52
| | | | | | | | | While they're relatively Mac-specific, conceivably multiple style implementations could use them, and it breaks a tight coupling between QStyleOption and QMacStyle. Change-Id: I5915c519129538a9ac39a34d5cfc3aeb838145d6 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Remove QT_CONFIG checks for style_macJake Petroules2017-03-031-16/+6
| | | | | | | These checks are now done entirely at runtime. Change-Id: I63cfee6123fc8465cee2ee36049ece0e5262ce8f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Remove use of QMutexPool in Windows code resolving librariesThiago Macieira2017-03-031-31/+21
| | | | | | | | We can use Q_GLOBAL_STATIC for this, which is thread safe. Change-Id: Ifea6e497f11a461db432ffff1449afe930f72d5d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QMimeBinaryProvider: avoid QString creation just to check for isEmpty()Marc Mutz2017-03-032-5/+5
| | | | | | | | | | | Return a QLatin1String instead and only if that is not empty, convert it into a QString. Also saves 320B in text size on optimized GCC 6.1 AMD64 Linux builds. Change-Id: I5432d213a6200e45414626bedb9f216bafaf1108 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix another race in the filtered touch implementationGunnar Sletta2017-03-031-1/+1
| | | | | | | | The lastPoints is used outside of the mutex-locked area, so of course it cannot be a reference. Change-Id: Ic69f9acd643366f8086e96b026a47d5de40cd77b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QBoxLayout: Remove unconventional try/catch blocksGabriel de Dietrich2017-03-021-23/+5
| | | | | | | | | | | | | These appear in insertSpacing() and insertWidget() only and without any justification of why they may be needed. Several other instances of the pattern these try/catch blocks were guarding, i.e. allocate new QBoxLayoutItem and insert to the list of items, were left unguarded, leading us to believe this may not be useful at all and can be safely removed. Change-Id: I887fbde9d10e10f4f5daaa37f6f2892bd4038d58 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix possible use after free error in SQLite REGEXPLorenz Haas2017-03-021-6/+9
| | | | | | | | | If the cache insertion fails, regexp is deleted and "subject.contains(*regexp);" is UB. Coverity-Id: 176868 Change-Id: Ibf9340e019f09fdb8b2a82de8877cdfb2ffe1372 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* xcb: Optimize QXcb{Screen,VirtualDesktop} for multi-monitor setupAlexander Volkov2017-03-022-241/+267
| | | | | | | | | | Move non-monitor-specific members of QXcbScreen to QXcbVirtualDesktop: they relate to an X screen rather than to a monitor. It allows to save some memory and X server callings that were previously made for each monitor. Change-Id: I079cdec5f27ca93a2aade00c3040936a0e50b494 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-02155-1973/+2019
|\ | | | | | | Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
| * evdevtouch: Replace LPGL21 with LGPL license headerKai Koehne2017-02-281-12/+18
| | | | | | | | | | | | | | Also use caonical contact url. Change-Id: Ic229623b0bcb533a9801890347802469c9c53c59 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * XCB: Replace LGPL21 with LGPL license headerKai Koehne2017-02-281-13/+19
| | | | | | | | | | | | | | Also use canonical contact url. Change-Id: I6976dd6e2898d1c80260b08a8257f2848b4b7b6c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Windows QPA: Replace LGP21 with LGPL license headerKai Koehne2017-02-281-14/+20
| | | | | | | | | | | | | | Also use canonical contact url. Change-Id: I58c7f5309883fa775d1bf7b56692e4c237a3f5a4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Integrity plugin: Replace LGPL21 with LGPL license headerKai Koehne2017-02-287-98/+140
| | | | | | | | | | | | | | | | Also use canonical contact url. Change-Id: I7faf9b329f4dd2c2a422d02e171bc2d39c359ed3 Reviewed-by: Rolland Dudemaine <rolland@ghs.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * bsdfb plugin: Replace LGPL21 with LGPL license headerKai Koehne2017-02-285-70/+100
| | | | | | | | | | | | | | Also use canonical contact url. Change-Id: Iaf22c48d0a548efaccd816132e8730cbb6e0bb5d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * IOS: Replace LGPL21 with LGPL license headerKai Koehne2017-02-286-84/+120
| | | | | | | | | | | | | | Also use canonical contact url. Change-Id: Id1d8328e6cc9aab82a30e0ee3a971e6935341b42 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * pcre2: Replace LGPL21 with LGPL license headerKai Koehne2017-02-281-13/+19
| | | | | | | | | | | | | | | | Also use canonical contact url. Change-Id: I61bf0990698a7021f1240deaf3eef2aff8f90a7e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Widgets: Replace LGPL21 with LGPL license headerKai Koehne2017-02-282-28/+40
| | | | | | | | | | | | | | Also use canonical contact url. Change-Id: I59ed3d09d2fee877a577a00e7e1cb09782d26512 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Network: Use canonical license headersKai Koehne2017-02-2811-55/+45
| | | | | | | | | | | | | | | | | | Replace outdated LGPL21 with LGPL license header. Use GPL-EXCEPT for all autotests. Also use canonical contact url. Change-Id: I6e5cc8a4285569c4f862730a980f492b8a933a72 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * Doc: Use canonical contact URL in license headerKai Koehne2017-02-283-3/+3
| | | | | | | | | | | | | | | | Change-Id: I34821150f66255df30d12572b27779e0e729ebc8 Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch> Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Do not include qfloat16 tables in arm64 buildsAllan Sandfeld Jensen2017-02-281-10/+13
| | | | | | | | | | | | | | | | | | | | The FP16 extension in IEEE mode is mandatory for Aarch64, so there is no aarch64 configuration where the tables will be needed for conversion. Change-Id: I9804e55c193cc9b5adcaedb720d8b980624139cc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Glen Mabey <Glen.Mabey@swri.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QSizePolicy: inline toControlTypeFieldValue()Marc Mutz2017-02-273-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * xcb: correct conversion of AbsX/AbsY to tablet width and heightShawn Rutledge2017-02-271-2/+2
| | | | | | | | | | | | | | | | This was a mistake in cb37ab82982569ef316d4948e0f13a9bfa6b3f55 Change-Id: I5897ceb34ab4aa1655efd20697d0e761cf7796b1 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
| * 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>
| * QEasingCurve: mark as sharedGiuseppe D'Angelo2017-02-271-1/+1
| | | | | | | | | | | | | | Requires no further changes. Change-Id: Ib280fa69a752aefa1c29fc5f0eb292e99b96270a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Make QPlatformSurface events work with QWindowContainerLaszlo Agocs2017-02-273-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * System tray icon requires -feature-temporaryfileStephan Binner2017-02-271-0/+1
| | | | | | | | | | Change-Id: I28039dd566c774b5844f4617c4dfb8bbce6673f7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix build for -no-feature-systemtrayiconStephan Binner2017-02-272-1/+6
| | | | | | | | | | Change-Id: If85cf995c5eefa2c4d648c9ad4b02922a13f682a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix build for -no-feature-textdateStephan Binner2017-02-272-3/+4
| | | | | | | | | | Change-Id: I31ad3fdde293759f04a136d7c7212288cafdc840 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * QVarLengthArray: add rvalue overload of append/push_backMarc Mutz2017-02-252-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improves performance when appending temporaries, esp. since the aliasing fix in the lvalue overload in 0f730ef made that overload correct, but a bit slower across reallocs. The unit tests already also pass rvalues, so the function is covered in the existing tests. [ChangeLog][QtCore][QVarLengthArray] Added rvalue overloads of append() and push_back(). Change-Id: If3a6970f03a160cba5b42d33d32d3d18948f6ce3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9Simon Hausmann2017-02-2469-1259/+901
| |\
| | * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-2469-1259/+901
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/moc.prf Change-Id: Ia71c8e3b3185f7c999bf226d0675051b10b8740b
| | | * QDockWidget: Fix memory leak when dragging a tab outside of a floating tab ↵Olivier Goffart2017-02-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | window A QDockWidgetItem will be leaked if a QDockWidget is dragged out of a floating tab window, and then plugged back somewhere. The problem is that QMainWindowLayout::unplug was not returning the QDockWidgetItem* from the floating tab's layout. When that's the case, a new QDockWidgetItem is created in QDockWidgetPrivate::startDrag and will be put into the layout, leaking the old QDockWidgetItem. Change-Id: Ifb9c1c562cb74383ebff1df0f91ee225c5cdb296 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
| | | * Doc: Fix minor typos in QRectFAaron Linville2017-02-232-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a couple incorrect references to the integer precision classes. Update snippet to use floating point precision classes. Task-number: QTBUG-51630 Change-Id: I9b08cfb68937a8e1179ee414d7981956ef7bc106 Reviewed-by: Martin Koller <kollix@aon.at> Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| | | * QUrl::fromUserInput(with cwd) fix handling of files with trailing spacesDavid Faure2017-02-232-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call to trimmed() makes sense for URLs typed in a browser's location bar, but its use in every code path made it impossible to open a file with a trailing space in command-line tools that uses fromUserInput(cwd) to handle command-line arguments, as recommended. For instance kde-open5 "file.txt " would fail. Change-Id: Ie61182684521d91f077d3e76f95b7240965ab405 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * tst_qurl: use temp dir and create our own files for testingDavid Faure2017-02-231-15/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to test specific filenames without polluting the current dir. Change-Id: Ieb99019a2e37e30f294d85c5d80af1de1b919019 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>