qHash(QHostAddress) was added in Qt 5.0 (at least the version with uint seed = 0).
op==(QHostAddress::SpecialAddress, QHostAddress) was there since QHostAddress was
added before public history. Since QHostAddress does not have a \since, the I did
not supply one for op==, either.
Since the equality operator did not have unit-tests, added one.
Change-Id: I954a0df02464338f08a12ca58d4cc0ceb013e67a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The 'showArrow' member was not init'ed.
Initialize it to true, which is the default value of the
QBalloonTip::showBalloon() function's argument of the same
purpose.
Reported as new by Coverity, but dating back all the way to
cc3875c2e4, so affects all
current branches.
Coverity-Id: 171482
Change-Id: Ica519ecda3a4ae413f606faab8c22f7072f412a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Commit f839f536 fixed a data race in the gradient cache by
reference-counting the CacheInfo objects stored in the cache. To this
end, QSpanData gained a ref-counted pointer to the CacheInfo whose
members it references to keep the object alive for as long as the
QSpanData object needs it. However, since CacheInfo is only later
defined in qpaintengine_raster.cpp, the counted pointer's payload was
chosen as CacheInfo's base class, QSharedData.
As it turns out, e.g. in the QPainter test, the data race was real and
so QSpanData ends up being the entity that destroys (at least some)
CacheInfos, either in its destructor, or in the setup() method. Since
QSharedData's destructor is not virtual, and
QExplicitlySharedDataPointer<QSharedData> knows nothing of the
CacheInfo-ness of its payload, we end up calling the destructor of the
base class, and not the CacheInfo one.
Fix by using QSharedPointer instead, which stores the correct deleter
internally. Ideally, QSpanData would contain a QSharedPointer<const
void>, but QSharedPointer's implementation is deficient in that
respect and does not compile when instantiated with void, and we can't
use std::shared_ptr, yet, so introduce an arbitrary base class,
Pinnable, to be used instead.
Change-Id: I5573c599d5464278d3a8e4248d887ef9ffcd7b70
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QLayout::replaceWidget() doesn't delete the affected item, but returns it.
Change-Id: Ibda96e4bf2432ad13ed2908c7d37547f46e29a37
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
GCC 7 warns about implicit fall-throughs now.
Fix by adding the missing Q_FALLTHROUGH(), and, in one case, by
moving the existing suppressant into the correct position.
Change-Id: I7383f47e690b6334ef69c9df745c2205247ca7d0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
C++17 adopts P0021R1[1], which makes noexcept be part of the function
pointer's type and thus be overloadable. It contains some provisions for
allowing a noexcept function pointer to cast implicitly to a non-
noexcept function pointer, but that fails in the presence of templates
and additional overloads that could match the type in question.
Fortunately, the paper proposed a test macro, so we can change our
sources now and be compatible with both C++14 and C++17 rules.
This first failed with Clang 4.0 trunk. This source incompatibility is
not our fault, it's the language's doing.
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html
Task-number: QTBUG-58054
Change-Id: I2bc52f3c7a574209b213fffd14988cf0b875be63
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
With QT_NO_PRINTER set via the feature system there is no symbol
exported at all in a packaging build. This implies that no .lib is
generated. When an application has QT+=printsupport the build will fail
due to a missing file.
For android and ios it only worked as there is no separation and linker
works against the .so file
Task-number: QTBUG-56321
Change-Id: I389adaca61669b302b6c431effed2ef6d1c499a3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Change dcd2f829 introduced fake files with the extension .cbt for custom
build tools that generate code from C++ source inputs. The moc_predefs.h
header file falls into this category, because it is generated from
dummy.cpp.
It turns out that these fake files have to exist. Otherwise the
custom build step is executed on every build. That means re-moccing all
mocables on every build.
Fix this by actually creating the fake .cbt files with some
explanatory comment in them.
Task-number: QTBUG-57695
Change-Id: I251294334425d9914677787d8ba6da1169b4cca5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 5fc2337d74)
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
It's supposed to be a full alignment (like Top | Right), not
just one flag.
Change-Id: I656adda83742d7e4f31955322e937e979b32747c
Reviewed-by: David Faure <david.faure@kdab.com>
Generally isValid should be called by the bridge, but in this case, we
must verify the validity internally since we derefernce the interface
internally.
Task-number: QTBUG-52536
Change-Id: I14950118e58d65135bc38d77c23b8a7fed8bf39a
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
The style name needs to be cleared if not present in the string,
otherwise the style name from qApp->font() (which propagates to
any default-constructed QFont) remains.
Change-Id: I9b6522a39a38526cced8a11ed02ae32582026480
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
The test failed if qApp->font() had a styleName() set,
when testing old serialization formats which didn't serialize it.
Change-Id: If0236d354be144b3a990e074a22f796fffb1ed18
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
When generating the Visual Studio project XML, the filter "Root Files"
was not being output. Specifically, this means that even if RC_FILE was
specified, it would not be included properly as a resource compilation
target in the resultant Visual Studio project file.
This is essentially a rather belated cherry-pick of qt/d6de960b7f.
Task-number: QTBUG-57914
Change-Id: I7d03dc818df0cf36608012f1a71a3a476d8a9ff7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Because of QRect's width and height are caluculated values, they got
spoiled after x and y values setting.
This bug affects, in particular, Android software keyboard appearance:
it could overlap focused input field.
Change-Id: I27ccca27111219818722951fe6f463388d76c702
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Qt doesn't create the actual QDockWidgets when restoring, the user must
ensure they are created before restoring state. So lets not create an empty
QDockWidgetGroupWindow which you can't close and with no tabs.
Change-Id: If0a6aa7cf6f3932ff4274e03f787e27aef8fa53d
Task-Id: QTBUG-57492
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
There are some keyboard layouts where pressing shift will give something
different to what the expected key would be. For example, on a French
keyboard layout, pressing SHIFT+! gives 1 as opposed to SHIFT+1 giving
! on a US keyboard layout. Therefore it should check against both cases
to ensure it does not end up adding a new entry.
Task-number: QTBUG-57938
Change-Id: I11c52619c048b98500f2d79876bb912720af6e65
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Use the scaling factor when calculating the initial size of the
platform window.
Change-Id: Ie21f0da14e32ac437efbc304a3fd9722a7f8615e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The population of data rows was factored into a separate file, qutf8data.cpp, in
commit e20c4730. Merge commit 9bd03235 failed to track a conflicting change into
the new file, and brought the code back into the tst_utf8.cpp, where it has been
duplicating the utf8data data ever since.
Change-Id: I4282685b882448f927289468bd7ab340a21ea0b3
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For language "Traditional Chinese" on iOS with region "US",
the logic was formerly to attempt a match on country/language/script (fail),
followed by country/language (which would result in script defaulting to
"Simplified"). Now, the logic is to try language/script first if script is
specified. Failing that, language/country will be attempted.
Task-number: QTBUG-39639
Change-Id: I75a774b1e66686e95167ff221458a97a7ea2660d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jason Erb <jason.erb@sparist.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If we use QLatin1String we should include qstring.h.
Change-Id: Iebd761b98e515e9cd9cd34b96a0f8a602d00f086
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The future tests don't need QtConcurrent as QFuture and friends are in
QtCore. The printdevice test doesn't use QtNetwork and the lancelot as
well as the testlib tests don't use QtXml.
Change-Id: I150ac99b36682aa23ad22ba943266eb0f0952838
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
When a keyboard is using an input method then the layout for it needs to
be retrieved with TISCopyInputMethodKeyboardLayoutOverride(). For cases
where it is not using an input method this will return null and in that
case we can use the original approach as before.
Task-number: QTBUG-53804
Task-number: QTBUG-57934
Change-Id: I6283785bf002602113e208bb38d5eb2a9a7ceb36
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The unknown types are treated as strings by default.
Coverity-Id: 59489
Change-Id: Ib0eaf5c27d3afaf694c8a2acca42bef6808c8a9f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
An internal, private symbol was changed in
beef975f92. However, this symbol was being
used by some inline functions in QtTest, and this therefore introduced a
BIC. This change simple adds back a symbol with the original signature.
I recall seeing this in my own work, and the KDE CI system hits this as
well:
libKF5KDELibs4Support.so.5.25.0: undefined reference to
`qt_handleMouseEvent(QWindow*, QPointF const&, QPointF const&,
QFlags<Qt::MouseButton>, QFlags<Qt::KeyboardModifier>)'
Task-number: QTBUG-52205
Change-Id: I4e85996850cc436b6a31addca3a8f9829c0c5edd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
for some inexplicable reason, configure.bat went into an endless loop
on win 8.1+ while attempting to parse the command line; this is clearly
a bug in cmd, so work around it.
amends 7af6e9bb.
Task-number: QTBUG-58019
Change-Id: I698a2a51891a4e7af75836c075888f70df865409
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
activated() is actually triggered(), highlighted() is actually hovered()
Task-number: QTBUG-50315
Change-Id: Ieefdc8376102d80d0885a6c7ca47a9380945afef
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Don't use Dinkum choices when the C++ library is libC++ (QNX 7.0).
Change-Id: I18c3f716ccfb0c02dbfdc01eac4b707d3ae9aab6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qundostack.cpp: Command '\li' outside of '\list' and '\table'
Change-Id: Ic162e246c754e125f6ae82a2a66312e925b231c2
Reviewed-by: Martin Smith <martin.smith@qt.io>
StripTrailingSlash removes trailing slashes from the path, but not the
entire URL.
Task-number: QTBUG-47607
Change-Id: Id62b971e563e290b7ca000576bcc328616a3f1a2
Reviewed-by: David Faure <david.faure@kdab.com>
When qreal is float, it cannot represent all values an int can take,
so we may lose precision in the expression
qreal(a) / b
as opposed to the double result
double(a) / b
For lack of trying, I do not know of a value where this would change
the resulting 'fillWidth' value, but better be safe than sorry, and
use double instead of qreal arithmetic.
Also, when calculating fillRatio, we were converting values back and
forth between qreal and double. Using double everywhere avoids that.
Found while reviewing integer arithmetic in QProgressBar as part of
the fix for QTBUG-57857.
Change-Id: I054cb11d35e3ecf5bf79b5c8ee39029bd23bcf49
Reviewed-by: David Faure <david.faure@kdab.com>
When qreal is float, it cannot represent all values an int can take,
so we may lose precision in the expression
qreal(value) - minimum
as opposed to the exact result
qint64(value) - minimum'
For lack of trying, I do not know of a value where this would change
the resulting 'progressBarWidth' value, but better be safe than sorry,
and use the 64-bit integer expression instead of floating-point.
Found while reviewing integer arithmetic in QProgressBar as part of
the fix for QTBUG-57857.
Change-Id: I0240c143bb75af6986910489b34042ce9b3a8caa
Reviewed-by: David Faure <david.faure@kdab.com>
There were some strange sentences that did not add to the documentation
of HSL vs. HSV.
Task-number: QTBUG-52483
Change-Id: I5f2b8c3bd420fe9cabc74a94af4b78945723b6cf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The arithmetic used to calculate the size of the progress bar fill in
QPixmapStyle assumed minimum == 0, but that does not necessarily
hold, since the minimum value is user-defined.
So, fix the arithmetic to take the minimum into account, taking care,
as done elsewhere, to avoid signed integer and qreal=float overflows,
by using qint64 and double, respectively.
[ChangeLog][QtWidgets][QPixmapStyle] Now handles progress bars with
minimum != 0 correctly.
Change-Id: I738ded56e8234716c36a5e9fde15bae691c43a35
Reviewed-by: David Faure <david.faure@kdab.com>