summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* wasm: fix non-void function returnLorn Potter2021-06-211-2/+3
| | | | | | Pick-to: 6.2 Change-Id: Ia7ef3367c0531f953c78e43297f67d61b08dbf17 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QWindowsPipeReader::read(): remove redundant checksAlex Trotsenko2021-06-211-5/+1
| | | | | | | | | An initial EOF check is not required here because the code below correctly handles this case. Also, the condition '!pipeBroken' means that the pipe reader is in the 'Running' state. Change-Id: I608d932c4e38f8224d9e655272e61295e55414e0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* xkb.compose: get locale from user env settingsLiang Qi2021-06-211-4/+10
| | | | | | | | | | | | | The setlocale call will only give useful results if the program had previously set the current locale using setlocale... See also "Compose Locale" section in xkbcommon doc: https://xkbcommon.org/doc/current/group__compose.html#compose-locale Fixes: QTBUG-85529 Pick-to: 6.2 6.1 6.0 5.15 Change-Id: I65b1ac86ea54445bc3a2e1707df79bd9f732ab46 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Do not apply not acceptable properties to the imported object librariesAlexey Edelev2021-06-211-5/+10
| | | | | | | | | | | | | If __qt_internal_propagate_object_library is used to propagate an imported object library we assume that the library is already compiled and no need to apply properties that may affect compiling and further linking of the target. Amends 3329212815777e33dfb4697b748d10927d73f44c Pick-to: 6.2 Change-Id: I2bd03264e286439fbed9067fa2c0a5c4a0097856 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Fix typosKai Köhne2021-06-211-1/+1
| | | | | Change-Id: I852fec49b23acaefb61284e347e63d86ba8331ae Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add note to Qt::MatchFlags about implementation dependent behaviorPaul Wicking2021-06-211-0/+5
| | | | | | | Pick-to: 6.2 6.1 5.15 Fixes: QTBUG-94374 Change-Id: I7f426c92bf0434998d0793eedd405c1a682a28d9 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add missing limits includeNicolas Fella2021-06-201-0/+1
| | | | | | | | The code uses std::numeric_limits but is lacking the appropriate include Pick-to: 5.15 6.1 6.2 Change-Id: I41fa5ac4d8c4e06f35b5b1551ef2ad8417df80bd Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QTestCharBuffer: kill copies and movesGiuseppe D'Angelo2021-06-201-0/+2
| | | | | | | The compiler generated ones are broken. The RO5 exists for a reason... Change-Id: Ibaa5322a7a1ad4ad06bd00e9d1c21bbbea6eb08c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProcess/Win: cleanup startProcess()Alex Trotsenko2021-06-191-17/+2
| | | | | | | | | Both the call to setProcessState(QProcess::NotRunning) and deleting the PROCESS_INFORMATION structure are redundant here. All this work was done by the previously executed cleanup() call. Change-Id: Iaf89f5edd2b661008a479d154e68974621b1b1eb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QEventDispatcherWin32: suppress old {FD_CLOSE|FD_CONNECT} notificationsAlex Trotsenko2021-06-191-3/+10
| | | | | | | | | | As with other network events, we must also ignore these notifications until WM_QT_ACTIVATENOTIFIERS message is received. Fixes: QTBUG-82835 Pick-to: 6.2 6.1 Change-Id: I0740bf22e8d1cb0e8b4eba7fc1a27ffe669973ff Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QLocalSocket/Win: simplify flush()Alex Trotsenko2021-06-193-51/+2
| | | | | | | | | | Replacing a call to waitForWrite(0) with checkForWrite() changes nothing in logic, but saves one system call. As a result, unused functions in the QWindowsPipeWriter class have been removed. Change-Id: I34ec6310d9659f59a720056b9be54e31f2193116 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Move the linking logic of the object libraries to a common functionAlexey Edelev2021-06-181-75/+113
| | | | | | | | | | | | | | | | | | | The linking logic of object libraries should be reusable outside of the resource context. This introduces a __qt_internal_propagate_object_library function that prepares all the necessary genexes to link and propagate the object library to the end-point executable. Rename resource object finalizer API to make the naming more generic to object libraries of any kind. Amends 5fb99e3860eb43f4bacacec7f4a4626cb0159b14 Pick-to: 6.2 Task-number: QTBUG-93002 Task-number: QTBUG-94528 Change-Id: I69d0f34c0dadbd67232de91035aaa53af93d1fa1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* macOS 11: Fix positioning of focus frame around comboboxVolker Hilsheimer2021-06-181-4/+8
| | | | | | | Fixes: QTBUG-94069 Pick-to: 5.15 6.1 6.2 Change-Id: I09079726c96a41f628ae55724cfe53dbc225d358 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QProcess/Win: avoid double buffering on writeAlex Trotsenko2021-06-186-61/+52
| | | | | | | | | | | | | As QWindowsPipeWriter now maintains a chunk queue, there is no need to use the internal QIODevice buffer and wait for the previous operation to complete. This also allows us to get rid of the stdinWriteTrigger timer; however, as a trade-off, QWindowsPipeWriter now needs to accept data even before a handle is assigned. Change-Id: I17fe0e36a6165fe05100bfab3fe01fc0d880d617 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Doc: Move overrideCursor() from QApplication to QGuiApplicationSze Howe Koh2021-06-191-3/+3
| | | | | | | | The transfer occurred in Qt 5 Pick-to: 5.15 6.1 6.2 Change-Id: Id3428809d89c804112d9dc02f2a476cb03bd2c98 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Enable glyph cache workaround for Apple M-family of GPUsTor Arne Vestbø2021-06-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Without the workaround, and when using a Core GL profile, we hit a code path in QSGOpenGLDistanceFieldGlyphCache::resizeTexture() that produced corrupt glyphs on M1 hardware. We fix this by enabling the workaround, so that the user doesn't have to set QT_ENABLE_GLYPH_CACHE_WORKAROUND themselves. None-Core contexts do not have this problem, but the logic in QOpenGLContext does not account for recreated contexts with different formats, so we can't limit the workaround to Core formats only. With the unified memory architecture of the M1 hardware, the workaround should have limited negative effects. In Qt 6 this is not a problem, since Qt Declarative effectively always uses the workaround code-path, but it's worth recording the fact that we need the workaround. Fixes: QTBUG-89379 Pick-to: 6.2 6.1 5.15 5.12 Change-Id: Icfd8b8b23c0dcda3fea8663d81d0e225134eec5e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Allow destruction of QWindowsPipeReader in its signalAlex Trotsenko2021-06-182-19/+18
| | | | | | | | As a result, we can refrain from using the deleteLater() technique in QProcess and avoid long-lived soft leaks in blocking applications. Change-Id: I89e02b02551a668b995ad3d12d3ce9575b2dd9dd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Do not alter a widget's backing window's format once createdLaszlo Agocs2021-06-181-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing anything on a QWindow's QSurfaceFormat has zero and null effects once the underlying native window has been created. Letting QWidget update the format is wrong in this case, because we always expect that the value returned from QWindow::format() reflects reality. (reality being the settings with which the underlying native resource was created, which is typically frozen after QWindow::create(), not the state of some QWidget attribute. There are certain exceptions to this, such as when preparing to recreate the underlying native window, in which case one will want to update all relevant fields of the format based on the current values of the widget attributes, which is exactly what QWidgetPrivate::create() implements, and that's good.) Such a mismatch can have fatal consequences when OpenGL and friends are involved, but this always depends heavily on the platform and windowing system. For example, claiming that the alpha buffer size is 0 when the native window was created with 8, or vice versa, can break OpenGL-related code (both in Qt itself and in applications), that tries to create a QOpengGLContext configured based on what QWindow::format() returns. If that format describes settings that are incompatible with the actual underlying native window, we end up with the classic Invalid pixel format, EGL_BAD_MATCH, and alike errors. This is exactly what is happening when a QOpenGLWidget (or QQuickWidget) is placed in a QDockWidget where one of the ancestors is forced to native (winId() was called or WA_NativeWindow was set). When undocking, various code paths in QWidget will try to update the opaque flag of the widget, which in turn calls updateIsTranslucent. Now, if this function unconditionally changes the alphaBufferSize in the QWindow's QSurfaceFormat (even though this is completely futile to do, it has no visible effect in practice), we get the problem described above: rendering breaking down due to OpenGL contexts created with a pixel format incompatible with the native window. Prevent all this by not touching the format once the QWindow has a QPlatformWindow. This is the right thing to do, regardless of the bug in question: a window's (or context's or any other native resource wrapping class's) format must describe the underlying native resource and must never deviate, unless we are preparing to create a new native resource underneath. When it comes to the autotest, this changes the test added in 555661b625c40f21a6a3e4c73e928a6e8a46db20: the autotest logic is inverted because what we should test for is that the QSurfaceFormat stays untouched once the application makes a - futile - attribute change on the widget. Fixes: QTBUG-85714 Pick-to: 6.2 6.1 Change-Id: I7bf90711867e8a0fd474895625bf9530a7821fd5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix right-to-left text with DirectWrite engine + QPainterPathEskil Abrahamsen Blomfeldt2021-06-181-1/+2
| | | | | | | | | | | | | | | | | When QPainterPath was used for RTL text, either directly or because the target text size exceeds 64 pixels, we would pass true for "isRightToLeft" to DirectWrite, causing it to do adaptation internally for this. But the RTL layout had already been handled by Qt, so we would essentially reverse the layout twice and also move the text to negative X coordinates. Passing false instead fixes this, as it will then just use the positions we pass in blindly. Fixes: QTBUG-94175 Pick-to: 5.15 6.1 6.2 Change-Id: Ie9a47e56e97fc867ede10ab21ac5e3f003ddcacb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove old configure-related filesJoerg Bornemann2021-06-1813-7167/+0
| | | | | | | | | | | | | Remove the configure.json and configure.pri files that were used for the qmake-based configure. Remove the .prev_*.cmake files that were a by-product of configurejson2cmake.py. Pick-to: 6.2 Task-number: QTBUG-89536 Change-Id: Ie827562f7fd2513d59f69234d77b8b93124ea78e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QHash: Fix erase() edge-caseMårten Nordheim2021-06-181-1/+4
| | | | | | | | | | | | | | | | | | | | | When the element you want to erase is the last element AND the next element (element 0), when rehashed, would be relocated to the last element, this leads to the state below. Which is similar to a test in tst_qhash for some seeds. auto it = hash.begin + (hash.size - 1) it = hash.erase(it) it != hash.end By forcing the iterator to increment if we were erasing the last element we always end up with a pointer which is equal to hash.end Befriend the tst_qhash class so we can set the seed to a known-bad one Pick-to: 6.2 6.1 Change-Id: Ie0b175003a2acb175ef5e3ab5a984e010f65d986 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* codechecker: Add assert for implicit conditionEskil Abrahamsen Blomfeldt2021-06-181-0/+1
| | | | | | | | | | Since memReq is initialized inside the loop, codechecker complained that we might use uninitialized data if count == 0. So we assert that this is not the case to get rid of the warning. Change-Id: I82152942d2bb61723e9e41489c87bfde9f8bec15 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix recursion crash when calling setStyleSheet with `qproperty-styleSheet`Zhang Yu2021-06-181-0/+3
| | | | | | | | | | | When calling `setStyleSheet` with property `qproperty-styleSheet`, `QStyleSheetStyle::polish` will call`QStyleSheetStyle::setProperties`, and then`QStyleSheetStyle::setProperties` goes on to call `setProperty`.Because there is property `qproperty-styleSheet`, it will update stylesheet by calling QStyleSheetStyle::polish`. This causes the recursive call to crash. Fixes: QTBUG-94448 Pick-to: 5.15 6.2 Change-Id: I79c51192a939b0b62e5b1d0dcc90d38f79e28222 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* macOS: Resend event if the first input method event changes focusVolker Hilsheimer2021-06-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAbstractItemView opens the editor and changes focus in response to the first QEvent::InputMethod event. Changing focus however cancels the current composition, so the key press is lost and needs to be repeated by the user. What QAbstractItemView does is probably not that unique, so fixing this there - if possible at all - is not a general solution. In the platform specific input method handling code, we can generally discover that the focus object changed in response to the InputMethod event that gets sent to the focus object. On macOS, we can then pass the key event to the input method once more, which works fine. On Windows and X11, the situation is more complicated. That the focus changed is easily discovered, but re-sending the key press in such a way that the input method responds doesn't seem possible. On Windows, using SendInput simply delivers the exact key to the focus object, without starting the expected composition. On X11 with IBus, it should be possible to call ProcessKeyEvent again on the IBus input context when we discover in filterEventFinished that the focus object changed while delivering the event. However, any attempt to do so has no effect. So, for now only fixing this for macOS. Task-number: QTBUG-54848 Change-Id: I0f7b786cfa57430e6a1e7d605415265cf53eb675 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QWinSettings: use QScopeGuard to RegCloseKey()Marc Mutz2021-06-171-7/+5
| | | | | | | | | RAII rulez. Change-Id: I32bc070ae3074f782a1695bcf2079de0fc19597b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QBindable: Use setter in setValue for QObjectCompatPropertyFabian Kosmale2021-06-171-0/+31
| | | | | | | | | | | | Directly writing to the underlying property storage has the potential of breaking all kinds of internal invariants. As we return QBindable in the public interface, we should not grant callers access to the internals of the object. Pick-to: 6.2 6.1 Change-Id: I737ff293b9d921b7de861da5ae23356c17690b78 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Silence a few warnings from excess semicolonsAllan Sandfeld Jensen2021-06-171-4/+4
| | | | | | | We dont really need those after functions definitions. Change-Id: I41f010a223977c55d4b7271ac3ebdc1bb9047b09 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* CMake: Set the plugin class name for qml pluginsAlexandru Croitor2021-06-171-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | This is needed for a change in qtdeclarative to allow building the Q_IMPORT_PLUGIN-containing object library initializer of a qml plugin. Show an error if the qml plugin has no class name, it's needed for plugin initialization so it's mandatory to have a class name. Show an error if a class name is not found when computing the import macro for a plugin (both for a regular qt plugin and a qml plugin). When querying for the class name of a target, query both a Qt6:: prefixed target as well as a non-prefixed one, with the Qt one taking precedence. This is to allow querying the class name of user project created qml plugins. Currently regular qt user plugins don't use the object library initializer approach. This will likely be revisited in the future. Pick-to: 6.2 Task-number: QTBUG-92933 Change-Id: I46417471a7d8b49651e6821f7b28e7a9d44c2557 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Remove old add_qt_gui_executable APIAlexandru Croitor2021-06-171-6/+0
| | | | | | | | | | Repos should have migrated by now and the function should not be advertised as a public one. Pick-to: 6.2 Task-number: QTBUG-88763 Change-Id: Ica5bc55670a17a28c0022f78c126a3a8a8ffdeb5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Rename qt6_finalize_ios_app to be internalAlexandru Croitor2021-06-171-3/+2
| | | | | | | | | | | | For now, it's not meant to be called manually. It's called in qt_add_executable automatically for iOS. Amends 4d838dae5a821e9e5f013ba1d5a494ece1b5180e Pick-to: 6.2 Task-number: QTBUG-88763 Change-Id: I90dfcf86f53a3c8e48a813435f7400db232b21f4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QList: more explicitly document capacity() shenanigansAndrei Golubev2021-06-171-3/+4
| | | | | | | | | | | Due to capacity() reporting the size of all allocated space, this is somewhat inconsistent with what QVector::capacity() in Qt5 provided, due to Q6List being double-ended. So let's document this better Task-number: QTBUG-92941 Pick-to: 6.2 Change-Id: Iba46389121e721a8d21f0344b154f41c2c245867 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* gui: accessible - silence int conversion warningTim Blechmann2021-06-171-4/+4
| | | | | | | | | | msvc2019 emits: warning C4244: 'argument': conversion from 'qsizetype' to 'int', possible loss of data Change-Id: I286c0d453f69654ba58f071aee28e557b9f9058d Pick-to: 6.1 6.2 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QMimeBinaryProvider: cache comments and globPatternsAlexander Volkov2021-06-173-54/+62
| | | | | | | | Avoid multiple re-reads of xml files, for example in dolphin, which displays MIME type comments as file types. Change-Id: Ia124930e2a1fdc99d8a4d160f2288a00f55e0e8e Reviewed-by: David Faure <david.faure@kdab.com>
* Fix SSE4.1, RDSEED requirement for clang-cl buildsAllan Sandfeld Jensen2021-06-173-30/+5
| | | | | | | | | | | | | | A misunderstanding seems to have caused several files to be compiled with extra runtime arch options. We need to disable multi-target functions though, because it doesn't work with clang-cl headers. Task-number: QTBUG-88081 Task-number: QTBUG-88434 Pick-to: 6.2 Change-Id: Ic5829540f9007428c80f9a7bd46af35540745ccd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Porting Guide: Mention that also QSet is affected by stability of referencesKai Köhne2021-06-171-2/+2
| | | | | | | | | QSet is internally implemented by a QHash. Therefore the change in reference stability affects QSet, too. Pick-to: 6.1 6.2 Change-Id: If1879d5a027211bca0beeff16ffbc77f2f4fce26 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Porting Guide: Mention deprecation of QLibraryInfo::locationKai Köhne2021-06-171-0/+2
| | | | | | Pick-to: 6.1 6.2 Change-Id: I998a4575ce7fb56ab51d49715071e682a440360b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Porting Guide: Mention changed behavior of QCApplication::quit()Kai Köhne2021-06-171-0/+12
| | | | | | | | Mention change of behavior introduced by 89f7a2759c6b in the porting documentation. Change-Id: I3c282362f5852cc7768e6655fc7b3901d68f2b10 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Remove mentioning of Qt::MidButtonKai Köhne2021-06-171-1/+1
| | | | | | | | It's only Qt::MiddleButton in Qt 6. Pick-to: 6.1 6.2 Change-Id: Ia68bad910c617993e30e3ed1e117192469ec50eb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Avoid overflow in text layoutEirik Aavitsland2021-06-171-1/+2
| | | | | | | | | | Fixes oss-fuzz issue 34597. Fixes: QTBUG-94197 Pick-to: 6.2 6.1 5.15 Change-Id: Icabcd5a87b809b6a5ae0f1a696ec3b5dd906886b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Universally pass QMetaType by valueUlf Hermann2021-06-174-1/+6
| | | | | | | ... and add Qt7 TODOs where we can't because of BC. Change-Id: Idce8b677ae95231e1690ac4265dc6f06818052e7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QObject: cleanup the orphaned connection lists on destructionGiuseppe D'Angelo2021-06-171-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a signal/slot connection is broken, it gets added to the sender's list of "orphaned connections", to clean up later. This cleanup happens when the sender gets destroyed or as soon as it emits any signal. This may cause soft memory leaks in case receivers get destroyed, and the sender is a long living object and doesn't emit signals for a while (e.g. QThread). For some reason, an explicit disconnection cleans up the list (either by using the QMetaObject::Connection object, or in case of string-based connect, using a string-based disconnect). This raises lots of doubts about why having this list in the first place. Fix the soft-leak by cleaning up the orphaned connection list when destroying a receiver. Note: I still believe that we shouldn't have any "orphaned" connection list, and rather cleanup on disconnect/deletion (otherwise, emitting a signal may cause a CPU spike because it triggers a cleanup). If we allow for any "impredictability" during signal activation we're just admitting that signals/slots aren't suitable for e.g. low-latency codepaths. That's why I'm not marking the problem as fixed. Original-patch-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Task-number: QTBUG-88248 Task-number: QTBUG-87774 Pick-to: 6.2 6.1 5.15 Change-Id: Id25f67a45dff49f740132a44d36e88740eb12070 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix crash in concurrent disconnectLars Knoll2021-06-172-21/+42
| | | | | | | | | | | | | | This does not fix all data races that we have in the system yet. One major issue is the virtual disconnectNotify(), that can be called from any thread and thus is inherently problematic, as it can collide with the object getting destroyed at the same time in another thread. Pick-to: 6.2 6.1 5.15 Task-number: QTBUG-88248 Change-Id: I9d841eb363b7e4f0de1657aeb8f5340d0fd55190 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* cleanOrphanedConnectionsImpl: Allow to skip lockingFabian Kosmale2021-06-172-6/+26
| | | | | | | | | | | This function is/will be used in a few places where we already have a lock. Temporarily unlocking and relocking invites all kinds of troubles. By adding a flag we can instead tell the function that we already hold the lock. Pick-to: 6.2 6.1 5.15 Change-Id: Ibca089de61133661d5cd75290f2a55c22c5d013c Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QOrderedMutexLocker: Disable copy and provide explicit dismiss functionFabian Kosmale2021-06-171-0/+37
| | | | | | | | | | | | | | | Copying a QOrderedMutexLocker is questionable, and would currenly easily lead to UB. Therefore we delete the copy ctor and copy assignment operator, and implement well-behaving move operators. In addition, provide an explicit dismiss method for cases where we don't want the locker to unlock the mutexes, as they have been manually unlocked (this could have been implemented previoulsy by using the copy assignment operator). Pick-to: 6.2 6.1 5.15 Change-Id: If2a888710e1c74277b28fd3e2939ab26fff0c7ae Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QTextStream: fix a dead writeMarc Mutz2021-06-171-2/+1
| | | | | | | Found by Clazy. Change-Id: Iabe4fb23f63ea8df2142dc66cd16b04526b628c2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QFileInfo: remove a couple of QFlags->int implicit conversionsGiuseppe D'Angelo2021-06-171-2/+2
| | | | | Change-Id: Iabfca134709852694967d605c6a93f34a9777d8a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CMake: Mention resource name on which rcc is runAlexandru Croitor2021-06-161-1/+1
| | | | | | Pick-to: 6.2 Change-Id: I12189d7bf3fbe8544ae4c3478166515ea2759bec Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Change some custom commands to mention the target nameAlexandru Croitor2021-06-161-3/+3
| | | | | | Pick-to: 6.2 Change-Id: I3a198c87ba2d71306478809095083694b65c7086 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Check the impact of static link order for user projectsAlexey Edelev2021-06-161-16/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For user projects we run the static link order check once 'find_package(Qt6 ...)' is called. If linker can resolve circular dependencies between static libraries and object files we set the _qt_link_order_matters property of the Qt::Platform target. This indicates the use of finalizers is not required and we may rely on CMake-base propagation of resource libraries and resource object files. If linker could not resolve circular dependencies depending on the _qt_resource_objects_finalizer_mode value: - Finalizer will be called and collected resource objects will be linked to the target directly. - Finalizer will be omitted and resource objects will be linked using the target_sources function implicitly. This only propagates resource one level up if consumer links the static library PUBLICly, but all symbols will be resolved correctly since object files are placed in the beginning of the linker line. In the CMake version 3.21 we expect that CMake will take care about the order of the resource object files in a linker line, it's expected that all object files are located at the beginning of the linker line. TODO: Need to confirm that the CMake 3.21 meets the expectations. Amends 4e901a2f99cbfda3b479253ea54b16f02e1c3aa5 Pick-to: 6.2 Task-number: QTBUG-93002 Task-number: QTBUG-94528 Change-Id: Ia68976df8182d3d3007b90c475c1e3928a305339 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use year with same day-of-week pattern as fallback for out-of-rangeEdward Welbourne2021-06-163-22/+51
| | | | | | | | | | | | | | | | | | | The kludge previously implemented for handling dates outside the supported time_t range, by asking for a corresponding date in a year in the range, had a comment remarking that this is broken due to the wrong day of the week and, consequently, the placement of DST transitions, e.g. those scheduled by the last Sunday of a month, happening on different dates in the year asked about and the in-range year passed to the system time_t functions. This can be handled by selecting a year in the time_t range which has the same pattern days of the week (and length of the year, i.e leap-ness). That may (particularly for leap years) need to select a year far from the end of the range (and there may be a change to the zone's rules between the selected year and the end). Change-Id: Ia353b2cc7b7d266b7abf80e37cac61544ce95c2d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>