summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* QDnsLookup/Unix: make sure we don't overflow the buffer6.5.1Thiago Macieira2023-05-161-6/+25
| | | | | | | | | | | | | | | | | | | | The DNS Records are variable length and encode their size in 16 bits before the Record Data (RDATA). Ensure that both the RDATA and the Record header fields before it fall inside the buffer we have. Additionally reject any replies containing more than one query records. [ChangeLog][QtNetwork][QDnsLookup] Fixed a bug that could cause a buffer overflow in Unix systems while parsing corrupt, malicious, or truncated replies. Change-Id: I3e3bfef633af4130a03afffd175e4b9547654b95 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> (cherry picked from commit 7dba2c87619d558a61a30eb30cc1d9c3fe6df94c) Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> (cherry picked from commit a2dc11b37fd71f785c342c40549f54edfdd1a6f8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Check if next property in the list is not empty before adding a commaAlexey Edelev2023-05-141-0/+3
| | | | | | | | | | | | Property merging genex only checks if previous value is not empty, but doesn't check if an actual value that we concatenate is not empty too. Add the check to make sure we don't have trailing comma in the json lists. Fixes: QTBUG-112885 Change-Id: I1a5265ddf1b12f763650daf3c6e3538ed52a1674 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit a3cb388eaa6f50ce70e96bd413a19da5dc7c906c)
* wasm: fix qtloader.js container element regressionMorten Sørvig2023-05-141-24/+10
| | | | | | | | | | | | | | | | | | | | As of Qt 6.5 the html document should not create canvas elements directly, but instead create div container elements and let Qt create and manage the canvas elements. However, qtloaders.js has not been updated to match this and is still creating canvas elements when given div elements. Remove the canvas creation code and invert the primary and fallback case: config.containerElements is now passed to instance.qtContainerElements. config.canvasElements is copied to config.containerElements, if set. Change-Id: I7372db93ee4de5b23a0a5d992597a3fbd9711a33 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> (cherry picked from commit 417b61b0158def614f4079761f85ccba39fba587) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add XML, Json, CBOR examples to IO categoryKai Köhne2023-05-115-0/+5
| | | | | | | | | Task-number: QTBUG-112372 Change-Id: I867bd33ff08629e03b35eccd4b7418573abe7c68 Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 0de3a17394e947bb04de0a004bb18f7533acfbb6) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Use boolean to indicate QTableWidgetItem is header itemAntti Määttä2023-05-103-10/+27
| | | | | | | | | | | | | | | | QTableWidgetItem uses additional enum flag ItemIsHeaderItem which has the same numerical value as ItemFlag ItemNeverHasChildren. This causes conflict since the user can set the latter flag using the setFlags, while the ItemIsHeaderItem is only used internally to mark header items. Remove the additional flag and use boolean instead to fix the conflict. Fixes: QTBUG-113209 Change-Id: Icff549c7e452d9f84575a524361719204817274e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit fa67cd03342ebe72b0438a0383c69105c5e5870b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Clear event dispatcher interrupt before running NSAlert modal sessionTor Arne Vestbø2023-05-101-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the event dispatcher is interrupted we propagate the interrupt to lower event loop levels, in case they too need to be interrupted. And we defer the actual interrupt of the NSApplication to the next time we process Qt events, to avoid AppKit dropping queued events on the floor. This logic relies on QCocoaEventDispatcher::processEvents() setting the interrupt flag to false, which signals that we should not continue to tear down any further event loops. Unfortunately, native run loops such as running application modal sessions, are not driven by QCocoaEventDispatcher::processEvents(), so we never reset the interrupt, and end up ending the session immediately. To work around this we need to explicitly clear the interrupt flag before starting native modal sessions. This also fixes the issue seen in QTBUG-111524 with showing native alerts from nested event loops. Fixes: QTBUG-112697 Task-number: QTBUG-111524 Change-Id: I6aaec97011fd18c4a513c1dde3173b1cc4d50112 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit dcff882f30603dfeb91fbbb678bc053bfa453ed4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update download location for Harfbuzz as wellEskil Abrahamsen Blomfeldt2023-05-091-1/+1
| | | | | | | | | | | | | | This amends 151287fb5182b45736da6b2e2e516bb54e44219a. qt_attribution.json now has the download link for the Harfbuzz version used. It was for the wrong version before, but now it should be correct. Task-number: QTBUG-113352 Change-Id: If79f6a814d909e687c8371aa0948b11b88f3d14b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 2bd610ed1297be565309aec54067d65dfe868e71) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix specific overflow in qtextlayoutAllan Sandfeld Jensen2023-05-092-3/+23
| | | | | | | | | | | Adds qAddOverflow and qMulOverflow definitions to QFixed Fixes: QTBUG-113337 Change-Id: I13579306defceaccdc0fbb1ec0e9b77c6f8d1af9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 7b7a01c266b507636eab51a36328c7c72d82d93c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Hsts: match header names case insensitivelyMårten Nordheim2023-05-092-2/+8
| | | | | | | | | | | | Header field names are always considered to be case-insensitive. Fixes: QTBUG-113392 Change-Id: Ifb4def4bb7f2ac070416cdc76581a769f1e52b43 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 1b736a815be0222f4b24289cf17575fc15707305) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix hiding in QComboBox when there is no selectionVolker Hilsheimer2023-05-082-19/+54
| | | | | | | | | | | If there is an effect on the selected item we want to show it, but if there is no item to highligh we just close the combo. Fixes: QTBUG-113311 Change-Id: I287af75d27e6f6ff969e4706e16cc8c4812129ea Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a43ca591c1835c27fd2acd63298c42f51b470f8e)
* Normalize paths using std::filesystem::weakly_canonicalAlexey Edelev2023-05-051-1/+1
| | | | | | | | | | | | | std::filesystem::weakly_canonical resolves symbolic links in paths. This allows syncqt to work with paths that are symbolic links and real paths. Fixes: QTBUG-113295 Change-Id: Ie7478b4accf279e8abf9f3849d18807cee99f085 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 4fa6cd8ceafc4cd70ca18363b37398da4b576aaf) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Update public suffix listMårten Nordheim2023-05-054-4519/+4252
| | | | | | | | | | | The removed testdata is no longer valid because their entries were removed from the list. Fixes: QTBUG-113339 Change-Id: I34bd56394ab3c0ef2f930d5b21c3fe1089262dbd Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> (cherry picked from commit a443b5f2ecd0b3c53c4ffaaa5cec03d16a716dd4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QTabBar: don't overshoot when scrolling rightVolker Hilsheimer2023-05-053-14/+33
| | | | | | | | | | | | | | | | | | | | | Amends ca15f650a1a914bb9a41131109c46c4e52c5ebb1, after which scrolling right to fill any gap might have resulted in overshooting to a negative scrollOffset. When we scroll right to fit the current tab, then we never want to end up with a negative scroll, so clamp the result accordingly. Augment test case accordingly. Since some styles align the tab bar in the center, replace the calculation of the scroll offset with access to the private data member (which inverts the sign when compared to the calculated value). Task-number: QTBUG-113140 Fixes: QTBUG-113376 Change-Id: Ibdc6686b9dbd41b1ae3560e2227fa121d9b20e18 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 2434573f5e4d0ca96a6a5808f3e0191012f83819) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not use REALPATH when collecting Qt header filesAlexey Edelev2023-05-051-2/+0
| | | | | | | | | | | | | | | | CMake doesn't resolve REALPATH for the non-existing files. This limitation blocks the use of REALPATH when collecting the generated module header files. The real path should be resolved by syncqt implicitly and CMake scripts should rely on ABSOLUTE paths only, which should be consistent for any files including the generated files. Task-number: QTBUG-113295 Change-Id: I0219c7bf34ef6a6589c6d5fade4c2ed3f8036ef0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> (cherry picked from commit b523a655c8b6fabb8b79bb274ef034dcd094e1f8) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Update harfbuzz to version 7.2.0Eskil Abrahamsen Blomfeldt2023-05-0480-728/+2324
| | | | | | | | Fixes: QTBUG-113352 Change-Id: I134f5b49c2ae5bef31edfc5cd87f0ff62d6c18b1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 151287fb5182b45736da6b2e2e516bb54e44219a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "qdbusxml2cpp: invert Q_DECL_DEPRECATED and inline in the output"Fabian Kosmale2023-05-032-56/+5
| | | | | | | | | | | This reverts commit 310f6666150f18d40630b54cf5c9424e4cfb5567. Reason for revert: Causes a fail-to-build regression Task-number: QTBUG-111330 Change-Id: I08a6a68d2c81e1a1189356aa7cf36aaf24fd8c9b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit aea92807be2567c4212b96ae67de7137075ba4ee)
* moc: Use a much, much shorter structure name for the StringDataThiago Macieira2023-05-021-22/+23
| | | | | | | | | | | | | | | | | | | | | The old one kept all the indices in the type name, which was completely unnecessary. This caused the symbol name to explode for some very large meta object, notably that of the Qt namespace itself, causing gdb to produce this warning at every start: warning: internal error: string "StringData<3, 12, 7, 7, 6, 6, 9, 5, 10, 4, 6, 5, 5, 8, 7, 8, 10, 9, 9, 12, 11, 12, 12, 8, 6, 5, 13, 12, 9, [many lines suppressed] 33, 6, 6, 5, 6, 17, 12, 17, 13, 8, 7>" failed to be canonicalized To ensure there's no binary-compatibility problem with a StringData of two entries, the first parameter is now of type int. Change-Id: I6f518d59e63249ddbf43fffd1759fbb66adc1299 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 6000fa2adf9b84eb2816b2f71201cf52674bdbaf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix documentation warningsTopi Reinio2023-05-015-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These warnings slipped in during a time period where documentation testing in the CI was disabled. src/network/kernel/qhostinfo.cpp:254: (qdoc) warning: clang couldn't find function when parsing \fn template<typename Functor> int QHostInfo::lookupHost(const QString &name, Functor functor) src/widgets/widgets/qcheckbox.cpp:102: (qdoc) warning: clang couldn't find function when parsing \fn void QCheckBox::stateChanged(Qt::CheckState state) src/corelib/kernel/qcoreapplication.cpp:2769: (qdoc) warning: clang couldn't find function when parsing \fn template<typename Functor> void QCoreApplication::requestPermission( const QPermission &permission, Functor functor) src/corelib/serialization/qxmlstream.cpp:3806: (qdoc) warning: clang couldn't find function when parsing \fn bool QXmlStreamAttributes::hasAttribute( const QString &qualifiedName) const src/corelib/text/qtliterals.qdoc:11: (qdoc) warning: Multiple topic commands found in comment: \namespace and \headerfile. Change-Id: I38c605f358dbca1ef3e2bfe20a6424f7a4d44b4a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 37dc52d4f24c216811cf14ceb8aeaa13766b249d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Fix leak of application menu NSMenuItemTor Arne Vestbø2023-04-291-2/+2
| | | | | | | | Fixes: QTBUG-112697 Change-Id: I0fe62e5a66f57bb9b8c073e636be346e088e0986 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit d01aa396171e101ba03638799c2c6fae6d116240) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCoreApplication: fix use-after-free of nl_langinfo() resultThiago Macieira2023-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | The result is retained so long as we don't attempt to change our locale, but failing to change that is the reason why we printed anything. ==20227==ERROR: AddressSanitizer: heap-use-after-free on address 0x000107312696 at pc 0x000103c48088 bp 0x00016ee180c0 sp 0x00016ee17880 READ of size 9 at 0x000107312696 thread T0 #0 0x103c48084 in wrap_strlen+0x164 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x18084) (BuildId: f0a7ac5c49bc3abc851181b6f92b308a32000000200000000100000000000b00) #1 0x1023804bc in QString::vasprintf(char const*, char*) qstring.cpp:7112 #2 0x102243578 in qt_message(QtMsgType, QMessageLogContext const&, char const*, char*) qlogging.cpp:368 #3 0x10252630c in QMessageLogger::warning(char const*, ...) const qlogging.cpp:647 #4 0x10229f940 in QCoreApplicationPrivate::initLocale() qcoreapplication.cpp:664 #5 0x10229fba0 in QCoreApplicationPrivate::init() qcoreapplication.cpp:826 #6 0x1022a07c0 in QCoreApplication::QCoreApplication(int&, char**, int) qcoreapplication.cpp:799 #7 0x101454ef8 in main+0xeb0 (WSgen:arm64+0x100470ef8) (BuildId: ae9b4fec1fd73c1693047a6b9d9ce91432000000200000000100000000000b00) Task-number: QTBUG-111443 Change-Id: I6f518d59e63249ddbf43fffd1759d28738124797 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 3690c202f959a505e0f0bcd4a7b19f235b04d015) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* [docs] QList: fix history of resize(n) semantics changeMarc Mutz2023-04-281-2/+7
| | | | | | | | | | | | | | | | | | The description was copied from QVector, and doesn't exactly fit QList. For QList, the function is \since 6.0 when QList became QVector, not in Qt 5.7, as indicated. Be more precise. Amends 13293d3308c04d22bc2928e8991f47744560e085, which changed the docs for clear(). Fixes: QTBUG-112334 Change-Id: I457a1f699ddcdcdad2f1daf88f577007c136ee8f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 58ebbb62203ec31e03d3ee0bc58c57de5b3bcce4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNAM: Fix double-connect for manual redirect handlingMårten Nordheim2023-04-281-3/+3
| | | | | | | | | | | | | | | The other signal connections are broken because we create a new delegate. But 'q' is still the same, so we should not connect to it a second time. Just connect it in the constructor instead. Fixes: QDS-9687 Change-Id: Id47492c2e734087281a3d3488649471814fd981d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c69a5611ae3c7e4e7049f5b472e253cfdbd70aea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't set focus when moving the cursor with a touch padVolker Hilsheimer2023-04-281-1/+2
| | | | | | | | | | | | | | | | | | | | On macOS, swiping with a single finger on the track pad (which Qt identifies as a QInputDevice::DeviceType::TouchPad) results in a TouchBegin event. For widgets that accept touch events (perhaps implicitly because they want pan gestures, like QGraphicsView), this results in a TouchBegin event to be delivered. QApplication::notify will then check the widget's focus policy, and with ClickFocus set, will set focus on the widget. This is not what we want for a TouchBegin on a touch pad, so skip the setting of the focus for that device type. Fixes: QTBUG-112922 Change-Id: Ie828793a784cc0e2fa47954bf5b396d6a44bd5e8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 127e33d4c6e000ed1fab0f2ea926918ed0bf3bd3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QVariant: Fix support for metatypes created by Qt < 6.5Fabian Kosmale2023-04-283-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt >= 6.1, < 6.5, a trivially constructible type would have the NeedsDestruction flag set, but it's dtor pointer would have been null. In Qt 6.5, the meaning of the NeedsDestruction flag was changed to be more aligned with what the name suggests, and thus would only be set for non-trivially destructible types. For QMetaType this was fine, but QVariant has a check for acceptable metatypes which attempts to verify whether a QMetaType is usable for QVariant. The check assumes the semantics of Qt 6.5, and thus fails for metatypes created by older Qt versions. To fix this issue, we increment the QMetaType revision field, and only check the metatype's destruction support if the revision is high enough. In theory, that allows passing unsuitable metatypes from older Qt versions to QVariant; however, such code would have been broken in prior Qt releases already (which didn't attempt the check), and no code that used to work in any released Qt version will break (as we simply skip a check that was passing before). Fixes: QTBUG-113227 Change-Id: I12e02bd97d2c410ea1a36efb0ce2389f21d50a30 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit c2f01d4cfb1b144bcc2bf295399ef0d4ad70dae2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix example for QT_DEPLOY_TRANSLATIONS_DIRJoerg Bornemann2023-04-281-0/+3
| | | | | | | | | | | | | | The shared example for modifying deployment directory variables now sets QT_DEPLOY_TRANSLATIONS_DIR too. Also, add the missing install(SCRIPT) call. Fixes: QTBUG-113216 Change-Id: I6d52d946a21f006ae6222de1211f3d239bd03fc4 Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> (cherry picked from commit bbadd4205d4c0067771abb76a77f04857bd48ed4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add flicking behavior hints to xcb platform integrationShawn Rutledge2023-04-271-3/+5
| | | | | | | | | | | | For now these will be used in QtQuick Flickable. Task-number: QTBUG-35608 Task-number: QTBUG-35609 Task-number: QTBUG-97055 Change-Id: I944d7f0271d535822ceeef610f232f56c85e0938 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit ebd2fe108ae4e72d94dd7e3bc0ed296253b68b3d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: add darkmode=0 explicitlyTasuku Suzuki2023-04-271-1/+3
| | | | | | | | Task-number: QTBUG-72028 Change-Id: Ia73dbd4f203ce654e5221f69a65b8c82c2af7d79 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7b9e73a921e9ce8df1c6af2ae69a187fee06c986) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: Properly squeeze in trimOpListsLaszlo Agocs2023-04-271-0/+28
| | | | | | | | | | ...and improve the comments since it is not directly obvious why things are done the way they are. Change-Id: I6aa5f09b1b2f7f3fc18f74a4af2977d24278aae6 Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit 7a79302e4ea22241c02ae1c8d75a34cd5e8b9ccb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Avoid memory leak when using NSSlider for style drawingTor Arne Vestbø2023-04-271-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To fix the broken sliders reported in QTBUG-98093 a workaround was added by 4bee9cdc0ac4bbee7f061e8f6050d704032f6d0f where we would call initWithFrame on an already initialized NSSlider. This breaks the contract of object initialization in Objective-C, as the class is free to allocate and prepare resources for the instance without freeing previously acquired resources first. As noted by the Object Initialization chapter of the Concepts in Objective-C Programming guide, "Once an object is initialized, you should not initialize it again.": https://tinyurl.com/objc-object-init And as observed in QTBUG-112899, the additional initialization resulted in a memory leak. The other part of 4bee9cdc0ac4bbee7f061e8f6050d704032f6d0f was that we now called startTrackingAt twice when drawing. Both from setupSlider, for all consumers, and from drawComplexControl, and as it turns out, this is the key thing that "fixes" the pressed knob drawing of NSSlider. For some reason, NSSlider needs the duplicate startTrackingAt call both to draw the knob as pressed, and to not let one drawing pass affect another drawing pass. This would benefit from further investigation, but for now the removed leak is an improvement. Fixes: QTBUG-112899 Task-number: QTBUG-98093 Change-Id: Ia7e6ef963910f1858d2fdb10e0323fc5bb3b2eda Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 4db9fdf58ea88420c5ca41c1547c55948b83d881) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix return value for Q_ARG and Q_RETURN_ARGAndreas Eliasson2023-04-271-6/+7
| | | | | | | | | | | | | The macros no longer return QGenericArgument and QGenericReturnArgument objects. As of 6.5, they return QMetaMethodArgument and QMetaMethodReturnArgument, respectively. Fixes: QTBUG-113147 Change-Id: I06e0cf8255e6d4fee43048850f1717b1740d4846 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6e5258b48b6ffabdec81ca809d80d02491e10220) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QApplicationStatic: enforce acquire-release semantics on creationThiago Macieira2023-04-261-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | On systems with weak memory ordering, it was possible for the storeRelaxed(Initialized) to be observed by another thread performing a loadRelaxed() without observing the contents of the object itself. The mutex *does* release the contents of the object to memory, but without the corresponding mutex acquisition, we couldn't guarantee that the object's contents would be observed. Now we can. We don't need to fix the load inside the mutex because the mutex will have acquired everything from either a previous call to pointer() or to reset(). The store inside reset() need not be storeRelease() either because the effect of observing the Uninitialized state will be to lock the mutex. None of this is used to protect the data as it is being mutated by the user in multiple threads, or their access simultaneously with reset() (which is why the load outside the mutex was removed). Thanks to litb on Slack for noticing this and bringing to my attention. Change-Id: Idd5e1bb52be047d7b4fffffd1752df5b4d9b2e3f Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit af95ec4b7b051669c6db56f75310276a339c4aa9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fully rebuild dirty configure-time executablesJoerg Bornemann2023-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: "ninja clean" does not fully clean the build directories of configure-time executables (e.g. syncqt). This can lead to problems when building with compiler and linker launchers: on configure time, the launchers are not used (compare CMake issue #20762). After a "ninja clean", the executable might be removed but the object files are still there. This leads to a situation where the object files have been created without the compiler launcher but are linked with the linker launcher. We encountered a situation however, where the linker launcher requires the usage of the compiler launcher. The configure-time executable has a ${target}_build custom command that runs "cmake --build" and creates a timestamp file to track when to build the target. To circumvent the problem of stale object files we add the "--clean-first" argument to that target to fully rebuild configure-time executables if the timestamp file is out of date. The performance this imposes is negligible, because 1. Those configure-time executables are seldom out of date. 2. They are supposed to be "tiny executables with system dependencies only" anyway. Change-Id: I701f9089f5ad941ffdf235aeccc3119b68c4e3e3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit aad3b1f063e68cfdcbc099e0ae5c001319d99dcc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add message if syncqt is crashed without any outputAlexey Edelev2023-04-261-0/+8
| | | | | | | | | | | | | | If syncqt process crashed due to the incompatibility with the standard library CMake doesn't produce any useful output. This adds the message that will give short explanation and possible solutions to fix this behavior. Task-number: QTBUG-112747 Change-Id: Ib51aec19e3fcacf07515a3d20d72f89753bcdc33 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit be4de03b37206dd654bf90342636838d3ed3abc1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Localize title of edit menu's NSMenuItem via AppKitTor Arne Vestbø2023-04-261-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | In 939b7bfe66221975d3a12a6d0a6dd14d9ad04344 we synced up the NSMenuItem's title to that of the corresponding NSMenu, as AppKit was observed to use the NSMenuItem title for its heuristics of when to add dictation and emoji entries to the menu. But AppKit's heuristics are based on the localized name of the edit menu, so we need to follow suit and look up AppKit's own localizations. This is of course fragile, as we're relying on this localization continuing to live in the InputManager table, but if that changes we'll just fall back to using the title from the NSMenu, as we did before. In addition, AppKit's heuristics also look for menu items in the menu that match selectors such as copy:, paste:, etc, so even if our lookup of the localized title fails, the additional heuristics would in most cases still succeed in detecting the edit menu. Task-number: QTBUG-53085 Task-number: QTBUG-79565 Change-Id: I5e12973b86ab35f10a8f7434bcae8a4cf134ecfd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit a92c202b49777696cbc64003f6292e6b61952140) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Darwin: Add debug logging of locale/language key parametersTor Arne Vestbø2023-04-261-0/+36
| | | | | | | | | | | Helps debug future issues in this area. Task-number: QTBUG-104930 Change-Id: Ia3f54edfa390190bb1cf3809f0cf72b105993a6a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 034e9b087e9f8dde501c4e3e1a29149d984764b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Handle failure to create display link or invalid display linkTor Arne Vestbø2023-04-263-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | In some rare situations the display link may fail to create, or will be created in an uninitialized state: https://bugzilla.mozilla.org/show_bug.cgi?id=1201401#c123 When the latter happens the display link thread will crash in CVCGDisplayLink::getDisplayTimes(). Based on the Mozilla bug report, and subsequent patch, we can detect this situation via CVDisplayLinkGetCurrentCGDisplay(), so we follow the same approach, and then bail out: https://bugzilla.mozilla.org/show_bug.cgi?id=1201401#c158 Once we bail out we fall back to the timer based approach to delivering the update request. The next requestUpdate() will try to use the display link again, which will likely work this time around, as the display has had time to fully initialize. Change-Id: Ib80fd792516d1e4e7f863a82755cbf00d1eb6c34 Reviewed-by: Robert Griebl <robert.griebl@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit ac0953c34d287e00559829e575b3308ccf46cb0b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rework imagescaling example to avoid potential crashesIvan Solovev2023-04-264-76/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | Creating a continuation with QtFuture::Launch::Async policy does not work well with the example, because it still needs to update the UI once the async continuation is finished. If the user decides to close the application while the async continuation is executed, the next continuation will be accessing data from the destroyed Images object. Fix it by using QtConcurrent::run() to do the "heavy" work in a separate thread, and use a QFutureWatcher to handle the results of the async execution. Update the example documentation accordingly. After this patch the example still shows the usage of continuations and onCanceled()/onFailed() handlers. However, it now does not illustrate the usage of different launch policies and continuation contexts. It might not be a big issue, because the QFuture documentation describes these topics rather extensively. Fixes: QTBUG-103514 Change-Id: I8142535064ff7a4e8007a5c0a8fe7709d6d942ec Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> (cherry picked from commit 5ddb5d1fee52700b71701203ac622b3b363eab46) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Use qt_add_executable() not add_executable() in snippetsLeena Miettinen2023-04-263-7/+7
| | | | | | | | | | Changes code snippets that are visible in the docs. Task-number: QTBUG-113116 Change-Id: If743234bfe6947acf02307bf1144daad4fba5d73 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 3abfd4aa7c709202dbbd0d24f3a0cf4f6108fea5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix license info for import shell scriptsKai Köhne2023-04-266-230/+18
| | | | | | | | | | | Use SPDX-License-Identifier also for shell scripts. Also change license to LicenseRef-Qt-Commercial OR GPL-3.0-only, which makes arguably more sense than LGPL. Change-Id: I3a46468f264747916aacbf206f5ccba28b6c6593 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit e51274d8c310b566faf9b825dd70433020c9d5dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clarify license of SHA-1 algorithmKai Köhne2023-04-263-44/+11
| | | | | | | | | | | | | | | | SPDX/reuse does not feature any generic 'public domain' license identifier. So far we claimed CC0, which is however not entirely correct. Now that we have LICENSES directory, let's correctly claim this as a specific license. Also, remove the LGPL in-code claim. The adaptations for Qt code is minor so it doesn't make much sense to claim a different license. Change-Id: I4e943a45baae192b54c38184e8eb85fc6d4035e5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 576c29df83b0e1c86936f4f2fc30c279f98b0bd3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android-example: add missing properties in AndroidManifest.xmlBartlomiej Moskal2023-04-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After changing android target SDK version to 31, some missing values has to be defined in AndroidManifest.xml. AndroidManifest.xml template was updated in qtbase in: 56dee3de5e4ac1c4d37a2c5e27361e7ddbdea1a7 commit. In case when example uses its own AndroidManifest.xml file, it need to be updated separately. * android:exported="true": because the manifest sets an intent-filter, and it then has to explicitly to avoid the warning [1]. * android:allowBackup="true": this has to be explicitly set, we set it to the default value here [2]. * android:fullBackupOnly="false": SDK 23+ use this to deteremine to user auto backup or not, we set it to the default value here [3]. [1] https://developer.android.com/guide/topics/manifest/activity- element#exported [2] https://developer.android.com/guide/topics/manifest/application- element#allowbackup [3] https://developer.android.com/guide/topics/manifest/application- element#fullBackupOnly Fixes: QTBUG-112816 Change-Id: Ia48007a84009901be508d6cc087790d574227ad7 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit c27d5eca6a229a4ffdd681567b2dca94381847e1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix capitalization error in auto-generated qdbusmacros.h includeDmitry Shachnev2023-04-261-1/+1
| | | | | | | | | https://bugs.launchpad.net/bugs/2016703 Change-Id: I521c7b66d6c1c27ea790f0564b175cccb0027802 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit dca0304c26012a57abae79c9b82f6cbdd0467018) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QTabBar: don't scroll when laying out the tabsVolker Hilsheimer2023-04-262-4/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | QTabBar lays out the tabs when the bar's size or content changes, often lazily. This should not change the scroll offset of the tabbar, which is controlled by the user, or at most when a tab needs to be made visible (e.g. when it becomes the current tab). Move the logic of updating the scoll offset into the makeVisible function, so that the scroll is only adjusted to either leave no gap between the last tab and the right edge of the widget of there is still a scroll; or to reset it to 0 if there is enough space for the entire tab bar. Since layoutTabs does show and hide the scroll buttons, we cannot skip this when the buttons are invisible. However, the normalizedScrollRect helper now needs to return the entire widget rect if there are no visible scroll buttons. Add a test case that simulates the previously broken behavior where the scroll got unnecessarily reset to 0 when resizing. Fixes: QTBUG-113140 Change-Id: Ic19fbb82821ea09cc5e7646dcbce3aa7607909c2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit ca15f650a1a914bb9a41131109c46c4e52c5ebb1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix crash at exit when tracingAntti Määttä2023-04-265-8/+15
| | | | | | | | | | | | | The crash is caused by the cleanup sending trace messages when the plugin has already been destroyed. Add shutdown callback to the plugin to indicate this has happened. We can't use signals since that also generetes trace event. Change-Id: I2e490fc51c2aaa97c240c1496a528a6ff6077bd0 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> (cherry picked from commit bb8aada627e23a7f7e23dfdb97d443f1b847086a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tracegen: Add common prologueAntti Määttä2023-04-265-0/+15
| | | | | | | | | | | Add common prologue and add error message when tracing is used in a module that doesn't have Q_TRACEPOINT enabled, but tracing is enabled. Change-Id: I64ca074942f6e89b4f5b5e3b6048b2b713c06df8 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> (cherry picked from commit 257b3161c5c5e46cd040371da77cb6a06987cf50) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Create unique names for QSize and QRect types for lttngAntti Määttä2023-04-261-12/+12
| | | | | | | | | Task-number: QTBUG-113161 Change-Id: Icc47af16b73dd9ad4e203c3bd55833587435be5c Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> (cherry picked from commit 346dcc696bb2b1431a3a38f8d830d030334f1924) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QCoreApplication: ensure that theMainThread has expected statesThiago Macieira2023-04-262-3/+38
| | | | | | | | | | | | | | | | | | | The expected states are: - nothing sets theMainThread before main() - theMainThread is reset when the last QObject (the QCoreApplication in the test) is destroyed The GUI version of this test appears to leak a lot of QObjects. By the time this function runs, theMainThread's QThreadData still has a refcount of 66 on Linux/XCB. The Windows non-GUI version also failed. Neither situation was investigated to see why objects are getting leaked. Change-Id: Idd5e1bb52be047d7b4fffffd17507d9e6ef08743 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b9394b48c1b42e0ef834315ca4f89161a5c12ae7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add Qt icon library for examplesKimmo Leppälä2023-04-26157-0/+214
| | | | | | | | | | | | | Icon library for file and text operations. This is private library to be used with Qt examples. Instructions on usage found in README file. Task-number: QTBUG-110428 Change-Id: I762503c74aecc3a8efbf25877628cb8e85efe414 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 9c0e0e39f0a8a32feacd4bed4b006cadbeadb2b4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProcess/Unix: don't overwrite openChannels() error messageThiago Macieira2023-04-261-2/+6
| | | | | | | | Change-Id: Icfe44ecf285a480fafe4fffd174d0fa4701b0076 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 956b2495285251e4840ec32885ffa2cfbb7bd79c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCommandLineParser: fix some narrowing conversion warningsAhmad Samir2023-04-251-15/+15
| | | | | | | | Drive-by change: use auto for iterator types. Change-Id: I463f24890ee58a97e585a0596aed55543285b0a0 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 39c191d003b2665337f562fd902499e7053cf92c)