The include is needed for std::unique_ptr on winrt.
Change-Id: I72a28bd0951cc947ac65877ccc35f464c757c444
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Adds inline handling of the C++17 type std::variant, so the type will
be resolved if converted into a QVariant.
Change-Id: I31809d70d7f347277389d42a3695836ec7a32d02
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit 29bc68cf16 added support for
unsigned and commit 5ff7a3d96e later added
support for int. This commit adds support for qsizetype, which isn't int
on 64-bit platforms.
We do this by reorganizing the code and using the generic version of
__builtin_{add,sub,mul}_overflow from GCC 5 and Clang 3.8, which ICC 18
seems to support now too on Linux. That leaves older versions of GCC and
Clang, as well as MSVC, ICC on Windows, and the GHS compiler, to use the
generic implementations, as I've removed the assembly code those
versions of GCC and Clang on x86 are now uncommon.
Note: any older version of ICC probably breaks. We only support the
latest.
Change-Id: I9e2892cb6c374e93bcb7fffd14fc11bcd5f067a7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Use qInfo() instead of qDebug() in case QDebug is turned off.
If the 'diff' tool is available, write the output to temporary files and
run diff on it. Otherwise, print the lines as was before, but onto one
stream to avoid indentation by the testlib handler.
Change-Id: Ib5a5dfb66ce481b493b85b915aa8c785ecb6b387
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
While menubar actions are hidden, as menubar was too narrow
to contain them, by clicking the blank area, where the action
was supposed to place, can still trigger the action.
Task-number: QTBUG-65488
Change-Id: I6b137e0717f634ebd3371dbcc2c1ce2089688374
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
By ensuring that the current index follows the focus of an index widget,
we can ensure that moving the cursor will happen in the way that is
expected from the focused widget.
Task-number: QTBUG-27793
Change-Id: Ia36891a94ce41c7d12fba678de23a6f3b69374ae
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
The action which added by QMenuBar::addAction(const QString &text) already
connected relevant signals and slots implicitly, however, while
QMenuBarPrivate::updateGeometry -ing, it reconnects them
if there's a extension button associated with a hidden popup menu.
In that case the QMenuBar::triggered would be fired twice.
Since the QAction's ownership may be changed or added dynamically,
there are still very rare cases like several widgets share the same
QAction object to result in this problem.
[ChangeLog][QtWidgets][QMenu] Fixed a bug in QMenu that caused QMenuBar::triggered
to be fired multiple times.
Task-number: QTBUG-25669
Change-Id: I4d52e82a2136a992e0b37118e41237d96a2c5d22
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
The size of the QStaticText was always adjusted, even if setTextWidth()
was used. Now size of the QStaticText is calculated according to
the set width of the text, and if no width was set, then the
automatically adjusted size is used.
[ChangeLog][QtGui][QStaticText] Fixed explicitly set width not being
respected.
Task-number: QTBUG-65836
Change-Id: If2f9f6952fb168f4bcb6d8fabfdc7360f8a36485
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Improves performance and STL compatibility by adding rvalue versions
of prepend and insert.
[ChangeLog][QtCore][QVarLengthArray] Added rvalue overloads of
prepend and insert.
[ChangeLog][QtCore][QVector] Added rvalue overloads of prepend
and insert.
[ChangeLog][QtCore][QVarLengthArray] Can now contain movable but
non-copyable types, such as std::unique_ptr.
Change-Id: I6c946acc5b67502c91c52ac5dea67cedb1af93a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is a regression test for bugs resulting from failure to take
account of the MS TZ APIs fake-DST handling of standard-time
transitions happening during DST. Has to skip the 2014 test on Win7,
as it's so old it doesn't know about the (for it) "future" transition.
Task-number: QTBUG-42021
Change-Id: I853b86d03a86f0269371bf1622bf63882fb8ee5d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QItemDelegate::doLayout added a margin after the checkbox which is not
done within QCommonStylePrivate::viewItemLayout. This created a small
but visual difference between using QItemDelegate or QStyledItemDelegate.
The additional margin was removed from viewItemLayout somehwere between
4.4 and 4.5 so it was intentional.
Change-Id: I2fc3f287fe8b181355edeebec9626c49d85fe74d
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Use Ids from newly introduced id attribute depending
on the global form setting.
Change-Id: I0a5094d5543c0714c88511fa159b60afc9be3c81
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
When QFile::open is called with the NewOnly flag, the call will
fail if the file already exists. As usual, if the file does not exist,
it will be created. Like QTemporaryFile, there is a guarantee from
the operating system that you are not accidentally creating a new file
on top of an older file. When QFile::open is called with the
ExistingOnly flag, the call will fail if the file does not exist. The
ExistingOnly flag only provides new functionality when used with the
WriteOnly flag. For ReadOnly it provides no change in functionality,
as ReadOnly by itself already never creates.
Task-number: QTBUG-52244
Change-Id: I8e3206728f245f95172c225bf297023fb078fc6d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Generate it only when the form contains some actions.
Change-Id: Ic1d64003ccff6102174771c04999cf7c90ac2ae8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Generate it only when needed.
Change-Id: I7a89b18ec0f2ee7d55fcad1b3f9701269d7616ec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
... that will be used if an icon can't be found in the
current theme.
The Icon Theme Specification
https://standards.freedesktop.org/icon-theme-spec/latest/ar01s05.html
states that unthemed icons must be searched in the base directories,
i.e. /usr/share/icons, ... But in practice unthemed icons are
installed into /usr/share/pixmaps and this dir is not used as
a base dir for icon themes. So it's better to explicitly specify
fallback dirs to avoid needless access to the filesystem.
Also some KDE application install their own unthemed icons
(into /usr/share/<appname>/pics), that can't be found by
QIconLoader. With this change it would be possible for them
to specify dirs with unthemed icons and thus be displayed
correctly in non-KDE environments.
[ChangeLog][QtGui][QIcon] Added fallbackSearchPaths() that
will be used to find icons missing in the current icon theme.
Change-Id: I0dc55ba958b29356a3b0a2123d6b8faa24d4c91e
Task-number: QTBUG-33123
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Data in item models is most often organized in rows, where each column
contains an attribute of the item represented by the row. Often when
sibling is used, it is to request another piece of data from the same
row. Having a specialized version makes this easier and less awkward
to do, simplifying
auto sibling = index.sibling(index.row(), columnOfInterest);
to
auto sibling = index.siblingAtColumn(columnOfInterest);
For symmetry reasons, siblingAtRow(rowOfInterest) was also added.
Change-Id: Ib203b2cdb16154cbb2680d16fb5c6a7538f33d07
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Apparently this (undocumented) TESTDATA feature creates resource files,
but lets you use wildcards as well, which is very handy.
The reason I didn't know/realize this when adapting the tests to use a
".qrc"-file* was because some of the test-cases were using relative
paths instead of the 'testDataDir' variable.
This commit fixes the remaining uses of relative paths, removes a
usage of QDir::setCurrent, and adapts QSslSocket to use TESTDATA.
* in now-reverted commit e1600c1a73
Change-Id: Iee6d88f1e0810eeaadac90e7d44bc6db84bfeabf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
The operator_eqeq(data13) test expected the local-time epoch and UTC
epoch to agree precisely if the localTimeType set by the test's
constructor says local time is UTC; however, when the local zone is
*sometimes* ahead of (or behind) UTC, due to DST, localTimeType is
duly set to indicate that, which doesn't preclude the zone agreeing
with UTC at the epoch. This indeed happens for Europe/London, which
agrees on the epoch but was ahead a few months later. So we can't
determine what outcome to expect based solely on localTimeType,
although we can be sure of a match when local time is UTC. So skip
this test when local time isn't UTC (and document what's going on a
bit better).
Task-number: QTBUG-65435
Change-Id: Id9b8aa0402f2a2b410e0234f6eca4ab0d1010bc4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove usage of outdated header.LGPL21 and replace those with proper
one (header.LGPL in src, header.GPL-EXCEPT in tests)
Change-Id: Ia4d1c0d84b77f09787fe7c30670747a1fe2aff29
Reviewed-by: Liang Qi <liang.qi@qt.io>
This removes the need to install an event filter on qApp just for this.
A similar thing was done with setPalette to reduce the number of event filters
in e.g. SystemPalette and Quick Controls.
[ChangeLog][QtGui][QGuiApplication] Added fontChanged signal
Change-Id: Ifa843aa42b91ac63ab17c3b064ac0e764aac77d3
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Move the modeltest autotest in the right place, and fix the
other autotests that were using it to use the version now in QtTestLib.
Change-Id: Ic6838945f616d580f357c872ce0956c341be3b16
Reviewed-by: David Faure <david.faure@kdab.com>
We have the ability to blacklist tests for CI runs now.
Task-number: QTBUG-35109
Change-Id: I8590e83faba764dce2d52e8c62e2e2c63f7bf219
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The code used to fall back to anonymous login independently for username
and password; however, it should only use a fall-back password if the
username is missing or (case-insensitive) "anonymous". When a
non-anonymous username is given without password, we should simply skip
he PASS message to FTP.
If the FTP server requests a password, in the latter case, QFtp will
signal authenticationRequired; in all cases, if the server rejects the
given credentials, QFtp signals authenticationFailed. Either way, the
client code can then query the user for credentials as usual.
Task-number: QTBUG-25033
Change-Id: I2a4a3b2725819ab19c8a7e4baa431af539edcd8d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
After we stopped sanitizing the fallback font list (with change
6ca48a847a), we now need to make
sure it is ordered so that the fonts that support the writing
system in question are always tested first, otherwise we can end up
loading a lot of fonts that will never be used.
Task-number: QTBUG-65605
Change-Id: Id2a65bbff3e64e6d6e6b4f72500778ee3e811e84
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Introduce a special hash modeled on the one used for QFileSystemWatcher
on Windows.
Task-number: QTBUG-31103
Task-number: QTBUG-64147
Change-Id: I69ebabe841716e4957ae3fb04fa5c43d233a3552
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Then we don't need to add a leading slash. (minor clean-up)
Change-Id: I86af224841009fda838e7cb89d47d324963328c9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This reverts commit e1600c1a73.
The commit missed the fact that TESTDATA exists. Which supports
wildcards and then can automatically pick up new files when added (as
long as they match a wildcard) and then you don't need to maintain a
giant qrc file.
Change-Id: Ie31fadb5ef6e8dfe6105f4f9764292f78cffb512
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Old header.LGPL21 header was used at some files. Replase those with
new header.LGPL one
Remove old header.LGPL21
Task-number: QTBUG-57147
Change-Id: I650e39024ed4876bba27e954c7d61fdb025b46ef
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When we request fallback fonts, we cannot discriminate the fonts
based on the writing system support. This is especially important
since common script is now merged with other scripts, meaning that
a common script character will always go through the fallback
mechanism when not supported by the main font. When drawing
for instance a string of Devanagari characters on macOS, we would
get a list of 33 fallback fonts, but almost all of them would be
the default Devanagari font, since none of the other fallbacks
would support that script. Meaning that we would just check the
same font over and over, which makes no sense. The fallback list
has been retrieved specifically for the given script, so we do
not need to consider that when fetching the fonts.
For most of the common set, we will not have noticed the bug,
because at least one of the writing system-specific fallbacks will
have had support for latin characters as well. But when trying to
mix emojis and some non-common script, we would get a box in
place of the emoji, which had been adopted to the main script and
would only be looked for in the fonts supporting this.
Note that this exposed an issue with the QRawFont test on some
systems. When the sample text contained a space, it would
be possible to get a fallback font for this character, since
we now effectively support fallbacks. This is not the correct
behavior, but it is unrelated to this fix, and it was not what
the QRawFont::unsupportedWritingSystem() test was written to
check. I have therefore removed the space from the sample text
to make the test pass, and will make a separate task of fixing
the issue of merging fonts for whitespace characters.
[ChangeLog][QtGui][Text] Fixed a bug where mixing different
writing systems with emojis could lead to missing glyphs.
Task-number: QTBUG-61882
Change-Id: I00f6043bb01af1f2277723ccf643034aebf3e18f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
sqlite will reuse the index for bound parameters when the named
placeholder is duplicated so we only need to call bind one time for each
placeholder. Therefore we need to have just one instance of each value
when doing the bind.
Task-number: QTBUG-65150
Change-Id: I75c4bcc4563e43c180a59a7a4cbb770dbe994642
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
When implementing a custom model there's the habit, in each and every
function that takes a QModelIndex, to carefully checking the index
passed by the caller. This index is checked for "legality" (*): does the
index belong to this model, is the index pointing to an existing row and
column, and so on. These checks are hand-rolled and, as such, slightly
different and possibly incomplete (i.e. wrong) every time.
What's worse, these checks are implemented via "ordinary" code (if
statements). However, passing an illegal index to a QAIM function is a
precondition violation, and as such does not (and must not) be
checked in ordinary conditions, as it triggers undefined behavior. On
the other hand, while debugging a custom model or a custom hierarchy
of (proxy) models, having such checks in place can be a significant
aid.
Enter checkIndex(): a debugging helper for QAbstractItemModel and its
subclasses. checkIndex() centralizes the checks for legality of a
given index. User code is free to assert on it, or have some other
fallback mechanism in case a check fails.
(*) Using "legality" here instead of "validity" in order to avoid
confusion between QModelIndex::isValid() and what checkIndex() really
does.
[ChangeLog][QtCore][QAbstractItemModel] Added
QAbstractItemModel::checkIndex(), a debugging function for
QAbstractItemModel subclasses.
Change-Id: I1eea0586b1ac3ededdbfbf46759145022dc5ad86
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
This change adds support for multiple result sets in PostgreSQL.
[Important Behavior Changes] The QPSQL driver now supports multiple
result sets. Since QPSQL previously did not support multiple result
sets, there may be some compatibility issues with the existing code
that executed several queries as one and were expecting to get
the results of the last one. In this case use QSqlQuery::nextResult()
to move to the last result set.
[ChangeLog][QtSql][QPSQL] Added support for multiple result sets
Change-Id: I2bfc91f512c4dac83116f3aa42833839a6da084c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Add some macros to enable systematic testing of QStringBuilder
expressions.
Change-Id: I6b7dbcb4a4ca0d1aebdfe7cb9861af881c0cd346
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Remove black-listing of test; the problem was due to misconfigured
time-zone on the CI system - it was on some zone that presently
coincides with UTC, not actually on UTC as supposed.
This reverts commit 597b96b8fa.
Change-Id: I72ad1dfa38532362c05aef33cd874f7f79879a41
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
[ChangeLog][QtWidgets][QMenuBar] Add overloads of addAction() using Qt 5 signals and slots
Change-Id: Ief21974213b80111f0ca87df490eb72dd6b9c9b9
Reviewed-by: Martin Smith <martin.smith@qt.io>
With this change, it is possible to significantly reduce memory
consumption of applications that fetch large result sets from databases.
The implementation is based on the new functionality called "single-row
mode" that was introduced in PostgreSQL version 9.2:
https://www.postgresql.org/docs/9.2/static/libpq-async.html
It also uses asynchronous commands PQsendQuery(), PQgetResult():
https://www.postgresql.org/docs/9.2/static/libpq-single-row-mode.html
[ChangeLog][QtSql][QPSQL] Added support for forward-only queries (requires
libpq version 9.2 or later)
[Important Behavior Changes] The QPSQL driver now supports forward-only
queries. To use this feature, you must build QPSQL plugin with PostreSQL
client library version 9.2 or later. See the Qt SQL documentation for
more information about QPSQL limitations of forward-only queries
(sql-driver.html).
[Important Behavior Changes] If you build the QPSQL plugin with PostgreSQL
version 9.2 or later, then you must distribute your application with
libpq version 9.2 or later. Otherwise, the QPSQL plugin will fail to load.
Task-number: QTBUG-63714
Change-Id: I15db8c8fd664f2a1f719329f5d113511fa69010c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>