summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-0713-42/+84
|\ | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/linux-icc/qmake.conf mkspecs/macx-icc/qmake.conf mkspecs/win32-icc/qmake.conf src/gui/painting/qgrayraster.c Change-Id: Ib08c45ea3215be05f986ecb3e1f4b37d209aa775
| * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-067-23/+58
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/widgets/widgets/qtabbar.cpp Change-Id: Iaa9daee5f7a6490d56257a3824730a35751ceb05
| | * GCC 7: fix -Werror=implicit-fallthroughGiuseppe D'Angelo2017-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | More fallthrough-are-errors fixed. Change-Id: I9a6cb6efe988400ed3f9cb95d1e426dac317e6c4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * Fix qReallocAligned for reallocation when alignment > 2*sizeof(void*)Thiago Macieira2017-04-041-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we call realloc, the alignment of the new block may be different from the old one. When that happens, we need to memmove the data to the new position, before we start overwriting things. Task-number: QTBUG-59804 Change-Id: I27b55fdf514247549455fffd14b07ea78918a3d0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Use fallthrough attributes only in C++ modeGiuseppe D'Angelo2017-04-031-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 7 defines __has_cpp_attribute even when invoked as "gcc" (possibly, Clang does the same, according to a comment in the code, did not test myself). Hence, define the fallthrough declaration (as C++11 attributes) only when compiling as C++, otherwise we pick them up even in C mode, and they cause build failures. Change-Id: I3f13205e014bb1dea59ee3664b29111521a7eae3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Mark to remove const from function parameters in QtCore public headersThiago Macieira2017-03-313-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some compilers are known to complain about this with a warning. GCC complains about const on return values on -Wignored-qualifiers (enabled at -Wextra), so it's not too much of a jump to assume that others do too. Besides, this is not Qt Library API policy. As maintainer for QtCore, I'm exercising my prerrogative in specifying certain unspecified parts of the coding style, like I've done for constructor initializer lists. Since all the classes involved are exported (including QVector, through derived classes), we can't remove the qualifier until Qt 6, since there are compilers known to encode the qualifier in the mangled name (suncc). I'm not introducing #ifdef to silence unknown compilers unless we get an actual complaint. Change-Id: I33850dcdb2ce4a47878efffd14a876edef843c46 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QCryptographicHash: make SHA3 calculate SHA3, not KeccakGiuseppe D'Angelo2017-03-311-12/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SHA3 family is a modified version of Keccak. We were incorrectly calculating Keccak (and even *testing* Keccak!), but claiming it was SHA3. To actually calculate SHA3, we need invoke Keccak on the original message followed by the two bits sequence 0b01, cf. §6.1 [1]. [1] http://dx.doi.org/10.6028/NIST.FIPS.202 [ChangeLog][QtCore][QCryptographicHash] QCryptographicHash now properly calculates SHA3 message digests. Before, when asked to calculate a SHA3 digest, it calculated a Keccak digest instead. Task-number: QTBUG-59770 Change-Id: Iae694d1a1668aa676922e3e00a292cddc30d3e0d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QCryptographicHash: fix documentation of the supported algorithmsGiuseppe D'Angelo2017-03-311-1/+2
| | | | | | | | | | | | | | | Change-Id: Idfa7843ef8a8e3410ae0a8cf5311b8b598299730 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Fix detection of F16C for the Intel compiler (again) and Visual StudioThiago Macieira2017-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Neither the Intel compiler nor Visual C++ have a dedicated switch to enable F16C support, like GCC and Clang do. So we used the AVX switch for that in commit 8241d51f7049d48912ce25fbd49ef4d22c58e340, as it was the closest, lowest denominator. That was incorrect and insufficient. The Intel compiler silently miscompiles the intrinsics with -xAVX, making calls to out-of-line functions like _mm_cvtps_ph, which don't exist. So we actually have to use AVX2 support to generate correct code. That might be a problem later, since Ivy Bridge supports F16C but not AVX2. Visual C++ is able to generate F16C code with just -arch:AVX. Either way, since there's no dedicated command-line switch, there's also no dedicated preprocessor macro. We're using __AVX2__ for both compilers, as that's a sufficient condition to indicate a processor that supports F16C. Change-Id: I27b55fdf514247549455fffd14b205b8d8b86da7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | f16c: Use the packed intrinsics instead of scalar onesThiago Macieira2017-04-061-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC, Apple's Clang and Clang prior to 3.9 do not recognize _cvtss_sh and _cvtsh_ss. So expand the operation to use directly the packed intrinsics. Change-Id: I27b55fdf514247549455fffd14b2046fd638593d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | QSysInfo: update the ICC warning that needs to be suppressedThiago Macieira2017-04-061-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | qsysinfo.h(235): error #1786: enum "QSysInfo::MacVersion" (declared at line 156) was declared deprecated ("Use QOperatingSystemVersion") Take this opportunity to merge the two groups. Change-Id: I27b55fdf514247549455fffd14b1c2a1d8eab869 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| * | Consider ENXIO (No such device or address) reason to check isatty()Tor Arne Vestbø2017-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aligns with EPERM (Operation not permitted) and ENOENT (No such file or directory), and is what errno is set to on macOS when opening the /dev/tty device when running inside e.g. Xcode, where isatty() will return true. Change-Id: I09b88eaa3ff611d95ab37f0ff4df9aaaca52747d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Fix warning for -no-feature-temporaryfileStephan Binner2017-04-041-0/+1
| | | | | | | | | | | | | | | | | | Change-Id: Ibb022a1fd043001f628a343dc8ae509083eb4471 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * | Fix warnings for -no-feature-settingsStephan Binner2017-04-041-0/+2
| | | | | | | | | | | | | | | | | | Change-Id: I79ce0b9c5eb931e238394519ba80bf35e4ff3bf7 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * | Fix build without features.qeventtransitionTasuku Suzuki2017-04-041-0/+2
| | | | | | | | | | | | | | | | | | Change-Id: I498d482b01d9dcaf794d35ecc26110c9a2d45ce0 Reviewed-by: Kevin Funk <kevin.funk@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | qfloat16: suppress warning caused by Clang macro we usedThiago Macieira2017-04-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang implements the _cvtss_sh intrinsic by way of a macro, which uses a C99 extension and that's not allowed in C++ mode: float16.h:119:11: error: compound literals are a C99-specific feature [-Werror,-Wc99-extensions] /usr/bin/../lib64/clang/3.9.1/include/f16cintrin.h:76:55: note: expanded from macro '_cvtss_sh' Reported at https://bugs.llvm.org/show_bug.cgi?id=32491. Change-Id: I27b55fdf514247549455fffd14b170df75dd4e1f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Port internal class QXmlUtils to QStringViewMarc Mutz2017-04-064-28/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and adapt callers. In one case, port a use of QString::toLatin1() to QStringRef:: toLatin1() so together with this change and the addition of QString::arg(QStringView) we can drop one more QStringRef::toString(). Change-Id: Iba898af8cc2a9e1a811e271789359395f595ad32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QString: add QStringView/QLatin1String overload of (non-multi) arg()Marc Mutz2017-04-064-16/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new overload directly in QXmlStream*. Saves 129B in QtCore text size on optimized GCC 6.1 Linux AMD64 builds, even though we added two more functions. [ChangeLog][QtCore][QString] Added arg(QStringView), arg(QLatin1String) overloads. Change-Id: Idf7236dcab763824593f34182e4e0b16b5ed4321 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QText{En,De}coder: mark ctors explicitMarc Mutz2017-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | C++11 allows these to be called implicitly. Change-Id: Ife62ce4df4c294623e84fb0c0751ae9b4f6d1020 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QTextCodec: add QStringView overloadsMarc Mutz2017-04-062-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QTextCodec] Added fromUnicode() and canEncode() overloads taking QStringView. [ChangeLog][QtCore][QTextEncoder] Added fromUnicode() overload taking QStringView. Change-Id: I2599f25570480d967921ccd4414e092bfc90d821 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QStringView: fix ambiguity between f(QString)/f(QStringView) with ↵Marc Mutz2017-04-061-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QString::null args ... by removing the QStringView(QString::Null) ctor. This means that QStringView(QString::null) will now fail to compile. That's ok, since we've deprecated QString::null in the last Qt version. This will also help pulling up the QStringView definition to before the QString one in qstring.h, something that we'll require for properly adding QStringView-append/prepend/insert to QString. Change-Id: I3c836732be1e185111b13950be9d8dcd935734ff Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QStringView: use qssize_t as size_typeMarc Mutz2017-04-064-30/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nothing changes, we've just given 'QIntegerForSizeof<size_t>::Signed' a better name in qglobal.h and now use it in QStringView API and users. Change-Id: Ibea1ae26e95b3a96708400fd4b0cd120459d57b6 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | doc: Prevent overwrite of qbytearray.htmlMartin Smith2017-04-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A use of Q_GLOBAL_STATIC() tricked clangqdoc into thinking it created something called QByteArray that should be documented, so the html generator tried to overwrite qbytearray.html which had already been created for the real QByteArray. This probably means there is a bug in the clang visitor class, but I can't see it, and this change eliminates 4 qdoc errors. Change-Id: Iee333217212ce60727cd9424a19b8e96a20547b4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Fix some issues with the QStringView docsMarc Mutz2017-04-051-6/+4
| | | | | | | | | | | | | | | Change-Id: Ibb6fed18c6b7aa23ffc259dc66d22d4ff0372ca0 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Use (new) QStringIterator(QStringView) to avoid castsMarc Mutz2017-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the only one in QtBase that casts to be able to use QStringIterator. Amends d40dcee642c69784f771aae86531ae65b458f1a5. Change-Id: I709e0285717e8d17feab9ab0020c8d0aed0dbe36 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Mark some more functions with Q_DECL_CONST_FUNCTIONGiuseppe D'Angelo2017-04-054-39/+39
| | | | | | | | | | | | | | | | | | | | | Saves a mere 300byte of text. Change-Id: Ibc87a395af83757e855477a57e48e1e190504757 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QStringBuilder: add support for (non-const) char*Marc Mutz2017-04-041-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's support for const char[] and char[], so it seems this was simply forgotten. [ChangeLog][QtCore][QStringBuilder] Added support for (non-const) char*. Change-Id: I4b5d9039632da7721256579b7741816027321a7e Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/devLiang Qi2017-04-0415-98/+104
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-0415-98/+104
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h src/plugins/platforms/xcb/qxcbwindow.cpp Change-Id: Ic747c3c50e68c005b425e7a1ec2a90965527c8bd
| | * | QStringBuilder: simplify QConcatenable<char[N]>Marc Mutz2017-03-311-18/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by delegating to QConcatenable<const char[N]>. The only thing that varied was the nested type alias 'type', which therefore got retained. Change-Id: I202f899034e1ddd23c6d1978a31be5eb7c195697 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Prefer rvalue versions of toLatin() and toUtf8()Anton Kudryavtsev2017-03-306-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... to re-use existing buffers. Change-Id: I7c42529b8cd4400520a59e658ab76f4f8e965cd4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Use QStringBuilder moreAnton Kudryavtsev2017-03-301-2/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: If5283e364e921d99ffa7a8fa1abb07356a4a2682 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | Use case-insensitive compare moreAnton Kudryavtsev2017-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... to avoid allocations. Change-Id: I5993633d1509495ff6ce3a11274a53504aac7c5e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Core: Replace LGPL21 with LGPL license headerKai Koehne2017-03-284-53/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also use canonical contact url. Change-Id: I43f8c6a2c4949ee0e054045bccc17d82575b072c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| | * | Prefer rvalue versions of toLower() and toUpper()Anton Kudryavtsev2017-03-282-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... to re-use existing buffers. Change-Id: Ib2bc938f1cf0451c1dbc012b3db022b878e987cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | QMimeGlobPattern: init all members only onceAnton Kudryavtsev2017-03-281-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by initializer list. Change-Id: I39d2f933dac171273f500963eb47ffa9165978de Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Fix crash when QUrl::from{NS/CF}URL() was passed a nullptrTor Arne Vestbø2017-03-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ib193447c4a91dd3d08746e97727f7d4764f33d80 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | QRegularExpressionMatch: add QStringView-related functionsGiuseppe D'Angelo2017-04-042-12/+144
|/ / / | | | | | | | | | | | | Change-Id: Ia81ba131cc2c7f56acb3312fbc7d62ffe5e18da4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QStringView: add an array ctorMarc Mutz2017-04-042-9/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | With sufficient enable_if magic, the array ctor can overload the pointer ctor and statically determine the size of the array passed. Consequently, remove the sizeof in QStringViewLiteral again. Change-Id: I486baa3cafefde60ccc5f2b47eb94ee53cefe63c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QStringIterator: port to QStringViewMarc Mutz2017-04-033-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pretty straightforward, as the implementation already used only an iterator range internally. Change-Id: I6e6b809329e2e2548bba6db414a3d107d09637d1 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Add QMetaObject::invokeMethod() overloads for function pointersBenjamin Terrier2017-04-024-80/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new overloads do not accept parameters for the invoked function, this use case is handled by using lambda. Overloads for non member function pointers and functors are separated as the return type is not retrieved in the same way. Move QSlotObjectBase, QSlotObject and QFunctorSlotObject from qobject_impl.h to qobjectdefs_impl.h in order to make them available in qobjectdefs.h. Update autotests of previous overloads because of a soft break in source compatibility: passing null literals (0, NULL, nullptr, etc.) for the second parameter of invokeMethod() is not supported anymore. [ChangeLog][QtCore] Added QMetaObject::invokeMethod() overloads for function pointers. Task-number: QTBUG-37253 Change-Id: I6fb67e086d315ae393ce32743c4eb1abd6cc9139 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix up QAppleRefCounted APIJake Petroules2017-04-012-22/+19
| | | | | | | | | | | | | | | | | | | | | | | | - Add proper move semantics. - Use better variable names. Change-Id: I9d13e4474414593a451d3ccf34c034cb7ab7f60d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add QAppleRefCounted template as the base of QCFTypeJake Petroules2017-04-011-19/+25
| | | | | | | | | | | | | | | | | | | | | | | | This helps to reduce code duplication as it will be used as the basis of other reference-counted RAII template classes in the future. Change-Id: I6e7e32373ec738f68d960afc759213610232b9bf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QProcess::startDetached: support nativeArguments on WindowsJoerg Bornemann2017-04-011-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The non-static method QProcess::startDetached now supports nativeArguments. [ChangeLog][QtCore][QProcess] Added the ability to specify native arguments for detached processes on Windows. Task-number: QTBUG-52405 Change-Id: Ic97c55caac7c1156e1412322000c1e40d80bdbbb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Simplify QFSFileEngine code: QFile does not require bufferingThiago Macieira2017-03-313-96/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We still support buffering via stdio.h (FILE*), but QFSFileEngine itself is not responsible for the buffering. Opening by file name (not FILE* and not file descriptor) already added the Unbuffered flag. Change-Id: I2bc52f3c7a574209b213fffd1498d4e3f78fe1bf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QProcess::startDetached: support custom process environmentJoerg Bornemann2017-03-312-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting a detached process with a custom process environment can now be achieved by: QProcess p; p.setProgram("foo"); p.setProcessEnvironment(myEnv); p.startDetached(); [ChangeLog][QtCore][QProcess] Added the ability to set a custom process environment for detached processes. Task-number: QTBUG-2284 Change-Id: I49406dffb64fa2aed41ea05cb271bd42eeabb729 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Simplify Unix implementation of QProcess::start{Process|Detached}Joerg Bornemann2017-03-312-65/+28
| | | | | | | | | | | | | | | | | | | | | | | | Use QStandardPaths::findExecutable instead of duplicated implementations. Change-Id: Ia944f1d343d8c215fc2b6e78dae6b2bfffbba688 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add non-static QProcess::startDetachedJoerg Bornemann2017-03-315-21/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The three static QProcess::startDetached overloads support a limited number of features: program, arguments and working directory. To support more features of QProcess (without adding a plethora of overloads) we add a non-static method startDetached that can be used as follows: QProcess p; p.setProgram("cat"); p.setArguments("meow"); p.setWorkingDirectory("/tmp"); if (!p.startDetached()) qWarning("Cannot start process."); We plan to add support for nativeArguments, processEnvironment, standard{Output|Error}File and maybe more in subsequent commits. [ChangeLog][QtCore][QProcess] Added non-static QProcess::startDetached to support more features for detached processes. Task-number: QTBUG-2058 Task-number: QTBUG-2284 Task-number: QTBUG-37656 Task-number: QTBUG-52405 Task-number: QTBUG-57687 Change-Id: If6fdd57ecb28cd13aa5fff566216a4177f81d339 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* | | QStringView: add mid(), left(), right()Marc Mutz2017-03-312-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If1d2cf175d51b3c02881e21937b0a2d33b78aadd Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Port QResourceRoot::mappingRootSubdir() to QStringSplitterMarc Mutz2017-03-301-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code here performs a std::mismatch() on the normalized parts of 'root' and 'path', returning whether 'path' is a prefix of 'root'. If 'path' is a proper prefix of 'root', returns the first 'root' part after 'path', in '*match'. Instead of using QString::splitRef(), perform the splitting as we go, using this class' own tool, QStringSplitter. The goal here is to avoid the heap allocation caused by the QVector return of splitRef(), of course. But even though using QStringSplitter means the splitting is now purely inline, text size in optimized GCC 7 Linux AMD64 builds increases by only 24B. Change-Id: I396cc6a30306940220c9e783c31506e6ac17b784 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>