summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* darwin: Add Foundation conversion functions for QRect/QRectFTor Arne Vestbø2016-06-1015-47/+80
| | | | | | | | | | The fromCGRect function was left out for QRect, as the foundation type is using CGFloats internally. Clients should use an explicit QRectF::toRect() when potentially throwing away precision. Change-Id: I0d4c5c5a4e6a45ea3287e3f37a00b69b0bfdefcf Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Add move constructor to QDateTimeThiago Macieira2016-06-102-2/+26
| | | | | | | | | | | | | | | | | The move constructor is slightly more interesting than the copy constructor because we can reset other to a short data state on 64-bit systems. The assembly of that function is simply: mov (%rsi),%rax mov %rax,(%rdi) movq $0x1,(%rsi) retq The move-assignment operator for QDateTime was already there. There's no need for one for QDateTime::Data since it's never called. Change-Id: I06bae9392f534e45b3f1ffff144dffdd7f23b170 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Allow QDateTime to shrink back to short data mode on copyThiago Macieira2016-06-101-5/+30
| | | | | | | | | | We won't shrink on manipulation when we have memory allocated, but it's a good idea to create a non-shared copy if we can. It's an unlikely scenario, though, because it requires the QDateTime object to have been set to a large state then manipulated back into a small state. Change-Id: I06bae9392f534e45b3f1ffff144dfee755bafa01 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move the QDateTime file static functions to their right placeThiago Macieira2016-06-101-178/+170
| | | | | | | | | The file has an organization, so let's follow it. This commit has no other changes besides moving code around. Change-Id: I06bae9392f534e45b3f1ffff144e0b1f6dd72622 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Long live the short QDateTime optimizationThiago Macieira2016-06-103-75/+280
| | | | | | | | | | | | | | | | Well, maybe not for so long: we may want to revisit it for Qt 6. At the very least, we should enlarge the size of QDateTime on 32-bit system so that they too can benefit from the optimization. With this optimization, on 64-bit systems, the most common uses of QDateTime now no longer allocate memory at all. The range is slightly reduced from 584,554,049 years to 2,283,414 years around 1970. The other drawback is that calling QDateTime::offsetFromUtc() on a localtime now needs to recalculate the offset, instead of using the cached offset. (QDateTime::toMSecsSinceEpoch() didn't use the cache). Change-Id: Id5480807d25e49e78b79ffff144a8b2c9af91814 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDateTimePrivate refactor: static'fy the date/time manipulatorsThiago Macieira2016-06-102-86/+91
| | | | | | | | | | | | | | | This commit moves QDateTimePrivate functions setTimeSpec, setDateTime, getDateTime, checkValidDateTime and refreshDateTime outside the class. Like the previous commit, this is done in preparation for the "Short QDateTime Optimization" as the "msecs" field will be placed in the short data, if possible. By making them file-level static, this also improves code generation, as the compiler doesn't know whether it has to emit the class members for out-of-line use or not. Change-Id: I06bae9392f534e45b3f1ffff144df4d73cbc9184 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDateTimePrivate refactor: static'fy access to d->m_statusThiago Macieira2016-06-102-89/+109
| | | | | | | | | | | This commit changes most accesses to the d->m_status (including d->spec() and d->setSpec() uses) to use new static functions. This is done in preparation to the "Short QDateTime Optimization" as the status byte will be kept in the short data. Change-Id: I06bae9392f534e45b3f1ffff144dbd795d03227a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Refactor & simplify QDateTime::setMSecsSinceEpochThiago Macieira2016-06-101-13/+20
| | | | | | Change-Id: I06bae9392f534e45b3f1ffff144df5ce1aa52636 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Refactor & simplify QDateTimePrivate::refreshDateTime()Thiago Macieira2016-06-101-31/+25
| | | | | Change-Id: I06bae9392f534e45b3f1ffff144df51ae6159a97 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Simplify the QDateTimePrivate::setTimeSpec() functionThiago Macieira2016-06-101-16/+11
| | | | | | Change-Id: I06bae9392f534e45b3f1ffff144df36cc98b5f3f Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDateTime: fix the massageAdjustedDateTime differentlyThiago Macieira2016-06-101-16/+6
| | | | | | | | | Instead of using a macro for maybe passing an extra parameter, pass the d pointer and let the function decide what to use and what not to use. Change-Id: I06bae9392f534e45b3f1ffff144dbeb68a30cb48 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move QDateTimePrivate::toMSecsSinceEpoch() code into QDateTimeThiago Macieira2016-06-102-35/+27
| | | | | | Change-Id: I06bae9392f534e45b3f1ffff144dbad485814779 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove QDateTimePrivate::isNull{Date,Time}()Thiago Macieira2016-06-102-7/+5
| | | | | | | | | | They're superfluous, since b491fab02a6a67fcd18d8076ac802d2f8c4f6972 removed the distinction between null and invalid. Just use the isValidXxx equivalents. Change-Id: I06bae9392f534e45b3f1ffff144db9badad010fd Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Stop QDateTimePrivate from inheriting QSharedDataThiago Macieira2016-06-102-6/+7
| | | | | | | | | | | | | | | | | | | | | | We're going to have to stop using QSharedDataPointer because of the upcoming short-datetime-optimization. By dropping the inheritance, I am also able to rearrange the members and remove the padding hole that existed. The second padding hole was removed in the previous commit, which merged two 32-bit fields into one. On 64-bit systems, there's no way around a remaining 4-byte hole somewhere due to the odd number of 32-bit members. I chose to leave it in the middle of the struct, before the m_timeZone member, instead of tail padding, so that the layout of the first members structure are the same in bootstrapped and non-bootstrapped builds. That should help debugging the bootstrapped tools in Qt Creator. It's also now the same in 32- and in 64-bit systems. Change-Id: Id69569111e7d4e619e22ffff144b1fba708885f7 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDateTimePrivate: merge the time spec, DST status and validity flagsThiago Macieira2016-06-103-53/+63
| | | | | | | | | | | | Storing them in a single byte is the first step towards the Short QDateTime Optimization. The bump in the "private version" by 10 is to accommodate possible changes in the Qt 5.7 branch. Change-Id: Id5480807d25e49e78b79ffff144a59420457bcf0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* add QTest::createTouchDevice()Shawn Rutledge2016-06-102-0/+12
| | | | | | | | | This enables creation of autotests which use touch events, without using private API. Task-number: QTBUG-44030 Change-Id: If8fe89f8423aaafd9e6501e231c33580b9365eb8 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* QString: use new QL1S::at() in lastIndexOf()Anton Kudryavtsev2016-06-091-2/+2
| | | | | | | | | Make overloaded lastIndexOf() functions more homogeneous. Change-Id: If45aac88b43d26baf7f93caec3662a1085e26b97 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove QWidgetBackingStore::fullUpdatePendingAllan Sandfeld Jensen2016-06-092-21/+4
| | | | | | | This was no longer used and always false. Change-Id: I981055e6cc736cfe3432914c173c8b3edc31b46e Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Aarch64: vectorize ascii de-/encoding.Erik Verbruggen2016-06-091-1/+72
| | | | | | | | | | | This works only on Aarch64, because the vaddv instruction is only available on 64bit ARM. Doing something equivalent on 32bit ARM has the high chance to run into micro-architecture differences: on an Cortex-a8, transferring a single vector element from NEON to the regular CPU registers takes 20 cycles(!). Change-Id: Iccbfe84da82abb9b10f3f3dc35c8b950df69e251 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fixed a bug where IM reported wrong anchor rectangleJan Arve Saether2016-06-091-1/+1
| | | | | | | | | | The problem was that in some cases, the cursor position was used to calculate the anchor rectangle instead of the anchor position. This caused selection handles to be shown at the wrong position. Change-Id: I8d866b644fc3c4d530529b7f468d16ae1088cd98 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* QElapsedTimer: Remove legacy code dealing with Windows pre-Vista and CEThiago Macieira2016-06-081-39/+10
| | | | | | | | | | | | | | | GetTickCount64 is available on Windows Vista and WinRT. Since Windows CE is no longer supported on dev, we don't need to dynamically resolve the function anymore. What's more, QueryCounterFrequency is documented to never fail since Windows XP, so we haven't needed GetTickCount64 for years (no clue when we dropped support for Win2k). Change-Id: I115db302eb114bed8cd1fffd14558a81353d2aed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringRef: add missing relational operators against QByteArrayMarc Mutz2016-06-082-0/+38
| | | | | | | | | | | | | | | | | | | | | QStringRef op QByteArray was ambiguous between bool QStringRef::operator op(const char*) const bool operator op(const QStringRef&, const QString&) QByteArray op QStringRef was ambiguous between bool operator op(const QString&, const QStringRef&) bool operator op(const char*, const QStringRef&) Fix by providing more overloads. [ChangeLog][QtCore] Disambiguated the relational operators comparing QByteArray with QStringRef (and vice versa). Change-Id: I1cfa9ecfdd8b4102e652593faf35f6098289bc34 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QString: fix QChar <> QLatin1String relational operators for non-US-ASCIIMarc Mutz2016-06-081-3/+3
| | | | | | | | | | | | | The implementation used the QString::compare_helper(QChar*, int, char*, int) overload, which, however, interprets the rhs as a UTF-8 sequence, not as Latin-1. Fix by using the (QChar*, int, QLatin1String) overload. Extend the test to cover this case, too. Change-Id: I59b26d63d0caec036b80ef8818c75d0cebe519d2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QSysInfo code related to unsupported versions of Windows.Jake Petroules2016-06-081-111/+13
| | | | | Change-Id: Ia28f17146d61724dbea73939793dfbd503546e56 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSharedPointer/QWeakPointer/QScopedPointer: add comparison against nullptrGiuseppe D'Angelo2016-06-085-0/+206
| | | | | | | | Some constructors were added, but the comparison operators were missing. The STL has them, so we ought have them too. Change-Id: I030c14a3b355988f509716b4b1b1a835b3ab9481 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Use built-ins for qPopulationCount on MSVC and recent Clang versions.Erik Verbruggen2016-06-081-23/+52
| | | | | Change-Id: Ib7e5f1129dda664d81f8a59bfa851ae70ef04542 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Set ssl in QT_CONFIG when openssl is enabledLars Knoll2016-06-081-29/+29
| | | | | | | | Makes things symmetrical with the windows configure and cleans up the logic in ssl.pri Change-Id: I4a373afe78e904de7d04baea38c250ff0c9d5062 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QSharedPointer/QWeakPointer/QScopedPointer: plaster API with Q_DECL_NOTHROWGiuseppe D'Angelo2016-06-072-34/+33
| | | | | | | Some methods were already marked, this adds noexcept to even more methods. Change-Id: I420bb1cc985058c7976ce3a1f251fadbba7ddceb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Make QCryptographicHash a Q_GADGET.Richard J. Moore2016-06-071-0/+3
| | | | | | | This makes the hash algorithm play nicely with qDebug. Change-Id: I6db651cd5c73e8be65442dd68d6b865dcb975f4c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix Infinite loop in QGraphicsScene::focusNextPrevChildJoão de Deus Morgado2016-06-071-1/+3
| | | | | | Task-number: QTBUG-42915 Change-Id: Ie380e0d77453bcdb68e92dcffe8278f169da27bc Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Simplify Foundation conversion function documentationTor Arne Vestbø2016-06-061-25/+22
| | | | | | | | The \fn command to specify the function signature is not needed when the documentation precedes the function itself. Change-Id: I9de0d1ae73af443f0beded77538d62cea85b5e72 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Remove obsolete a.out code after QT_AOUT_UNDERSCORE is goneRalf Nolden2016-06-061-12/+1
| | | | | | | | | | Old versions of OpenBSD and NetBSD mkspecs had the QT_AOUT_UNDERSCORE define declared in their qplatformdefs.h to support systems still using a.out format. As those systems are long obsolete and the defines are removed, remove the obsolete code, too. Change-Id: Ia9e2f2d6de81fb182ef4c995b29062afe570b8b9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove all code paths related to unsupported Apple platforms.Jake Petroules2016-06-0422-710/+174
| | | | | | | | | Now that the minimum deployment target (and thus SDK) is 10.9 for OS X and 7.0 for iOS, all code paths affecting platform versions lower than the aforementioned are removed. Change-Id: Id985c7259c4ac069319d88f2c29c9559ae9e8641 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* QObject::connect: reduce generated code size for statics and functorsThiago Macieira2016-06-031-9/+7
| | | | | | | | | | | Instead of placing the assignment of false in the impl() function, move it to the inline QSlotObjectBase::compare() function. That means it's assigned in one place (two, actually, inside qobject.cpp), instead of for every static member, non-member or functor we connect or disconnect. Change-Id: I87e17314d8b24ae983b1fffd1453623ad4c4dcb2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Add Q_FLAG for QDBusServiceWatcher::WatchMode.Volker Krause2016-06-031-0/+1
| | | | | | | This is needed for generic property access to work correctly. Change-Id: I76613ace730985001fc5fe1bb1b3fa5c6a8bdf70 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Install some eglfsdeviceintegration headers, as a private moduleGiulio Camuffo2016-06-0347-171/+236
| | | | | | | | This allows external integrations to be developed against it. Also uniforms all class names as QEglFSFoo. Change-Id: I72ff37c0fcdf1ccd37110b4c36874d6c99b2e743 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Windows: stop using _beginthreadex on regular buildsThiago Macieira2016-06-022-37/+13
| | | | | | | | | | | | | | | | | | | | | | | This commit also reverts fecaa6aae83a3ffa8f1fd41c5aa8275a1bfa7c9b. The Microsoft documentation says _beginthreadex and _endthreadex are used to initialize the C/C++ runtime and are necessary when linking to libcmt(d).lib (that is, when using the -MT or -MTd options). For regular builds linking against the .dll runtime, there should be no impact. Inspection of the CRT source code which gets installed with Visual Studio or Windows SDK proves that. It's preferable to use CreateThread directly as _endthreadex will try to call FreeLibraryAndExitThread, which can cause a deadlock if we try to wait for the thread to exit from a global destructor. For -MT builds, since there can be no DLLs, it's not a problem to continue to use _beginthreadex and follow Microsoft's recommendation. Task-number: QTBUG-53031 Change-Id: Id5480807d25e49e78b79ffff144af62c3c59dfe0 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove reliance on QSysInfo::[Mac|Windows]Version in QSysInfo itself.Jake Petroules2016-06-021-51/+103
| | | | | | | | Those enumerations and their associates are being deprecated, and so the backing of their replacements cannot rely on it. Change-Id: Id544aa757313065f435b5e66cd0475975cd5b825 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Simplify constructor code of QTemporaryFile.Friedemann Kleint2016-06-022-19/+13
| | | | | | | | Pass the name as parameter to the constructor of QTemporaryFilePrivate and use delegation in the convenience constructors. Change-Id: I4087600b804fe22910b4985a59a02547f54a6acd Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove Windows CE vestigesJoerg Bornemann2016-06-025-19/+2
| | | | | | | | Remove every usage of the _WIN32_WCE macro outside of 3rd party source code directories. Change-Id: Ia7e859bd6dcaef10c66674612c8e440f9a2dee56 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Properly forward-declare the Apple types with Q_QDOCOlivier Goffart2016-05-315-9/+9
| | | | | | | | | They are needed for the header to be parsed properly with clang based qdoc. While we are at it, change the condition from Q_OS_MAC to Q_OS_DARWIN Change-Id: I2a2f9c1159f47795d9811023d67c86fec1866846 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Remove _bit_scan_{forward,reverse}Erik Verbruggen2016-05-315-94/+144
| | | | | | | | | | Use qCountTrailingZeroBits and qCountLeadingZeroBits from qalgorithms.h instead. Also extended these versions for MSVC. The _bit_scan_* versions stem from a time before the glorious days of qalgorithms.h. A big advantage is that these functions can be used on all platforms. Change-Id: I5a1b886371520310a7fe16e617635ea335046beb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove checkEvent function no-one usesAlbert Astals Cid2016-05-312-19/+0
| | | | | | | | It was confusing me until i found we have another one so i think it makes sense to remove it if no-one uses it. Change-Id: I49bdb8d795f7617c193c8b62690ee34dc154d2f8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix unimplemented Mach-O parsing for ARM64 platforms in QPluginLoader.Jake Petroules2016-05-301-0/+3
| | | | | Change-Id: I4853b5ce1691bd84578ebe46af9f73270598387a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clang: remove the QT_NO_RTTI macro declarationThiago Macieira2016-05-291-3/+0
| | | | | | | It's not used anywhere in Qt and this was the only definition. Change-Id: Id69569111e7d4e619e22ffff144daa82a1259cbd Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Remove the Clang __has_feature(cxx_exceptions) checkThiago Macieira2016-05-291-5/+0
| | | | | | | | The check in qglobal.h for __EXCEPTIONS is enough. This check here was causing moc to define QT_NO_EXCEPTIONS Change-Id: Id69569111e7d4e619e22ffff144daa661df4181d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Expose QFileSelectorPrivate::selectionHelper()J-P Nurmi2016-05-272-5/+8
| | | | | | | | Let QQuickStyleSelector in Qt Quick Controls 2 re-use the same selection helper implementation. Change-Id: I34cbba0aa178e342bb4004313e7ff56811e6be19 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Add QLineF::center() returning the point in the center of the lineLorenz Haas2016-05-272-0/+37
| | | | | | | [ChangeLog][QtCore][QLine/QLineF] Added center(). Change-Id: I6dcfa9e839190c0a4caf36fb6ecd01b37d65d274 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Doc: Fix documentation warnings for QSslDiffieHellmanParametersTopi Reinio2016-05-261-8/+2
| | | | | | | | | | | qssldiffiehellmanparameters.cpp:107: warning: Unknown command '\encoded' qssldiffiehellmanparameters.cpp:131: warning: Unknown command '\device' qssldiffiehellmanparameters.cpp:276: warning: Cannot find 'operator!=(...)' in '\fn' bool QSslDiffieHellmanParameters::operator!=(const QSslDiffieHellmanParameters &other) const Change-Id: Ieb0f27f0c01c799323f4b69b7f2474513c67d443 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Squeeze more vectorized rounds out of JSON Latin1String conversion.Erik Verbruggen2016-05-261-2/+2
| | | | | | | | E.g. for a string of length 16, with i == 0, this loop can still run. Same for the case where length is 8. Change-Id: Ie95832b50ddeba2e0dfb0e3308e4c7a5376bb969 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>