This time, the issue was that we could race a wait and a wake. A multi-
token waiter would not notice that the number of tokens changed because
it only performed a fetch-and-OR, then waited on the high part which did
not change. That means the futex_wait() would succeed, when we wanted it
to have failed.
So we have to bring back a portion of what commit
081c001deb removed: we need to keep both
the token count and the waiter count in the high word.
Task-number: QTBUG-67214
Change-Id: I04a43ee94975482f9e32fffd151e467a9e0030b3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On Windows, we must update the transient children of a window that's
about to be destroyed or its transient children will be destroyed as
well. This is already being done in the case of a single transient
child, but there are still problems when there are more than one.
Change-Id: Ib0de6767bf43dca508ecdb87cbdfedb59e9146e8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The future does not actually have a result() member function that takes an int.
The correct function is resultAt(). But that is also available directly in the
QFutureWatcher, so refer to that instead of advising to get to the future.
Change-Id: I53d267b4b48b1171bf611e11130b9dacabc059a4
Reviewed-by: Martin Smith <martin.smith@qt.io>
The problem is that qCountLeadingZeroBits is calling qPopulationCount
which is only conditionally constexpr, so qCountLeadingZeroBits can only
be marked constexpr if qPopulationCount is also.
On MSVC2017 64bit this is not a problem because it uses builtins function
in this case. (which is not constexpr, but it works because the compiler
is not forced to diagnose the problem because of the "?:" operator.
The error being fixed is:
qalgorithms.h(847): error C3615: constexpr function 'qCountLeadingZeroBits' cannot result in a constant expression
qalgorithms.h(858): note: failure was caused by call of undefined function or one not declared 'constexpr'
qalgorithms.h(858): note: see usage of 'qPopulationCount'
Task-number: QTBUG-67259
Change-Id: I65a3dfae12ca49394bec14ffefdd41a07fee1c32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We don't need to accommodate for the fake frame anymore.
Change-Id: I2d84441d4239e1ff68f640dffda1a0d1a97fa2b3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
sizeFromContents() just adds 10 points to the tool button
size and returns. Therefore, the HITheme code that used
to be shared with CT_PushButton becomes effectively dead.
Change-Id: Ib0519b0037ec3097a00e2c14067d851040853499
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This also removes a few HITheme-related functions that
are no longer needed.
Change-Id: I356938d1e99f5fed106c945a94050fa35db58716
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We guarantee the same sizes as previously with HITheme
for most common cases. Exotic cases may break and will
be fixed along the way.
Change-Id: I3e3e6ea702c7489c1cbaa821a30916f63c440c1f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Also expands the tst_qsqlquery::batchExec() test to account for this
case and generally test the functionality. In addition it is made to be
more robust to avoid any discrepencies with the testing data. The test
in general is also cleaned up to enable more of it being tested with
the different database drivers where possible.
An expected fail is added for MySQL due to the fact that it has a bug
where null timestamp entries are being converted to the current
datetime when adding it as a bind value.
Change-Id: I0061bd1c69ae35b4858afc49420f13ce59cf48ae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We were releasing only the memory of latest iteration since cfCerts
was being rewritten in every iteration, invalidating the RAII.
Hence, we need to define the variable within the loop to ensure the
object is released for every iteration.
Task-number: QTBUG-66937
Change-Id: Iaa9365168728337c6cdaac4aef686652903cf5a9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Clipping enabled state would not always be correctly restored for the
raster engine (other engines work fine). The raster engine's QClipData
object is sometimes shared between painter state objects on the
save/restore stack. QClipData has its own enabled flag, and this could
then come out of sync. Fix by making sure we sync the enabled state on
restore.
Task-number: QTBUG-58789
Change-Id: I81e6254ebb93df6e153bbef58e32a885273e3224
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Previously, we would divide by zero in BezierEase::findTForX if factorT3
was zero when solving the cubic equation.
This change fixes the problem by adding solutions for the special cases
where the cubic equation can be reduced to a quadratic or linear
equation.
This change also adds tests that cover cases where the equation becomes
quadratic, linear or invalid.
Task-number: QTBUG-67061
Change-Id: I2b59f7e0392eb807663c3c8927509fd8b226ebc7
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
The kernel stores the local address in IFA_LOCAL and the peer's address
in IFA_ADDRESS. My testing with loopback, Ethernet, WiFi, OpenVPN TAP
and TUN and Openconnect shows IFA_LOCAL is always passed and always
correct, so we could have used just that, but let's leave the use of
IFA_ADDRESS because that's also what all libcs' getifaddrs() do.
[ChangeLog][QtNetwork][QNetworkInterface] Fixed a regression in
reporting the local address of a point-to-point tunnel network
interface.
Task-number: QTBUG-67226
Change-Id: I04a43ee94975482f9e32fffd151eb393d1775580
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The change causes a crash when compiling the xkbcommon 3rdparty
library and compile failures (qtimageformats on Android).
This reverts commit a47cb14680.
Task-number: QTBUG-67326
Task-number: QTBUG-67327
Change-Id: I5ddc4eccad699e3eaec535fd6a63d11b0026b42e
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This removes the following functions from Qt5CoreMacros:
- qt5_use_modules(...)
Task-number: QTBUG-63519
Change-Id: I59769060a3a93686bf319b558c0ede55755fdb70
Reviewed-by: David Faure <david.faure@kdab.com>
Minor tweak: QList<int> is taking 64bit per entry, QVector<int>
only 32bit - this should reduce memory usage a little bit.
Change-Id: I3e17269feb4840343f5cecfc71f8fccd70edc80f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Calling reserve() for every primitive added would defeat QVector's
over-allocation strategy to avoid reallocs.
Task-number: QTBUG-66677
Change-Id: I7bdafdfa4d3ef60b00752c11e1b803abba773658
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Internally we use "Tls11" and "Tls12" from Microsoft's API for TlsV1_1
and TlsV1_2 respectively. However, in their documentation these values
are defined to also include the lower TLS versions when you use them.
We should document this.
For "SslV3" TLS V1.0 support will also be enabled.
https://docs.microsoft.com/en-us/uwp/api/windows.networking.sockets.socketprotectionlevel
Change-Id: I0b20fb745eba40afc37e8430008872fc8174a72d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Change-Id: Iaf5f5d93cd07429626d5c500ac04e67daada8e6e
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
According to the documentation, datagrams that were
not completely read are discarded.
Change-Id: Id3a038d8aeeba05e8c8f92b70877f5f5297b89ca
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
The initial settings are done for other socket engines too.
The state checks return a message when they fail. Socket engine
auto tests rely on these messages to be shown.
Change-Id: If7734b453a24ecee4c3a028395ecdbb12859c871
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Change-Id: I62f3abcabf1a0e5f909c603cbdcf407e36bd0402
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Buffer handling is now completely moved to the worker. Instead of
moving data around all the time, the worker is responsible for
buffer handling. When reads happen, the data that is read is used
directly from the worker and its buffer is updated.
With the previous approach it was possible, that transfers never
completed. It was possible, that new data was read between calls
of bytesAvailable and read and the availability of that data was
never communicated to the user. If a read that does not read all
the data happens, we signal, that there is still data available,
so that the user is notified about that fact. At the same time
we avoid unnecessary readyRead calls by blocking them until a read
happens.
To make future debugging sessions easier, categorized logging
(including verbose) was added to the socket engine.
Task-number: QTBUG-65556
Change-Id: I12020ffcccf8eb3efec9c36dc5b0e6c0ebef7eb5
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The bounds check we had wasn't complete for mirroring cases.
Task-number: QTBUG-65387
Change-Id: I5333912621c1223f83b4f1b95f2b16d12b520bd2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Native square buttons keep their text black when pressed or on.
Plus using the QStyleOptionButton variable over the QStyleOption
one where appropriate.
Change-Id: Idba8197e64d408e8a0987f1ef9243fde08e3e839
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We prepare for a better world without HITheme.
Sadly, we can't guarantee Cocoa will be good enough as a
replacement. So, expect more hardcoded values and margins.
Change-Id: I915906b5dbfbfbfc8c7f5c3224fc0ed98562bb9f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Meaning, if larger than the size of a regular NSButton.
No intermediate size square buttons anymore. We'll try to get
the closest one later, once the sizing problem is solved.
We also refactor the button creation code a bit.
Change-Id: I965520469546aea596cd1abec2309b40d70399ce
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
As for CE_PushButtonBevel, sizing is still pending. These
two seem to go together anyway.
Change-Id: I631c3f32ba201b16adbfa264a2920bfb636fb86f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
For rendering only. Sizing is still pending and, consequently,
square buttons since these depend on the button's intrinsic size.
Change-Id: Iacadc02a1a75970b221543b32ca724c92e118ce1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Nvidia doesn't handle suspend very well in Linux and textures get
corrupted. To handle this Nvidia has a bespoke extension to query when
this has happened.
This patch checks if graphics have been reset and invalidates the
surface.
Task-number: QTBUG-56610
Change-Id: I0b97d539ce6cc2b9cfe41c71bf6efd4f68496cd6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
If the offscreen platform plugin is used on Windows then it can end up
crashing since there is no native interface. This prevents a crash from
occurring when these functions are called.
Change-Id: I526fc0703771fa5f85b26d182ad3b15ef1a3ada5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The QFile out variable cannot be open because if out.open() succeeded,
we could never reach this line. Instead, we want to capture *why* either
the source or the destination failed to open.
Task-number: QTBUG-66445
Change-Id: I940917d6763842499b18fffd15142f231bf34a47
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
This will make two floating points containing NaN compare as equal,
instead of the regular nan != nan IEEE behavior (which isn't very useful
in a unit-test framework).
Note that this does not apply to indirect comparisons, for example via
QVariant.
Change-Id: I39332e0a867442d58082fffd150851acfdd18c23
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Various pieces of code have to be disabled in this case.
Change-Id: I83b133f17e9f024016a79c9103293627185449d2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Fixes the default C version used with gcc < 5
Change-Id: I948dece961caed8e6b181e1c6e6b9dc43c46583f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
When performing gestures such as Exposé or Mission Control with the
mouse button down, the position of the mouse release event is
returned with NaN values. This causes
QGuiApplicationPrivate::processMouseEvent to be called recursively
and ultimately crash.
Task-number: QTBUG-67194
Change-Id: If1536bc4dc2075c498cdd6c5afe57c86bdaac13b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It depends on QAbstractItemModel, so we need to switch it off if
itemmodel is unavailable.
Change-Id: I97246767a5e387b7a2cee90c34125a8411ef1c4e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This follows the naming convention for global headers and causes
qttestglobal.h to be added to the top of the generated QtTest header. It
is necessary to have it there when other headers depend on features
defined in configure.json.
[ChangeLog][QtTest] The qtest_global.h header is now deprecated. Include
qttestglobal.h instead.
Change-Id: Iaed639d4e13dd99cee6387fce9d15d6e55b0b1e8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Previously it was only enabling use of TLS1.0, unlike our openssl
backend, which understandably caused some confusion among some of our
users.
Seeing as this is also the default value in QSslConfiguration it is nice
to have it negotatiate more secure ciphers.
Task-number: QTBUG-67112
Change-Id: Ie216703da1ec4e6b973a881040e14816ad4c0a32
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This should be tied to the CustomizeWindowHint flag:
if that flag is set we start out without NSResizableWindowMask
and possibly add it later on if WindowMaximizeButtonHint
is set.
Change-Id: I7e826d4bd357a8a17c60cfef948af25d61b66ebf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This helps to distinguish timeouts from real crashes in COIN.
This is already done for Windows.
Change-Id: I4daeafa36f50482d20cea4bd1106647081ff7abe
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>