Make it easier to capture information about crashing tests in log files,
since it is not possible to do something like
foo > log.txt 2> errlog.txt
on Windows.
Adapt selftest.
[ChangeLog][QtTest][Important Behavior Changes] Crash/exception
information is now logged to standard output on Windows.
Task-number: QTBUG-47370
Change-Id: I3e6a2d25855ed0f20516418a031990b562f5f757
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
The logic used in the FreeType font engine can be generalized
and move to the QFontEngine baseclass. This allows the CoreText
font engine to correctly report the minimum left/right bearings,
which decreases the chance that an optimization in QTextLayout's
line breaking algorithm will produce wrong results.
The calculation of left and right bearing has been moved to the
glyph_metrics_t type to reduce code duplication. This allows us
to use the with and height of the bounding box to determine if
the glyph has any contours.
Change-Id: I864697d3f31ed56f22f04666199b6c5023c5e585
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
RCS files (text/plain) have the glob pattern "*,v", which caused
the regular expression match to fail.
Task-number: QTBUG-47923
Change-Id: I7d8682ef51306cb4da58a2b3880842bd99892ea3
Reviewed-by: David Faure <david.faure@kdab.com>
Newer test functions don't have those. Removing those comments makes
the code consistent.
Change-Id: I542b89e797ef061395ce1fc87d848195e6f81f35
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Input context selection works differently across platforms. On some
platforms it is not possible to request a specific context at all
(e.g. Wayland). This will be unified, depending on the environment
variable "QT_IM_MODULE", you will get:
- null: default (platform) context, if defined (otherwise no context)
- empty: no context
- set: set one, if it exists and is valid (otherwise no context)
[ChangeLog][Platform Specific Changes] Haromnized input context selection.
QT_IM_MODULE environment variable will be taken into account.
Change-Id: Ic8f826fbc6ace25941cd19b9b086943e848fbe01
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Nedim Hadzic <nedim.hadzic@pelagicore.com>
This commit changes the readDatagram() and writeDatagram() virtual
functions to take a QIpPacketHeader as meta data, instead of a
QHostAddress/quint16 pair. As previously, the header is an "out"
parameter for readDatagram() and an "in" parameter for writeDatagram().
The header pointer in readDatagram() is allowed to be null if the
PacketHeaderOptions indicates WantNone. Otherwise, it must not be null.
The extra options parameter is introduced because we may not always want
all the metadata upon reception. For sending, we know what to include or
not based on what's set in the incoming header parameter.
QIpPacketHeader splits sender and destination because we'll be able to
return both on datagram reception.
Change-Id: Iee8cbc07c4434ce9b560ffff13ca4213255008c7
Reviewed-by: Richard J. Moore <rich@kde.org>
QDateTime::addSecs needs to do something similar, but not identical
because it needs the number of days too. And then there are daylight
savings transitions...
Task-number: QTBUG-47717
Change-Id: I7de033f80b0e4431b7f1ffff13f976f4f5e5a059
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Mostly related to IPv6, because Q_IPV6ADDR is an array of char, so the
compilers were generating byte access to each value. Instead, force
access as 32- and 64-bit in most places that make sense (64-bit access
decays to 32-bit on 32-bit machines). In one isLoopback(), this is now a
128-bit access for best improvement.
Some smaller improvements relating to SpecialAddress by combining the
three IPv4 special addresses.
Change-Id: I7de033f80b0e4431b7f1ffff13f932b1cd7b5d21
Reviewed-by: Richard J. Moore <rich@kde.org>
Playing with the offset argument of pcre_exec is not equivalent to
adjusting the pointer to the subject string. In particular, PCRE
can go behind the offset to check for lookbehinds or "transition"
metacharacters (\b, \B, etc.).
This made the code that deals with QStringRefs not matching in behavior
with the corresponding code dealing with QStrings. For instance,
QString subject("Miss");
QRegularExpression re("(?<=M)iss");
re.match(subject.mid(1)); // doesn't match
re.match(subject.midRef(1)); // matches!!!
Instead, actually adjust the pointer to the subject string so that
the behavior is identical. A broken test that relied on the
equivalence is also removed.
Change-Id: If96333241ef59621d7f5a6a170ebd0a186844874
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Ensure QAction::setVisible() is
handled and reposition if visibility changes.
Task-number: QTBUG-39660
Change-Id: I14f0659aedc8dc89ddef3159d3a500b40b1563ff
Reviewed-by: David Faure <david.faure@kdab.com>
We don't replay mouse events after closing popups on X11.
This leads to the bug when the menu doesn't show after
clicking three times on the menu bar. It can be fixed by
reverting 78d7192338, but
then we need an alternative fix for QTBUG-32807 on Windows.
So don't replay mouse events for the menu bar on all
platforms.
Change-Id: I3db8e24a6de6f35b0a17dffac6a131f1cad42e6d
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Give setStandardOutputFile2 a sensible name, move it to where it
belongs and remove bogus Q_OS_WINCE ifdef.
Change-Id: I5c843e8b6cb626979966f3e61f7a7c720173bb28
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Do not call bytesAvailableInChannel if the source pipe end is
invalid. This is the case when redirecting channels on Windows.
The assertions in bytesAvailableInChannel were triggered whenever
an output process or output file was set and waitForBytesWritten
was called.
Task-number: QTBUG-45548
Change-Id: I225dfea2c5e27e122f75008a3a06d425554e00fe
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Drop process output to nullDevice(), if an application does not request
forwarding, redirecting or reading from the device channel. This
prevents from accumulation of unnecessary data which can not be read.
Change-Id: Ia311a8c658a46cf580ffa9484c5369f3fc5f98a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The generated xml file is now lowercase.
This was changed in shared-mime-info 3805d0bcf2.
It led to runtime warnings "No file found for ...", which helped notice the bug.
Change-Id: I31f0fc7f0fe8a098c3f79c0bcbeeb1909d2cc05a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The buffer may have been left dirty if we were unable to write all the
data to the child process in the previous run. So ensure we clear it
before starting a new one. We already did that for stdout and stderr,
for some reason.
Task-number: QTBUG-44517
Change-Id: I1a800c709d3543699131ffff13c419da3bbffacf
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This complements QHostAddress::isLoopback. The only missing check now is
for the "Any" address types, though operator== is quite fast nowadays.
Change-Id: Iee8cbc07c4434ce9b560ffff13cc2691e15014b6
Reviewed-by: Richard J. Moore <rich@kde.org>
Instead, we use the binary MySQL encoding and copy the data directly
into the QVariant of the desired type. This gets rid of the temporary
string allocations and greatly improves the performance of the added
benchmark. On my machine, the results are:
Before:
0.562 msecs per iteration (total: 563, iterations: 1000)
1,922,479.330 instructions per iteration (total: 1,922,479,330, iterations: 1000)
After:
0.381 msecs per iteration (total: 381, iterations: 1000)
774,132.957 instructions per iteration (total: 774,132,958, iterations: 1000)
Note that the same could be applied to floating point data types in
the future. Additionally, special support for MYSQL_TIME structure
coult be added to get rid of the string conversions there.
To ensure everything keeps working, a new auto test is added as well
that verifies the select statements and insertions of integral data
into a MySql table works as intended.
[ChangeLog][QtSql] Improve performance when reading integer values
from MySQL databases via prepared statements.
Change-Id: I21dd9277661971ded934546f09535014b63f8eb8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit moves the functionality from QtNetwork's QHostInfo to
QtCore. Note that due to Windows ws2_32.dll's quirky behavior of
requiring WSAStartup before calling gethostname, this change required
moving the initialization to QtCore too.
On Linux systems, gethostname() gets the name from uname(), so we bypass
the middle man and save one memcpy.
Change-Id: I27eaacb532114dd188c4ffff13d32655a6301346
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It failed on Windows due to readonly files copied from the resource,
until adding a setPermission call.
Change-Id: I1d42b53763583aca73d011e0f2bbf061ef6aa891
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
In C++, type punning with a union is not allowed. It will result in
compiler defined behavior at best, and undefined behavior at worst.
Specifically, if QRgba64 is passed to a function by value, the different
members of a struct might be passed in separate registers. This means
that any write to the quint64 might not blank out the values of the
struct whenever the compiler looses track with TBAA.
Change-Id: I991b5492fe4bb13a14bb670fef5bf13dacbe6c0a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Just like from RGB32 to RGB30 we must also repremultiply when converting
from RGB64 because the alpha channel loses more precision than the other
color channels.
Since this is not approximated accurately in the simple blending
functions and the functions are no longer needed now the main render
engine supports higher accuracy, the simple blending routines for RGB30
have been removed.
Change-Id: I2b7b8eb015e330a487848fc4370ad3a1e966be91
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Have an autotest to prevent introducing JSON syntax errors
that become apparent only at runtime.
Change-Id: If2bcbf4d227fddcbeb9c095b7986bada078131d7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
On Windows and OS X, where QStandardPaths does not use XDG_DATA_DIRS/
_HOME and shared-mime-info is not installed, the tests that require
additional shared mime info xml files were never run.
Mend that by using QStandardPaths' test mode instead of setting
XDG_DATA_HOME.
Change-Id: I53b75c293c41c4dac63986dcb88972c2b54d5428
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
The test is very flakey in 5.5 integrations and the OS X CI machines have
notorious problems with networking stability. So the previously listed tests
are not really at fault, it's an infrastructure problem, that we choose to
ignore for the time being.
Change-Id: I7fbfa7b3778daa6b5e60d95b822847c92927122f
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
SecureTransport does not implement QSslCertificatePrivate thus some
tests relying on generic version fail. Skip them for now.
Change-Id: I483340b37786a8a556e954b2c538e4f48a342be9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
The former didn't account for ascent and descent.
Change-Id: If741f22f7e79ac3c13e58f2966358010d9f9ec81
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
[ChangeLog][Important Behavior Changes] QDebug output for QStrings
changed compared to Qt 5.5.0 to more closely match the output of
previous Qt versions. Like Qt 5.5.0, QDebug will escape non-printable
characters, the backslash and quote characters, but will no longer
escape the printable characters.
Task-number: QTBUG-47316
Change-Id: I52dd43c12685407bb9a6ffff13f62ef68cbc80c5
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Otherwise, on some systems (Windows), we'll always create the same dirs.
Change-Id: Id3d5c7bf4d4c45069621ffff13f79ba91e0f974b
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
A couple of test always fail on OS X/iOS with SecureTransport
(simply not implemented yet).
Change-Id: Idd82262512938c36b657b497751738fdc804c182
Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org>
Reviewed-by: Richard J. Moore <rich@kde.org>
[ChangeLog][QtCore][QLoggingCategory] Fixed behavior of default
severity passed to constructor or Q_LOGGING_CATEGORY with regards to
QtInfoMsg, which was previously treated as being more severe than
QtFatalMsg.
This is because the code was using the numeric value of QtMsgType as a
proxy for severity (via the <= operator), but the value of QtInfoMsg is
greater than QtFatalMsg. Instead, the severity ordering must be dealt
with explicitly.
Change-Id: I5f178afc735221b00cb67c2cea4fa964bd9079ce
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Also removed the XFAIL from connectToUnresponsiveHost
Change-Id: Ie0f5685a8fa437c00d22f9e76b51ac61347ce03b
Task-number: QTBUG-15111
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>