summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Small fixes to the QList documentationLars Knoll2020-07-062-4/+4
| | | | | Change-Id: Ic839f7859912eb48bb192755d6f10536a0a73f8e Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Add support for first(n), last(n) and sliced() to QListLars Knoll2020-07-063-0/+102
| | | | | | | | | This keeps the API symmetric with what we have in our string classes. Change-Id: I94c5b39b718ca2472f9ca645e7a42e4314636f67 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port QString to qsizetypeLars Knoll2020-07-069-375/+360
| | | | | | Change-Id: Id9477ccfabadd578546bb265a9483f128efb6736 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use qsizetype in QListLars Knoll2020-07-0633-177/+178
| | | | | | | | | | | | | | | | | | | | The change creates a slight source incompatibility. The main things to take care of are * code using printf statements on list.size(). Using qsizetype in printf statements will always require a cast to work on both 32 and 64 bit. * A few places where overloads now get ambiguous. One example is QRandomGenerator::bounded() that has overloads for int, uint and double, but not int64. * Streaming list.size() to a QDataStream will change the format depending on the architecture. [ChangeLog][QtCore][QList] QList now uses qsizetype to index into elements. Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Help qtestlib with int -> qsizetype changesLars Knoll2020-07-061-2/+17
| | | | | | | | | | | | | | | Make sure we can handle qsizetype as an integer when appending test data. This is required for backwards compatibility with Qt 5, so people don't have to rewrite all their test cases. QCOMPARE can handle mixed types, tthe only method that requires manual changes now is QTEST(list.size(), "testrow_expecting_int"). Change-Id: I40723b239e0160cefc05745aa35a75de8599ac08 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Allow allocating more than 2G items in a vectorLars Knoll2020-07-064-97/+98
| | | | | | | | | | | Also adjust qCalculateBlockSize() to be able to handle large allocations. QVector::length() is currently still limited to 2G items, that will get changed in a later commit. Change-Id: I3a92fbfd7f281d30844c5fafa3b9a474bc347c19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement a proper iterator for QTypedArrayDataLars Knoll2020-07-062-4/+68
| | | | | | | | | | | This avoids ambiguities in our API when someone e.g. writes vector.insert(0, ...). It requires a slight workaround in qlalr, where std::search() for libc++ doesn't like that our difference_type is qsizetype. Change-Id: I40aa1040781ffbdd12d04410078207969b3bde53 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QArrayDataPointer::size a qsizetypeLars Knoll2020-07-065-12/+12
| | | | | | | | This is a next step towards making QList, QString and QByteArray able to deal with large sizes. Change-Id: Icad49b33f503401ac4912678b2f88584c6f91a63 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a couple of noexceptLars Knoll2020-07-062-15/+15
| | | | | Change-Id: I993da2094482092540388ee72be3262bac94fad7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of QArrayData::sharedNull()Lars Knoll2020-07-068-123/+22
| | | | | | | | Remove the last places where those got used and avoid allocations when we resize to 0. Change-Id: Ib553f4e7ce7cc24c31da15a55a86d18bdf1cc5c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of QArrayData::isMutable()Lars Knoll2020-07-061-11/+2
| | | | | Change-Id: Ifb6368b83cd12ec3897c6b6b846d71bffa1f74b9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of unused flags in QArrayDataLars Knoll2020-07-064-45/+13
| | | | | Change-Id: I3ea754b44fb33e33baba0781d9ae15b7f3b3d8eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid allocating a d-pointer for empty stringsLars Knoll2020-07-063-24/+15
| | | | | | | | Those can simply be handled as compile time constant strings pointing to the empty (Q)Char. Change-Id: I1f6f6ab923a30c68a720003ca68c34c572aa29da Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Simplify Q_ARRAY_LITERALLars Knoll2020-07-068-96/+21
| | | | | | | And clean up some unused pieces of code. Change-Id: I285b6862dc67b7130af66d3e08f652b1a56b990e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of shared null for QByteArray, QString and QVectorLars Knoll2020-07-0618-215/+202
| | | | | | | | | | | | | | As a side effect, data() can now return a nullptr. This has the potential to cause crashes in existig code. To work around this, return an empty string from QString::data() and QByteArray::data() for now. For Qt 6 (and once all our internal issues are fixed), data() will by default return a nullptr for a null QString, but we'll offer a #define to enable backwards compatible behavior. Change-Id: I4f66d97ff1dce3eb99a239f1eab9106fa9b1741a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: improve the range constructorsGiuseppe D'Angelo2020-07-061-4/+4
| | | | | | | | | | In case of forward iterators, call std::distance just once and not twice. In case of non-forward iterators, don't call reserveIfForwardIterator -- as the name says, it doesn't make sense on non-forward iterators. Change-Id: I7e6a603205286c05f7bc7c47fd1f1e0d92705b20 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QList: go for the rule of zeroGiuseppe D'Angelo2020-07-061-9/+2
| | | | | | | | | The hand-written special member functions did exactly what the compiler generated ones would do anyhow. Change-Id: I66439178460d30957135aac44680dd3109ada62a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Q*Iterable::const_iterator: pass by const referenceGiuseppe D'Angelo2020-07-061-2/+2
| | | | | | | | The iterators are quite heavy objects (>100bytes), don't pass them by value. Change-Id: I4c9d1f64d14419a35bd067884d7e8bca2589f9b9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Support configure -force_debug_infoJoerg Bornemann2020-07-061-0/+6
| | | | | | Task-number: QTBUG-85373 Change-Id: Ia798fc2cf715aed9157e1d9e2f64187c16e38bcf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Support build config-related configure optionsJoerg Bornemann2020-07-061-0/+21
| | | | | | | | | | This add support for the following options: -debug, -release, -debug-and-release. For the latter, the "Ninja Multi-Config" generator is auto-detected, if ninja is available. Task-number: QTBUG-85373 Change-Id: Ide0ca44e5f4c74657147e89d71e8d71c4f6a4c45 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Support -bindir, -libdir, -*dir configure argumentsJoerg Bornemann2020-07-061-0/+10
| | | | | | Task-number: QTBUG-85373 Change-Id: I0df181cb017561c3f0af5ab3fecb76008b89c0d2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Re-work configure flags for CMake generatorsJoerg Bornemann2020-07-062-5/+34
| | | | | | | | | | | | | | | | | Remove the -cmake-makefiles configure argument as its meaning was in essence "do not pass a -G argument to CMake". Instead, we add the following arguments: -cmake-generator <name> to pass -G <name> to CMake -cmake-use-default-generator to pass no -G argument to CMake If none of those arguments is given, we try to autodetect the generator. If a ninja executable is found, we prefer the Ninja generator. On Unix we fall back to "Unix Makefiles". On Windows, we do a poor man's compiler detection and select one of "NMake Makefiles", "NMake Makefiles JOM" and "MinGW Makefiles". Change-Id: Ic36669bd50956d15fbc71cee73720732cd4bfab8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Teach configure.bat the -cmake argumentJoerg Bornemann2020-07-063-104/+147
| | | | | | | | | | | | | | | | | | | | | The configure scripts need to translate configure options to CMake arguments. It is not sensible to implement this translation twice, in sh and Windows batch language, so we're doing this once, in CMake language. The configure scripts write their options into config.opt and call a CMake script that reads config.opt, does the translation to CMake arguments and calls CMake to generate the build system. While we're at it, implement some more translations than the sh configure provided, like -extprefix, -top-level and -skip. Fixes: QTBUG-85349 Fixes: QTBUG-85350 Task-number: QTBUG-85373 Change-Id: Ida5d8b2a3c178b9349d41ec76d190c69a9456e74 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Windows: Fix trailing blank in native file dialog filterFriedemann Kleint2020-07-061-1/+4
| | | | | | | | | | | Strip trailing blanks when not filtering by suffix. Amends 76735f3fa0fdf772aa4fba9a9aaa241415eaf922. Pick-to: 5.15 Fixes: QTBUG-85423 Task-number: QTBUG-42405 Change-Id: Ic13a4e7718f7f1935b1fc329a7beaf1d357fd44d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Simplify QMainWindow::setUnifiedTitleAndToolBarOnMacTor Arne Vestbø2020-07-066-38/+33
| | | | | | Task-number: QTBUG-83252 Change-Id: Ib6f7dcfe21407603d4cfd5d33f6615d8623db940 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Qmake: Share QMAKE_LINK_OBJECT_SCRIPT definitionOrgad Shaneh2020-07-063-2/+2
| | | | | | | | | | | | It is only used by default on Windows, but can be enabled by setting QMAKE_LINK_OBJECT_MAX. The current file name is .project_name. Use a sensible file name on this case. Change-Id: Ic250d024e5feca739027c79a6e285d616234c4ea Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove documentation reference to standalone KMS pluginTor Arne Vestbø2020-07-061-3/+0
| | | | | Change-Id: Idfc714340703af3faea17d2f1c4933902710f36d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* MinGW: Use a response file for long include pathsOrgad Shaneh2020-07-063-7/+28
| | | | | Change-Id: I55ce73ad08473bca27c7ab5730f633fb77c9b8cd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove OpenWFD platform pluginTor Arne Vestbø2020-07-0625-2327/+0
| | | | | | | | | | | It was added in 2011 and has not seen any development since, and was never included in the build system. The OpenWFD use-case is covered by EGLFS, which has a dedicated OpenWFD backend. Change-Id: Id08c505e2d869a96255163cae2ede51b9efeb73f Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Makefile: Deduplicate logic for response file nameOrgad Shaneh2020-07-064-40/+32
| | | | | | | + verify that the file was actually written. Change-Id: I14a3c0b75f41f926b469109a1d7f2f80368ec9bb Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Export the letter and word spacing settings set on the default formatAndy Shaw2020-07-065-1/+132
| | | | | | | | | | | | When the default format has letter and word spacing set then these should be exported in the HTML's body tag. This also adds support for the reading of letter-spacing and word-spacing set too, so that the same html outputted can be read back in. Fixes: QTBUG-83718 Change-Id: Ic4afca21eb05efb779dbf99c6b3c13373e851f15 Pick-to: 5.15 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QList instead of QVector in statemachineJarek Kobus2020-07-067-47/+42
| | | | | | Task-number: QTBUG-84469 Change-Id: I2b1399c34ebcc2237ca2662d97b54e81f11cb7af Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* qnetworkproxy_mac - do not use the deprecated APITimur Pocheptsov2020-07-061-3/+10
| | | | | | | | | | CFURLStringByAddingXXX was deprecated, so we use QUrl combined with existing QString-based converters (from/to CFStringRef). Pick-to: 5.15 Task-number: QTBUG-83992 Change-Id: I6f1a3fdafa9532bb7816a1262169df3421169cb7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QList instead of QVector in pluginsJarek Kobus2020-07-0681-264/+260
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic86f4a3000592a1c9ae62e4a83f4fe39832a6b24 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QList instead of QVector in platformsupportJarek Kobus2020-07-0612-38/+38
| | | | | | Task-number: QTBUG-84469 Change-Id: I8e4e6626cc840bc9c8bce014c595da9080025dd8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QMake: fixup a mistake when porting to QREGiuseppe D'Angelo2020-07-061-1/+1
| | | | | | | | | | The original expression seems to have been accidentally changed during the port. Amends a1947aeffe158a0ea7de3ced1bf8d6a4719a27ef. Change-Id: I87821e1e025621a5efaf7a1e4f946fd3109fb256 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use QList instead of QVector in printsupportJarek Kobus2020-07-068-32/+31
| | | | | | Task-number: QTBUG-84469 Change-Id: I540b5574e358b100a595eb1676b051dfe25cb640 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* CMake: Re-run tests in CI like we do for the qmake buildJoerg Bornemann2020-07-061-1/+1
| | | | | | | | | | The test runner re-runs failing tests up to 5 times. We did not do this for the CMake build, and now we're getting lots of flaky tests failing. Fix this by passing the -repeat until-pass:5 parameter to ctest. Change-Id: I6ff3c1e7901bc22cafec87b15d087eab2a565c65 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add QInputDevice::availableVirtualGeometry()Shawn Rutledge2020-07-063-0/+40
| | | | | | | | | | | | | | | | | | This property tells what part of the virtual desktop the input device can access. This is not a one-to-one mapping with a QScreen, because a Wacom tablet might be configured to access a whole desktop, a whole screen, or an area corresponding to the drawing area of one window; a mouse normally can access the whole desktop (so QScreen::virtualGeometry() would be identical to QInputDevice::availableVirtualGeometry()); a touchscreen normally is mapped to one screen but could be mapped differently; etc. It's possible to find the intersection of the rectangular area with the screen(s) that it overlaps, though. Task-number: QTBUG-78839 Change-Id: I9040e20fb5a3dec8a9a0dd827735826c4c1eea38 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Make QtPlatformHeaders a private moduleTor Arne Vestbø2020-07-0651-42/+185
| | | | | | | | | | | The APIs will be reintroduced as part of the new platform interface API where appropriate. Clients that still depend on the platform headers can include it via QT += platformheaders-private. Change-Id: Ifbd836d833d19f3cf48cd4f933d7fe754c06d2d9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove unnecessary ; after function implementationsLars Schmertmann2020-07-0621-63/+63
| | | | | | Task-number: QTBUG-82978 Change-Id: Iea3bcaec1ef9f4bd0f73e5dccca33354650f5bf4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Refactor tst_CollectionsLars Schmertmann2020-07-061-20/+50
| | | | | | | | | | | | | | This improves the readability and avoids code duplication in tst_Collections::forwardDeclared. Also some warnings are fixed: * qSort is deprecated. * The = operator for LargeStatic needs to be implemented explicitly when a copy constructor is given. * QMap::insertMulti is deprecated, a MultiMap is required. Task-number: QTBUG-82978 Change-Id: I577f851394edfaa30154bd3417ce391635cc546d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix a crash in QClipBoard when copying utf16 dataLars Knoll2020-07-063-27/+4
| | | | | | | | | | | | Properly use the new QStringConverter API and not an internal qFromUtfEncoded method that was buggy after the changes. Take the oppportunity to clean up and remove qFromUtfEncoded, as QClipboard was its only user. Fixes: QTBUG-85417 Change-Id: I8540d12056bf3f448c1f628ce0bd0ad462a6447d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Cleanup qtestspontaneevent.h for Qt 6Lars Schmertmann2020-07-061-41/+0
| | | | | | | | | This change is motivated by the comment from bc087db59: Qt 6: remove everything except QSpontaneKeyEvent::setSpontaneous() Task-number: QTBUG-82978 Change-Id: I5f46ca366c193c06235f88022ec22c6848fbb7b0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use Q_DECL_UNUSED_MEMBER instead of Q_UNUSEDLars Schmertmann2020-07-061-23/+19
| | | | | | | Task-number: QTBUG-82978 Change-Id: I7ff71e10b61cf5c2528ebef81cc49c648385fc33 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move linuxaccessibility to QtGuiFriedemann Kleint2020-07-0634-108/+120
| | | | | | | | Change some too-generic file names. Task-number: QTBUG-83255 Change-Id: I4497ee2508bc323566f4061d4547707b7bda7a77 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Don't propagate private defines for Qt header modulesAlexandru Croitor2020-07-051-7/+15
| | | | | | | | | | | | Interface libraries like our Qt header modules should not propagated private defines which are meant only for building a specific Qt module, and in the case of a header module there is nothing to build. Exclude the usual private defines we set in qt_add_module for header modules. This also fixes the content of header module .pri files. Change-Id: I0791ebdb73e8b020ddb8116433ed36c7b3d71303 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move xkbcommon to QtGuiFriedemann Kleint2020-07-0420-103/+46
| | | | | | | Task-number: QTBUG-83255 Change-Id: Ia1c6a49af6be4aaa6b988537c38db3a2c0a646a5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix workaround in pthread destructorMike Achtelik2020-07-041-19/+6
| | | | | | | | | | | | | | | | | Amends dcdfb6908db0f83cbc4e550859f56ee58a6b3420 which failed to take the workaround in destroy_current_thread_data into account. Since pthread_getspecific was completely replaced with the thread_local variable currentThreadData, the workaround has no effect anymore. Therefore we need to replace it with a workaround that makes sure currentThreadData is set inside of the destructor function. This prevents a leak, where QThreadPrivate::finish() tries to access the thread data, but since it already is null, recreates it without ever deleting it. Pick-to: 5.15 Change-Id: I3811d262a411a6bde9d6eb90f8d17e0bbc5de657 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix connect syntax in snippetPaul Wicking2020-07-041-1/+1
| | | | | | | | Pick-to: 5.15 Fixes: QTBUG-85390 Change-Id: I67dbacd977acb6abdafb3b57818f24bf4a2dd302 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>