setData()'s default implementation for QListWidget, QTableWidget, and
QTreeWidget treats Qt::EditRole and Qt::DisplayRole as referring to the
same data. Used the same sentence from QStandardItem::setData for
consistency.
Task-number: QTBUG-11549
Change-Id: I41d06bdaaa8e7d4a86e24147b3d8222ad7823a6c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
qt5_add_binary_resources() macro did not recompile for CMake generated
input before this patch.
Adding the input files to the DEPENDS option corrects this issue:
Task-number: QTBUG-60714
Change-Id: I0f46918c6f1079fed7ee1b21305b18ff38f863f8
Reviewed-by: David Faure <david.faure@kdab.com>
Change-Id: I981e4bfdf679bf755665748e9d3b389a94561e55
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
When applying fallback fonts to characters that are joined by
ZWJ or ZWNJ, we also have to set the same font for the control
characters, otherwise we will split the text and the necessary
shaping will not take place. This was reported for emojis, but
will probably also happen for Indic scripts where joiners are
used predominately.
[ChangeLog][QtGui][Text] Fixed ZWJ and ZWNJ control characters
when fallback fonts are in use.
Task-number: QTBUG-65519
Change-Id: Ia37233f3319b95af68ae6053c29997eac65448e0
Reviewed-by: Lars Knoll <lars.knoll@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>
With libinput we now get a hardcoded resolution that is unrelated to
the hardware. So avoid using that as a real pixel delta and document
pixel deltas as being driver specific and unreliable on X11.
Task-number: QTBUG-59261
Change-Id: I9fe86d80e7ccd290ed2e4091d7eafa52cb537d34
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Gatis Paeglis <gatis.paeglis@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>
Rewrite the loop using QGuiApplication::allWindows() to avoid
the creation of temporary containers by
QApplication::topLevelWidgets() and expensive checks.
Task-number: QTBUG-64072
Change-Id: I56ef29b12f7bcbe274f3e00a6007d75d33f22b10
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Someone, almost certainly this writer, undefed Q_GADGET for
qdoc, but this was a mistake that caused clang to report a
lot of errors for undefined variable. The undef of Q_GADGET
is now removed.
Change-Id: I39fb09443110b60bbcb16cf350f38c1eac773d8a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Some old uses of Q_QDOC to prevent the old qdoc C++ parser
from seeing declarations it didn't need to see were preventing
clang from seeing declarations it did need to see. These have
been removed, and some internal documentation has been added to
account for some declarations that suddenly became public but
should not be seen in the Qt API.
Change-Id: Iccf423e5cf8767f0a271150ab59bea54cf90ac46
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
It caused a compile-time assert in clang that should not have occurred.
It is now moved passed the assert macro.
Change-Id: I8311992617de7837ca4604fcc3e5afb17dcda65d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
clang-qdoc understands Q_OBJECT, so it sees the declarations
that appear there.
Change-Id: I669be13af59269a0e108e0988d9b4f7779274c7c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
It was used to prevent qdoc from seeing the entire include
file, but clang qdoc needs to see it.
Change-Id: Ib8dbcdcd68f2003f4dd89ed6a5c9e1b65bc1c67c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
clang required adding template clauses to a few \fn commands.
There were also a few cases where Q_QDOC was changed to Q_CLANG_QDOC
and a few cases where special declarations for qdoc were removed in
favor of the actual declarations.
Unfortunately, a few qdoc warnings remain unfixed for classes
QObject and QMetaType, but these might be caused by minor bugs
in clang-qdoc itself, so they will be fixed there.
Change-Id: Ib586628cb6d2aa9cf4bcad303b5af09b412a7e57
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Properly parse filters. First captured substring in QRegularExpression
is at index 1, with index 0 you access the full captured string.
Change-Id: I68b6e314171536a08c606e5acd0f7211c1c3c254
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
MSVC requires that the C PCH file is compiled (as an object) and linked if
any C file is found, and the same for C++.
Most qmake projects are C++.
If a C++ project has a precompiled header, it is typically of C++ type, and
cannot be compiled as C (for example, it contains or includes classes).
Since there is no easy way to conditionally build the C PCH file only if C
files are found in the project (as done for g++), we need a setting that is
disabled by default.
This amends 30331afda1.
[ChangeLog][Tools][qmake] Introduced precompile_header_c CONFIG option for
MSVC to enable precompiled header for C sources.
Task-number: QTBUG-65103
Change-Id: Id9688a35ee7d9b5e4f5a846b81986cb674bc5f4e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@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>
This creates a new device integration for eglfs, eglfs_kms_vsp2, that's very
similar to eglfs_kms_gbm, but includes an extra step for doing VSP2 hardware
compositing.
The main Qt content is drawn to double buffered off-screen GBM buffers which
are converted using drmPrimeHandleToFD so we get DMA buffer file descriptors
that can be used by the VSP2 blending hardware. The blending hardware writes to
double buffered DRM dumb buffers, which are flipped with drmModePageFlip.
Communicating with the VSP2 is done using the Video4Linux2 (V4L2) streaming
API. There are two steps in creating abstractions for this. First, there is the
QLinuxMedia class that consists of a Qt style wrapper for V4L2 without anything
VSP2 specific. Second, there is QVsp2BlendingDevice which hides some of the
streaming details of the VSP2 and has some level of error recovery. Both
classes include a fair bit of logging and error reporting.
The patch is written with Wayland compositors in mind, but should work for
other use cases as well.
This is just the basic support to make compositing work, additional features
may be added in subsequent patches, i.e:
- Auto-detect VSP2 (-feature-vsp2 currently needs to be explicitly enabled).
- Support for setting the alpha value of a layer.
- Support clipping layers.
- Support for scaling layers.
- Support for other output formats than RGBA32.
- Hardware cursor support.
- Support foreign layers below the main Qt layer.
- Support for memory mapped and user pointer buffer types (currently only DMA
buffers are supported).
Change-Id: I1917d2dbdbaeded0d9c021baaa799d56afe1a9bd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The defines come from X.h here, which is included via Xutil.h.
Change-Id: I19887424cff28567fcbb1c352b42bb9d750b1928
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
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>
In ff2ae36551 we added support for
the End User Defined Characters font when it is available, and
it was added as the first fallback font to avoid being overridden
by a symbol font.
An unintended side effect was that we would also override the
default fonts for the selected style hint, so in e.g. the textedit
example, all the text would default to EUDC. We now add it after
the default style hint font instead. We also mark it as a
private font family, since it should not be shown in the font
combo box as a selectable font, but should only be used automatically
as fallback for PUA characters.
Task-number: QTBUG-65308
Change-Id: Id2ffd058a9f1d660cf2b9b1383ba1fdb10dcc97e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
If a user is using EGL on X, we need to reply to sync requests in the
same way that we do in the GLX backend.
Change-Id: I950de284685dc0ead896688c434828ab1b9c673f
Reviewed-by: Aleix Pol
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@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>
This ensures that the same set of variables can be successfully replaced
in both the Makefile and Xcode generators. It also switches the default
templates to use the Xcode-style ${var} syntax instead of the @var@
syntax for better Info.plist compatibility across generators.
Change-Id: Iff330bafd152773aafac9143c4a34e34f92f0ce6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@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>
While adding the possibility to access values for QSqlRecord with
decorated field names (table.field), some string-allocations were added
which created a remarkable slowdown. Replace the QString allocations
with QStringRef avoids those allocations and restores the speed for
normal operations (apart from on QString::indexOf() call and some
integer comparisons)
Task-number: QTBUG-65226
Change-Id: I9e458523891421abce9e4a7ed931fec000dcbe76
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The editor geometry was adjusted to a proper size in RTL-mode, but not
in LTR-mode. To fix this inconsistency, the geometry is now also
adjusted in LTR-mode to make sure the editor has enough space for the
min/max values for the given datatype.
Task-number: QTBUG-37433
Change-Id: Iff41e854f2fa2104ab5c589d24780facc3ed5815
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QHeaderView::resizeSection() did not check if the given section size is
inside the min/max property bounds.
Also on calling setMin/MaximumSectionSize() the current section sizes
were not checked if they are inside the new given bounds.
This is a small behavior change when a user is setting the section size
via resizeSection() without respecting the min/maxSectionSizes.
Task-number: QTBUG-64173
Change-Id: Ia9c9eebf058d60c776ab5f8f8336642013ec553f
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
clang required adding template clauses to \fn commands and in one
instance, removing a formal parameter name from a \fn command. An
instance of Q_QDOC was changed to Q_CLANG_QDOC in the include file.
Change-Id: Ic7dab56705043d2db8578dfc002d2f41b927f756
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Several enum values had to be given \value statements, and a
member function only visible for Windows had to become visible
to clang-qdoc.
Change-Id: I47fbbcf9c5e4333abd13a041ce8fee2c13f9541d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Since Xcode 6.3, this must be set to NO because stripping on copy is no
longer fully supported due to the potential of input binaries being code
signed. In this case Xcode will simply ignore the strip step and issue
a warning since stripping would invalidate the code signature. This
change silences that annoying warning for release builds. Also, the
setting assignment is moved from being hardcoded in the generator, to
a QMAKE_MAC_XCODE_SETTINGS value.
Change-Id: If25511edddc12b7b0407e2992d80884b7d6437dc
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This problem does not affect the Xcode generator.
Task-number: QTBUG-65477
Change-Id: I6194edc5b679edad9ae1a25e35b71e5df9bd4c95
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Added missing template clause to \fn commands required by clang-qdoc.
Changed a few Q_QDOC macros to Q_CLANG_QDOC.
Change-Id: I20e6855b13df6384b471fc2bb5de27b0e3b44d1b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Added missing template clause to \fn commands required by clang-qdoc.
Removed several obsolete \sa targets. Added a few missing return types
to \fn commands.
Also changed a } to ] in a \fn command in qrandom.cpp.
Change-Id: I0f004a1e57507ff5fb035e822ca8b1baa7faad9b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>