summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Fix QDir::mkpath() when the path contains "symlink/../"Thiago Macieira2017-04-072-19/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is incorrect to collapse a "symlink/.." segment because the parent directory of the symlink's target may not be the directory where the symlink itself is located. [ChangeLog][QtCore][QDir] Fixed a bug that caused QDir::mkpath() to create the wrong directory if the requested path contained a symbolic link and "../". Change-Id: Iaddbecfbba5441c8b2e4fffd14a3e367730a1e24 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
| * | Android: fix Menu and Back key handlingJ-P Nurmi2017-04-071-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't quit on Back key release when Back shortcut was accepted and likewise for the Menu key, don't trigger the platform menubar if Menu shortcut was accepted. Change-Id: Ifde87cbc2d95be1beb90ca59f55889b83a90ff02 Task-number: QTBUG-59670 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * | Support different job counts also for ICC LTOThiago Macieira2017-04-071-1/+3
| | | | | | | | | | | | | | | | | | Change-Id: I27b55fdf514247549455fffd14b1cdbd2980d5d6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | QDataStream: add operator<< and >> for std::nullptr_tThiago Macieira2017-04-074-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::nullptr_t is nullary: it accepts only one value, nullptr. So we don't need to read or write anything. This commit simply adds the two operators that allow generic code to operate on std::nullptr_t if required. This commit also adds the actual use to QMetaType::load/save, even though there's no change in behavior. [ChangeLog][QtCore][QDataStream] Added operator<< and operator>> overloads that take std::nullptr_t, to facilitate generic code. Change-Id: Iae839f6a131a4f0784bffffd14aa37e7f62d2740 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | examples: remove some unneeded QStringRef::toString() callsMarc Mutz2017-04-073-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - when appending to another string - when just comparing - when just calling toInt() Change-Id: I6960784569b83bfd3e3640a8c04f2f909c293449 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | Doc: Clarify the porting notes from QRegExp to QRegularExpressionFriedemann Kleint2017-04-071-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a small table to illustrate the results exactMatch() and split out the part on partial matching to a separate section since it is less common. Change-Id: Ifbd5c3cbd1d8c0ee9e8b2d58ed13f40776b03762 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * | tst_qmessagehandler: fix qMessagePattern for armSami Nurmenniemi2017-04-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Backtrace logging tests were not passing for arm. Added compile option -funwind-tables to support backtrace on arm. Task-number: QTBUG-59966 Change-Id: I5e2443b1e3a644a239dab68db990e75ae8fade24 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | tst_QFocusEvent: Fix checkReason_ActivateWindow for offscreen and minimal ↵Sami Nurmenniemi2017-04-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platforms Widgets in platforms offscreen and minimal don't get focus back automatically after hiding focused window. Extra activateWindow is needed. Task-number: QTBUG-59966 Change-Id: Iaf3d4e60483c4b2600472af199f7a7cd51b3fa6e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | QXmlStream: optimize PrivateTagStack::addToStringStorage()Marc Mutz2017-04-193-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | De-duplicate the QString/Ref code paths by using QStringView instead. Keep the old overloads so we can centrally apply the qToStringView- IgnoringNull() optimization. Replace insert(p, ..) where p = size() with append(..). The code ensures in the lines before that the insertion position is the end of the string. Port the few QLatin1String arguments to addToStringStorage() to QStringViewLiteral. I also considered adding a QLatin1String() overload, but the test size increased, so the function wasn't pulling its own weight. This version saves 360B in text size on optimized GCC 6.1 Linux AMD64 builds. Change-Id: I4b759fddc38b1f97a7218954e756cc19400922e9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Use qToStringViewIgnoringNull() where applicableMarc Mutz2017-04-193-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Saves just over ¼KiB in QtCore text size on optimized GCC 6.1 Linux AMD64 builds, iow: qToStringViewIgnoringNull() saves ~40B per use. Change-Id: I3278306d5ce594e8ccd0f58b8f8d0319637d1b2b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QStringView: add internal qToStringViewIgnoringNull()Marc Mutz2017-04-192-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As long as a null QString still returns non-null data(), QStringView's QString constructor needs to call isNull(). That's a branch we often can do without, so add an internal function that bypasses this correctness check. It's internal, since we might have a Q6String that returns nullptr data() when null, which will remove the need for this function. What the QStringView(QString) ctor does will also have to be re-evaluated come Qt 6, but for now, keep the public QString- QStringView conversion correct. Change-Id: I35dc7383bc3bd018f46aeec429185135a38ddcef Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QUuid: de-duplicate uuid → string formattingMarc Mutz2017-04-191-28/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was duplicated for QChar and char characters. Keep only the char version, and use QString::fromLatin1() to convert to QString. This does not perform more allocations. It just copies 38 bytes more than before. Saves 788B in text size on optimized GCC 6.1 Linux AMD64 builds. Change-Id: I1a65c8128eb2097e11527961618d54ea362e1b80 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Migrate Windows QPA backend to use QRegularExpressionSamuel Gaist2017-04-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates the Windows QPA backend code to use QRegularExpression in place of the deprecated QRegExp. Change-Id: Ib45c374578bed5b9f2771df1ca04cc09cab6e7c9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | eglfs: Adopt changed function signature in QtGlesStream libraryRainer Keller2017-04-191-1/+1
| | | | | | | | | | | | | | | Change-Id: I80fb7e403073fd264e0878d7c638812027282ad8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | eglfs: Use description property as screen nameRainer Keller2017-04-192-0/+6
| | | | | | | | | | | | | | | Change-Id: I2322ffcb28c646b289ee718b9c3946bc0a44bd3c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | QJsonValue: implement copy-assignment via copy-and-swapGiuseppe D'Angelo2017-04-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | Now we have a swap() member, remove the comment. Amends bbb440bab261fecc7c9baf779dadf36659d3cf6f. Change-Id: I3640d544bbd0927109460d843252c8e5f0aefaf5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QJson*: value semantics cleanupGiuseppe D'Angelo2017-04-198-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-add the move operations, add a swap(), mark as shared (we're already using them in containers). QJsonValue is slightly tricky, because it has an anonymous union, which can't be easily moved in C++. Use the implementation of the copy constructor as inspiration for the move. [ChangeLog][QtCore][JSON] QJsonArray, QJsonDocument, QJsonObject and QJsonValue now have move operations and a swap() member function. Change-Id: Idfb94a93370ace96100efbd6559ef05b4c5adc39 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Make platform menu tag/setTag not be pure virtualAlbert Astals Cid2017-04-1816-136/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reasons: * Tag means nothing to the platform, tag is something the Qt side code will store and then restore, but it's meaningless for the platform, since it can be either the pointer to an action (qmenu.cpp) or an item count (qcombobox.cpp) * Since it's meaningless to the platform you don't know what to do when trying to implement a platform, this shows in how the field was being initialized, some initialized to this, some initialized to 0 On a followup commit we will remove the virtual tag but first need to fix up other QPAs that don't live in the main repo Change-Id: I15ac83f3bf7e4c741153d31ac761dbbe6f4b1b52 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Tidy up QDateTimeParser in assorted petty waysEdward Welbourne2017-04-181-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A bit-field was necessarily equal to either zero or its (single-bit) mask; so comparing to the mask was superfluous. A local value set and then conditionally over-ridden could easily be made const by using the condition in a ?: assignment. A use of qMin() lent itself to turning into a simple conditional assignment. Change-Id: I541d98044b23b8c51e6169f617a5841ba8fffc55 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QDateTimeParser: simpler return, clearer commentEdward Welbourne2017-04-181-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | skipToNextSection() returned via a local temp that served no purpose. The accompanying comment didn't quite explain what it set out to. Change-Id: I31581323df374653db9c2558a3bd63409aafb178 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QDateTimeParser: simplify switch by exploiting fall-throughEdward Welbourne2017-04-181-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | Several cases all fell together; their code tested away one of them; so putting it last and falling through to it avoids the need to test. Change-Id: I0bf555710604a56faa61b60bfe5484d5c5a1ee6b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | qmacmime: modernize QMacPasteboardMimeTiffRichard Moe Gustavsen2017-04-181-39/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since QMacPasteboardMimeTiff was moved out of the cocoa plugin and into platformsupport, we take the opportunity to give the code some overhaul as well. Change-Id: I7d5425d336ba41474698915008b2086e98ea49dc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | darwin: add tiff support to clipboard for all darwin platformsRichard Moe Gustavsen2017-04-183-92/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will add copy/paste/dnd support for QPixmap and QImage to all darwin platforms (and not just macOS, as it is today). Task-number: QTBUG-57428 Change-Id: Iefc876c0a347077322f195b55c49f2c1c4b4a34b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | QStringView: plaster API with Q_REQUIRED_RESULTMarc Mutz2017-04-181-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | There's no reason to use it only on some functions with return values and not others. Change-Id: If50a669f49e9e2f71173dea94465a5de58a7783e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QLatin1String: add chopped(), chop(), and truncate()Marc Mutz2017-04-183-4/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QLatin1String] Added chopped(), chop(), truncate(). Change-Id: I69b31aae560e94a120d7e8a36e06ea957ccd2003 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QStringView: add chopped(), chop(), and truncate()Marc Mutz2017-04-183-4/+52
| | | | | | | | | | | | | | | | | | Change-Id: I33925f5b2b3e0904f47f18f3cbab480d7f844734 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QByteArray, QString, QStringRef: Add chopped()Marc Mutz2017-04-185-9/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have two functions to get a substring without doing some calculations involving size(): - mid(p): mid(p, size() - p) - right(n) : mid(size() - n, n) (left does not involve size(), so isn't in that set). What was missing was a name for - f(n): mid(0, size() - n) As an action, it's called chop(), so call the transformation version chopped(). I made chopped(n), n < 0 or n > size(), undefined, because QString(Ref) ::left() is broken[1], while the QByteArray implementation is not. This is the only way to get consistent behavior among the three classes. I's also the correct thing to do. [1] instead of returning the empty string for negative indexes, it returns the whole string. [ChangeLog][QtCore][QString/QStringRef/QByteArray] Added chopped(n), a const version of chop(n). Change-Id: I6c2c5b16e0060fa924ced5860f21f2d0f23bd023 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* | | iOS: add support for adding mimetypes other than text on the clipboardRichard Moe Gustavsen2017-04-181-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A QVariant can only be converted to a QByteArray if it has user type QMetaType::QByteArray or QMetaType::QString. The way it stood, we always tried to convert the mime data to a QByteArray, and then put the result into a QVariant. This would fail if the mime data contained e.g a QPixmap. This patch will inspect what kind of data the QMimeData contains, and convert it to a QVariant using the expected API. Task-number: QTBUG-57428 Change-Id: I67054424fe8c45873bab8305e7b44de939aae0fb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Reset d->mouseDown only if it's the menu being hiddenMarco Martin2017-04-182-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the mouse cursor is over a menu entry with a submenu, and the submenu is open, quickly moving the mouse to a near menu entry and clicking it sometimes results in the click being eaten: this happens when the mouse is pressed before the submenu disappears and released after it disappeared: the submenu resets d->mouseDown that is a static, causing the mouse release event on the action we want to have no effect. Set d->mouseDown to 0 only when the window is hiding is the actual window that contains the mouseDown, otherwise is still valid. Change-Id: I2c981b9432728e9e7518c30a146c9595199f8afe Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QXmlStream: update qxmlstream.g to match qxmlstream_p.h againMarc Mutz2017-04-151-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many changes over the last years didn't update qxmlstream.g: ecceaec8581886e5215ab10c8f5c702e315cb397 6f4160042226be86276fa9264663c2942413fc8d 9f888d2fde9c5413e5519e0914e9b13638760985 59c3670b63b6e97dac6115a0819e6c412d3f7888 a7885c9756d423042bd0670d82d78d8dffe9be54 817800ad39df10ca78e2c965a61d4d2025df622b 342c99ff45c1e6ef524b6045571900fd7408d635 These changes are all included now. Change-Id: I9dd56ec12ae6505edaf8238d48c5a5f78b5e8779 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QXmlStream: remove more unneeded toString() callsMarc Mutz2017-04-152-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some are enabled by the recent addition of QStringView, but some were wrong already before. Change-Id: I3f900a80c47011af4c0370e32acb7478404b4867 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Pluginize the platform stylesJake Petroules2017-04-1438-138/+297
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enforces decoupling and in the case of QMacStyle, isolates QtWidgets and therefore end user applications, from Carbon/HITheme. Windows and Fusion are platform independent, so they remain built-in (but mostly because the Windows style is tightly coupled to other styles like QStylesheetStyle). Task-number: QTBUG-59428 Change-Id: Id6519fe0c5269c1bce5b5921f9db06257032a1c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | QAndroidPlatformScreen: Add missing overrideRobin Burchell2017-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Missed in b018a5ecef7b12c2d28df950a207ff3c7fc3abed. Reported-by: Anton Kudryavtsev <antkudr@mail.ru> Change-Id: Id833fbd77c571923571e59b0c609b56c69308d90 Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* | | QMovie: Add lastError and lastErrorString gettersRobin Burchell2017-04-142-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMovie has an error signal, but it is not possible for users to "catch" all errors, for instance, if they occur at construction time, and furthermore, it may not be convenient to add interception of the signal just to find out what the error was. [ChangeLog][QtGui][QMovie] Added lastError and lastErrorString accessors, as a convenience over connecting to the error() signal. Change-Id: I9c6ef70694c67986ecd30b5dc1b321c4dfa5c315 Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* | | QMovie: Make sure to pass on QImageReader errors when they occurRobin Burchell2017-04-141-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | If a file cannot be opened for some reason (like running out of FDs), emit the error signal. Change-Id: I9586dda34b2f2cef73593c6dcb855b29d63c2dbc Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* | | Remove the Windows XP style from public accessibilityJake Petroules2017-04-1354-236/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Later, the Windows XP style will be removed entirely by means of being merged with the Windows Vista style (which inherits from the XP style). There was actually no reason for these styles being separate classes in the first place, because both result in the same appearance for controls on the running version of Windows. Therefore, the windowsxp style merely appears as a "broken" version of the windowsvista style, with only minor differences based on the additional metrics that the vista style provides. The windowsxp style does NOT, and never did, allow users to get a Windows XP style appearance on Windows 7 and above (which is currently Qt's minimum supported platform). Therefore, now that Qt no longer supports Windows XP, the windowsxp style is unusable. [ChangeLog][QtWidgets] The windowsxp style is no longer available as a separate style, because it did not (and cannot) actually provide an XP-style appearance on currently supported Qt platforms. Change-Id: I513d9bce3f247f97cfb28dfee88fe888469e0a6f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | DockWidgets: Allow to have floating dockwidgets side by sideOlivier Goffart2017-04-135-161/+354
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on what MS VisualStudio can do, allow to have. We can now drop the QDockWidgets on floating ones so that they are next to eachother This is activated when QMainWindow::GroupedDragging and QMainWindow::AllowNestedDocks are both set. [ChangeLog][QtWidgets][QDockWidget] When QMainWindow::GrouppedDragging and QMainWindow::AllowNestedDocks are both enabled, floating dock widgets acquired the ability to be dropped together side by side. Change-Id: I48765c72ef80ef15aa31b91ae582cbb01dea41d6 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | | QMainWindow: move the separator handling in another classOlivier Goffart2017-04-133-238/+254
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So it will be re-used by QDockWidgetGroupWindow The Layout template argument can be the QMainWindowLayout, or the QDockWidgetGroupLayout. They have a function dockAreaLayoutInfo which return a QDockAreaLayout* or a QDockAreaLayoutInfo*, respectively. These two class have the same interface as far as QMainWindowLayoutSeparatorHelper is concerned. (QDockAreaLayout forward most of its call to the relevant QDockAreaLayoutInfo) The code is mostly moved without modification, but there is a change in startSeparatorMove, because we don't have access to the layoutState to set the fallbackToSizeHints variable, so instead, we do that from QMainWindowLayout::hover. Change-Id: Ic5fa3ee2def3d0155195f751d4770b207732139f Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | | uic: Port Ui classes to QVectorFriedemann Kleint2017-04-136-331/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regenerate the ui4* files after a change in qttools replacing QList by QVector in the Dom* classes with the exception of QList<DomProperty *> since that affects the public interfaces of QAbstractFormBuilder. Change-Id: I0922127fb911a5abc125d93ef97a0b22ff94788a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | | qsystemtrayicon_win.cpp: Clean obsolete codeFriedemann Kleint2017-04-121-104/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No longer dynamically load API that is present on Windows 7. Increase the WINVER and related defines locally to keep MinGW 5.3 building. Remove all if clauses checking fore Windows Vista and below. Task-number: QTBUG-51673 Change-Id: I0feedb95537aea2453d48ef784f7852c4e33347f Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | | Array-backed containers: add shrink_to_fit for STL compatibilityGiuseppe D'Angelo2017-04-128-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Side note: QHash has squeeze(), but there's no shrink_to_fit on std::unordered_map. [ChangeLog][QtCore][QByteArray] Added shrink_to_fit(). [ChangeLog][QtCore][QString] Added shrink_to_fit(). [ChangeLog][QtCore][QVarLengthArray] Added shrink_to_fit(). [ChangeLog][QtCore][QVector] Added shrink_to_fit(). Change-Id: Ifd7d28c9bed70727be6308f0191a188201784f61 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QDate/Time: add toString(QStringView) overloadsMarc Mutz2017-04-126-12/+62
| | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QDate/QTime/QDateTime] Added toString() overloads taking the format as a QStringView. Change-Id: I322fa22e6b13fe8ba4badf0a3133425bd067ef32 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QLocale: add toString(Q(Date|QTime)+, QStringView format) overloadsMarc Mutz2017-04-127-22/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While at it, change the interface of qt_repeatCount() to just take a single QStringView, since QStringView::mid() is so cheap. Add some \internal docs. [ChangeLog][QtCore][QLocale] Added toString(QDate/QTime/QDateTime) overloads taking the format string as a QStringView. Change-Id: Ic078796677a6db06227c8a3e276dbdb1039ceead Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QByteArray: add missing inline keywordsMarc Mutz2017-04-111-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inline member functions that are not defined in the class body must be marked with the inline keyword. Otherwise, MinGW complains about any use of such functions before they are defined with its infamous error message: 'char QByteArray::at(int) const' redeclared without dllimport attribute after being referenced with dll linkage Fix it for all such functions. Change-Id: Iae76a7ed18e7b2d5cb5e217e154f647be4a2d9c1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | QRegularExpression: streamline some wording in the documentationGiuseppe D'Angelo2017-04-111-19/+30
| | | | | | | | | | | | | | | | | | Change-Id: Ic1adbf9358ef6fbdaaee52471cd8ed9ca895a9d0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | Add button layout for dialogs on AndroidNikita Krupenko2017-04-116-14/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It used macOS layout before, but it differs from the actual layout in Android/Material Design: affirmative actions are on the right side, dismissive actions are directly to the left of the affirmative actions and neutral actions are on the left side. [ChangeLog][Platform-specific Changes][Android] Android dialogs now have more appropriate button layout, with affirmative actions on the right. Task-number: QTBUG-58060 Change-Id: I0755f80261410c64cf4f854b7f2a72e2d959db28 Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | | QAndroidPlatformScreen: Use an event rather than a QTimerRobin Burchell2017-04-112-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It looks like the origins of this timer may come from QFbScreen. QFbScreen, however, changed away from a timer in d7068cbe1b37eb065c1902c8e944f3bc19db0ba4. There are other reasons to avoid a timer in this case, though: a timer may be pre-empted by application events (like other timers), which may mean a significant amount of time could pass between starting the timer and pushing the contents out to the actual screen (in doRedraw). This has the effect that flush becomes synchronous, which matches the behavior of the other platforms as far as I can tell. Change-Id: Ic67ae6c82945a247dceac44ee1bf7d2940f79d07 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | | QSslSocket/macOS: optimize QUuid usageMarc Mutz2017-04-101-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - don't create a QString, a QByteArray suffices - perform the mid() operation on a view type (QLatin1String), not on a container - use QStringBuilder Change-Id: Ifd74f2bc98606425f9f6cb4da8618e8066a8b12e Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | | Make QStringView::storage_type publicMarc Mutz2017-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | ... so users of QStringView::utf16() can use it, without having to revert to decltype()/auto. Change-Id: Ie09696b9354d3917914f8e2692769cfd35b01ae1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | winrt: Use hostnames for socket connectionsOliver Wolff2017-04-101-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using IP addresses does not work for every use case on WinRT. The workaround that is in place for VPN connections uses the host name directly but has the disadvantage that it: 1) does a host lookup nevertheless and ends up using the host name afterwards. 2) needs a set environment variable to be activated. Instead of doing a host lookup we now use the same approach that is used if a proxy with the HostNameLookupCapability is present. In this case the lookup is skipped and the direction is made using the hostname. The big advantage of hostname over ip addresses on WinRt is, that Windows handles everything related to lookup and proxies (it uses the system proxy in this case), so we do not have to take care of that. As the WinRT backend falls back to the "connectToHostByName" in any case no further adaptions are needed. QT_WINRT_USE_THREAD_NETWORK_CONTEXT cannot be completely removed though as the creation of the network context should not be done unconditionally. This change partially reverts e9fa435652ef064515bd5c04c0b5e5c4a30ebca4 Task-number: QTBUG-59989 Change-Id: I5dc7481b7499192641470b4b5a6642509a4b4f38 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>