summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Replace QtTest headers with QTestDavid Skoland2020-12-229-9/+11
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macos: Document that Drawer is obsoleteMorten Johan Sørvig2020-12-211-0/+2
| | | | | | | | | | This feature is not much used on modern macOS, and Qt 5 has never supported it. Pick-to: 5.15 6.0 Change-Id: I9de195aaf7df954b63f0f816e93c91e870ef5852 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Call QEventDispatcher::startingUp() on thread startMorten Johan Sørvig2020-12-213-1/+2
| | | | | | | | | | | | | | | | ...instead of during createEventDispatcher(). This way, startingUp() will be called [on the thread being started] also for custom event dispatchers installed with QThread::setEventDispatcher(). This prevents crashes when installing event dispatches which expects that startingUp() will be called. Crash reproducible with test case from QTBUG-51961. Change-Id: I71bd696539689d928a61ff9b47d05297cf803b2f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* offscreen: always create a valid QPlatformIntegrationMorten Johan Sørvig2020-12-211-2/+3
| | | | | | | | | | | | | Commit f4a66e5c accidentally made it so that the offscreen plugin would produce a null QPlatformIntegration on X11 if QT_QPA_OFFSCREEN_NO_GLX is set. Restore previous logic where the generic QOffscreenIntegration is created if the X11 code path did not create an object. Change-Id: Ic71fb04bbd824f4121480dbaf8fa0571ebb39f42 Pick-to: 5.15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Don’t use \note when documenting enum valuesMorten Johan Sørvig2020-12-211-1/+1
| | | | | | | | | | qdoc does not render these nicely when outputting html: the enum value table table is split in two around the \note. Pick-to: 5.15 Change-Id: Ic2b8c5a247d1100a766e4ae10161aa6ee7644514 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* sqlite: Replace NULL by nullptrFriedemann Kleint2020-12-211-6/+7
| | | | | Change-Id: I8e845ae093a68d2d7ecf0e358a2316a54d0f2144 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* sqlite: Fix MSVC integer conversion warningsFriedemann Kleint2020-12-211-6/+11
| | | | | Change-Id: I58ab6a8d7787abce5b0f73562eb53f40e39c8186 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix qdoc warning, reference parameter correctlyVolker Hilsheimer2020-12-211-1/+1
| | | | | Change-Id: Icb3d0aa005752f291f81a47a15f7157009fd09f2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Use host variables instead of hardcoded directoriesAlexey Edelev2020-12-212-4/+4
| | | | | | | | | | | | | | | | | | | 'QT_HOST_PATH' indicates that we use crosscompilation toolchain to build project. In this case 'Qt6Config.cmake' loads 'Qt6HostInfoConfig.cmake' from host QT_HOST_PATH, that defines correct paths to host tools. Replace hardcoded paths for host tools by paths recorded in Qt6HostInfoConfig.cmake. Correct conditions for QT_HOST_PATH, evaluate it explicitly as string, but not as boolean expression. Fixes: QTBUG-86557 Pick-to: 6.0 Change-Id: Ib52bbd32478051d019a932dcb1f735e2d4aacfbf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't rely on versionless commands or targets existingCraig Scott2020-12-211-3/+3
| | | | | | | | | | Commands like qt6_finalize_executable() should not rely on versionless commands or targets being available, since they can be disabled by a build option. Pick-to: 6.0 Change-Id: I6a9ab6a9b6a6b731590e5b8c43f73b518ed38e81 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Do not link "prefixed" openssl libs on AndroidJoerg Bornemann2020-12-212-12/+2
| | | | | | | | | | This reverts e52239f525d59f965dbbc5dbe2c28314498690b0, because we do not have multi-ABI builds currently, and we must link against what the WrapOpenSSL package provides. Fixes: QTBUG-89473 Change-Id: I4f38a2c41e90ec8b602e28f8ca77f0ebd009639c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make QPushButton on macOS use QFocusFrame to fix alignment problemsDoris Verria2020-12-213-34/+101
| | | | | | | | | | | | | | Alignment problems occur for pushbuttons because they appear smaller then their actual widget geometry, which is used for their alignment in layouts. To fix, shift the pushbutton's rect to the left, adjust SE_PushButtonLayoutItem accordingly and use QFocusFrame to render the focus frame ring outside the widget's paintable area. Fixes: QTBUG-89133 Fixes: QTBUG-81452 Pick-to: 5.15 6.0 Change-Id: Iee885a4fb3674d966e5ff3b5c04a0845521b2d72 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix crash on reallocateAndGrowMichal Klocek2020-12-211-1/+1
| | | | | | | | | | | | | | | | | | After 6be398 few tests fail/crash with qtcharts. Fix issue on reallocateAndGraw and avoid accessing flags on invalid header. Data::allocate can return invalid header and dataptr, which takes place if capacity is 0. In code before 6be398 clone method checks if header is not null before resetting flags. However after b76fbb4 resetting flags is no longer needed since it is done in allocateGrow. Task-number: QTBUG-89092 Pick-to: 6.0 Change-Id: I2fde781dad7a0694a5f17ab716f647c2e35f4ff0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Add some comments to clarify meaning of observers in property systemAndreas Buhr2020-12-211-3/+3
| | | | | | | | | It took me quite a while to figure out that two objects with a similar type and a similar name which occur side by side have a quite different meaning. Add a comment for the next one. Change-Id: Idf4d63d8ed09ead2c3d82a798e6d7476024209bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Android: KEYCODE_MEDIA_PLAY_PAUSE translated rightPiotr Mikolajczyk2020-12-211-1/+1
| | | | | | | | | | KEYCODE_MEDIA_PLAY_PAUSE was incorrectly translated to Qt.Key_MediaPlay. This patch changes it to Qt.Key_MediaTogglePlayPause. Fixes: QTBUG-66448 Pick-to: 5.15 5.12 6.0 Change-Id: Icd2747857bc479228bfdffcd8ab8fdef7b79e918 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QProcess/Unix: speed up initialization of write notifierAlex Trotsenko2020-12-181-3/+2
| | | | | | | | By using new QSocketNotifier API, we can avoid unnecessarily enabling the notifier right before turning it off again. Change-Id: Ie0dea00251e9885653677c495dfc5abaaa4db1c7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* xcb: fix thread synchronization in QXcbEventQueue::waitForNewEvents() againIgor Kushnir2020-12-183-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch amends a41701904e880f58e19b352ade1931d6cd1a7112 If peeking into the event queue looking for a clipboard event fails, QXcbClipboard::waitForClipboardEvent() calls queue->peek for the second time to "process other clipboard events, since someone is probably requesting data from us". QXcbEventQueue::peek() in turn calls QXcbEventQueue::flushBufferedEvents(). This second flushing can acquire a waited-for clipboard event. The issue was that the code in waitForNewEvents() ignored this possibility and assumed that there were no clipboard events before or at its current m_flushedTail. If there were no more events on the X11 connection after tailBeforeFlush, the waitForNewEvents() in waitForClipboardEvent() blocked execution for 5 seconds and eventually timed out. The fix is to remember QXcbEventQueue::m_flushedTail just after looking for and not finding a clipboard event in the queue. And then wait for more events via QWaitCondition in waitForNewEvents() only if there were no more events after the remembered m_flushedTail. Fixes: QTBUG-75319 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I4919c5b9b9227b3a8a29a11e7094f97960b3a121 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Disallow construction of QPropertyBinding from a propertyFabian Kosmale2020-12-181-5/+1
| | | | | | | | | | | | | | | | | | | | | This would steal an existing binding from a property, which is most likely not the intended action. Alternatively, we could make it equivalent to Qt::makePropertyBinding(foo), but that conflates properties with bindings to it. On the other hand, this would avoid a potentially source-breaking change. [ChangeLog][Potentially Source Breaking Change] It was possible to create a QPropertyBinding from a property; this would steal any set binding from the property or create an invalid binding if none was set. Use makePropertyBinding if you want to to create a binding which depends on the property's value, or takeBinding if you want to repurpose the property's binding. Fixes: QTBUG-89507 Pick-to: 6.0 Change-Id: Icd2d3b9261b60f36948f2cea9c33ddbea36efbc1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QProperty add markdirtyFabian Kosmale2020-12-184-0/+76
| | | | | | | | | | | This adds functionality for marking properties (QProperty and related classes) manually as dirty. This facilliates the integration of bindable properties with non-binable properties and makes it possible for bindable properties to change due to external events. Fixes: QTBUG-89167 Change-Id: I256cf154d914149dacb6cadaba92b13c88c9d027 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Android: Fix for accessibility potential crashPiotr Mikolajczyk2020-12-182-1/+3
| | | | | | | | | When accessibility was not active it was possible to force its update, causing a null pointer exception in java. Pick-to: 6.0 5.15 Change-Id: I60f65612d6e9f712ba3c591ffcc6803f06f09efb Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QSocketNotifier: hone setSocket() APIAlex Trotsenko2020-12-172-9/+8
| | | | | | | | Remove a second argument to the setSocket(qintptr, bool) function as it makes the API harder to understand. Change-Id: Ib1852a4e9d96adde35bfbf0fe03b386d9ded395a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Clarify QWindowPrivate::maybeQuitOnLastWindowClosedTor Arne Vestbø2020-12-171-3/+3
| | | | | | | | | | | | | We only need to check QGuiApplication::quitOnLastWindowClosed() at the point where we've actually concluded that the last window was closed. Checking for !q->parent() was redundant, as we were already exiting early when !q->isTopLevel(). Pick-to: 6.0 5.15 Change-Id: I934e186d707361b31d19692c04d2e17b7ba0f49e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QProcess/Unix: do not create pipes for forwarded channelsAlex Trotsenko2020-12-171-13/+28
| | | | | | | | | | | | | | | | | | The child process inherits a standard handle of the main process in such cases: stdin - inputChannelMode == QProcess::ForwardedInputChannel, stdout - processChannelMode == QProcess::ForwardedChannels || processChannelMode == QProcess::ForwardedOutputChannel, stderr - processChannelMode == QProcess::ForwardedChannels || processChannelMode == QProcess::ForwardedErrorChannel || processChannelMode == QProcess::MergedChannels For these combinations we should not create pipes and notifiers as they would not be used. Change-Id: I8e3836e4d840a40b338c85c54645539ebcaab3f6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Q_OBJECT_BINDABLE_PROPERTY: Silence warnings properlyFabian Kosmale2020-12-171-5/+4
| | | | | | | | | For some reason, clang (and thus Qt Creator's code model) did still warn about the offsetof usage. Moving the warning pragmas one layer higher appears to fix the issue. Change-Id: I1ee1cfd690fdcce9105c65e508203a722fe63151 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* CMake: Fix 'static' conditionsJoerg Bornemann2020-12-172-3/+4
| | | | | | | | | The pro2cmake script doesn't handle static scopes correctly, and the generated "CONDITION static" must read "CONDITION NOT QT_BUILD_SHARED_LIBS". Change-Id: Ic5a5763e9fd5f5d04fb4c12227cbe85fac17b826 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Android: Pass pending state to ResumePauseListenerBartlomiej Moskal2020-12-171-1/+6
| | | | | | | | | | | | | | | | | | | It can happen that updateApplicationState() is called before m_androidPlatformIntegration is set. In such case, new applicationState will be remembered and propagated later. Before this change, pending application state was passed only to QWindowSystemInterface. ResumePauseListeners that are subscribed for changes to ApplicationActive/ApplicationInactive state also should be informed about new application state. Fixes: QTBUG-84737 Pick-to: 6.0 5.15 Change-Id: I67e79860b340ee5de2d13d148a222e9f1c942b93 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QSslCertificate::operator == - cleanup error queueTimur Pocheptsov2020-12-171-2/+9
| | | | | | | | | | Another case when an OpenSSL's call can dump some errors into the shared error queue discovered. An invalid certificate with non-null X509 * may result in several errors appended to the queue. Pick-to: 6.0 5.15 Change-Id: I1278b371bd1edf2d656760c371bfb6da5dcab6ec Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Bindable property with initializationIvan Solovev2020-12-174-2/+87
| | | | | | | | | | Implement Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS and Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS macros. They allow to directly initialize the property member. Task-number: QTBUG-85520 Change-Id: I76541d6785bbbf27976b9f0b865fb45be1e9beee Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add sections about std containers and algorithmsOle-Morten Duesund2020-12-172-0/+72
| | | | | | | | | | | Add section comparing Qt containers and std containers. Add snippets showing use of std algorithms with Qt containers. Task-number: QTBUG-86584 Pick-to: 6.0 Change-Id: I1133a5214a5acd086c37658ca11ab205a19a489b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Prevent copy in texture upload with invalid inputLaszlo Agocs2020-12-161-2/+4
| | | | | | | | | | Skip the memcpy when src is null. Also silences a Codechecker warning. Pick-to: 6.0 Change-Id: I5042d725000cb6dff6864408fa9ed9e0ca35145a Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Fix typo in QtOpenGL module docsLaszlo Agocs2020-12-161-1/+1
| | | | | | | Fixes: QTBUG-89493 Pick-to: 6.0 Change-Id: I92255da2f68ec8dc0503654787e7861abe431504 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* QSslSocket_schannel: Don't compare against undefined valueMårten Nordheim2020-12-161-1/+1
| | | | | | | | | Something defined is always greater than undefined Pick-to: 6.0 Fixes: QTBUG-89530 Change-Id: I7633dd4233f7b13c3c5be17352841ec873531ef9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QCache: fix updating entries breaking the internal chainMårten Nordheim2020-12-161-4/+5
| | | | | | | | | | | | | | After f08492c6fd9818c7d80b1725355453e179b4d85b was merged this bug would manifest as an entry appearing twice in the chain when a updating an existing entry (insert with an existing key). This could sometimes result in crashes later as the list filled up and the list was used in trim() to remove various entries. Fixes: QTBUG-89176 Pick-to: 6.0 Change-Id: Ide80160fb4317dc0aefe79eec5dce7ec6813e790 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* xcb: report wheel events from the correct device instanceShawn Rutledge2020-12-158-91/+256
| | | | | | | | | | | | | | | | | Until now, all wheel events came from one "core pointer". It's useful in Qt Quick to tell the devices apart, because some support smooth scrolling and some don't. Also remove the QHash storing legacy ScrollingDevice structs, and use a subclass of QPointingDevicePrivate instead. Task-number: QTBUG-46412 Task-number: QTBUG-72167 Task-number: QTBUG-69433 Change-Id: Ie6a3d8dd494f981e8706b9a66a1021dfb51baec4 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProperty docs: update macro nameIvan Solovev2020-12-151-2/+3
| | | | | | | | | Use Q_OBJECT_BINDABLE_PROPERTY instead of non-existing ones Task-number: QTBUG-85520 Pick-to: 6.0 Change-Id: I47e3ff150f54176b42a478fd3ff639754d90e70a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QString: update documentationIvan Solovev2020-12-152-120/+215
| | | | | | | | | | | | | | The QString documentation is aligned with QList regarding common wording and ideas: - Extend general class description - Revise description of several methods - Fix examples to use qsizetype instead of int - Wrap descriptions at 80 characters Pick-to: 6.0 Task-number: QTBUG-87962 Change-Id: I7d5a7e829ce8b98a0a1a7fae6b7ae0dec4effbae Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* CMake: Fix compile warnings when MSVC and -DFEATURE_static_runtime=ONLi Xinwei2020-12-151-0/+1
| | | | | | | | | | | | | When using MSVC compiler and -DFEATURE_static_runtime=ON, qrc_foo.cpp and qtentrypoint_win.cpp are still compiled with '-MD' or '-MDd' flag, which will cause following warnings and other possible problems: warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library Pick-to: 6.0 Change-Id: I6794930a64e9cff4dc1c9632fc3fc64227848af0 Reviewed-by: Yuhang Zhao <2546789017@qq.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Bump versionPaul Wicking2020-12-151-0/+1
| | | | | Change-Id: I33ea33c0ecfe42cd25cb9f3a37b7aad72717edd2 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Doc: Clean up changes to Qt XML docsPaul Wicking2020-12-151-15/+12
| | | | | | | | | | | | * Remove heading that causes QDoc's autolinker to link incorrectly. * Clean up language a bit while at it. * Drop a double space. Fixes: QTBUG-89283 Pick-to: 6.0 Change-Id: Ice778d66deab384b66eb50b790670c9e3c8b0e84 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Fix qt_alphaVersion and qt_opaqueVersion in the trivial caseAllan Sandfeld Jensen2020-12-151-4/+53
| | | | | | | | | | | | | | | | The case no conversion was needed wasn't handled, but was assumed to be handled by some call sites. This can speed up QPixmaps on devices with non-standard screen formats. [ChangeLog][QPixmap] Opaque pixmaps on devices with a non-standard opaque format will now correctly match format for faster blitting. Same with semitransparent pixmaps on devices with a non-standard semitransparent format. Pick-to: 6.0 5.15 Change-Id: Ia05ff518fea36b7e3ed5c089fa9e8681a02fc574 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QProcess: remove unused memberAlex Trotsenko2020-12-152-2/+0
| | | | | Change-Id: I448a32b8ba11426c70d49f7f492b73e7799cc257 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Restore previous QDateTime behavior in DST gapAndreas Buhr2020-12-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Historic QDateTime behavior when being asked to create a QDateTime in the DST gap was to interpret the given date as if it was in the time before that gap, mapping it to a point in time after the gap. This has changed with a04411119ead3d4473e4f0ac4bceedc585977b2f . Since then, the given date is interpreted as if it was in the time after the gap, thus being mapped to a point in time before the gap. This patch restores the historic behavior. This was not caught by Coin because machines ran in timezone "Atlantic/Reykjavik" which does not have DST since 1967. This patch changes tests to always run in "Europe/Oslo". Driveby: Test function "findSpring" did some operations in local time, even though being asked to work in a specific time zone. Fixed that. Fixes: QTBUG-86960 Fixes: QTBUG-89208 Pick-to: 6.0 5.15 Change-Id: Iecce5898bf9711a10e7dfc0a25e4bbeaed1c8ade Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QObjectBindableProperty documentation into snippet fileFabian Kosmale2020-12-152-18/+71
| | | | | | | | | | | The \Q_OBJECT macro has been removed but using Q_OBJECT in the file would erroneously trigger automoc. Avoid the issue by moving the snippet into its own file. Task-number: QTBUG-89505 Pick-to: 6.0 Change-Id: I6630ff4bfcbf33eae348ac3d92aae1878dc573ea Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* xcb: Fix available geometry after rotationAlexander Volkov2020-12-132-5/+10
| | | | | | | | | | | | | | QXcbVirtualDesktop::m_workArea is not updated after screen rotation if _NET_WORKAREA is not updated, e.g. when a window manager is not running. Use width of -1 for m_workArea to indicate that _NET_WORKAREA is not set and thus there is no need to find its intersection with screens' geometries. Pick-to: 5.15 6.0 Change-Id: Ic1f3ec23576ed8407a76cc2b9f84a145c67b1d4b Reviewed-by: Liang Qi <liang.qi@qt.io>
* OCI: Fix the compilation of the pluginAndy Shaw2020-12-131-5/+6
| | | | | | Pick-to: 6.0 Change-Id: I9637bab6cc217d4fd9692f6745b4f14db6ffb259 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QUrl: improve parseIp6's use of QStringViewThiago Macieira2020-12-121-6/+4
| | | | | Change-Id: I55083c2909f64a1f8868fffd164f20a2fb8ff7f6 Reviewed-by: David Faure <david.faure@kdab.com>
* QUrl: update parseIp6 to use QStringView, as the comment requestedThiago Macieira2020-12-121-8/+6
| | | | | | Change-Id: I55083c2909f64a1f8868fffd164f2058f226fa61 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QStringView: add constBegin and constEndThiago Macieira2020-12-122-4/+23
| | | | | | Change-Id: I55083c2909f64a1f8868fffd164f21118a9d3ec5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QSocketNotifier: extend API to provide more flexible startupAlex Trotsenko2020-12-112-17/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | Technically, having a single constructor limits the use-cases for this class. We should take into account that: - an opened socket descriptor must be available at the moment of construction; - the constructor unconditionally enables the notifier (the possible solution notifier = new QSocketNotifier(...); notifier->setEnabled(false); is suboptimal due to heavy operations inside the event dispatcher); - for these reasons, QSocketNotifier most often cannot be a member of another class (we have an extra allocation and indirect access). This patch addresses this shortcoming by making it possible to set the socket descriptor at a later point: [ChangeLog][QtCore][QSocketNotifier] Added setSocket() and an additional constructor which requires no socket. Change-Id: I2eb2edf33ddafe99e528aac7d3774ade40795e7a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Assert validity in QStringIterator's unchecked methodsEdward Welbourne2020-12-111-6/+18
| | | | | | | | | | These methods should never be used on strings not known to be valid UTF-16. Their optimizations will produce undefined behavior otherwise. Change-Id: I03a95140dcbdd1f7189eea1be69289ce227331a5 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>