Task-number: QTBUG-65687
Change-Id: Ie795c8ac715e36656dabcbcdf8976d303ebaf0d1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
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>
The template clause was missing in the \fn command for
a member function of a template class.
Change-Id: Ie1a8f8372d3183f05f02e518b363a7bac735abbb
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The class qualifier was missing in the \fn command for
the move copy constructor.
Change-Id: Ia3633efde155ed19ac8460d760a5248e52097ea1
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
A few \fn commands were missing the template clause now
required by clang-qdoc. This update adds the template
clauses. It also changes an instance of Q_QDOC to
Q_CLANG_QDOC.
Change-Id: I2850d43d98debb80e01c36a524e0c00651a89298
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Some options only make sense if the printer has installed some extensions, e.g.
we should not shown "Staple" options if the Stapler addon is not installed,
so with this change we use ppdInstallableConflict to know whether an option
should be shown to the user or not.
Change-Id: I5733e1ac8b667c26b292aeafc90a10c155b751a4
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Previously it was a bit awkward to use, you had to do
QStringList cupsOptions = QCUPSSupport::cupsOptionsList(printer);
QCUPSSupport::setCupsOption(cupsOptions, option, value);
QCUPSSupport::setCupsOptions(printer, cupsOptions);
now you simply have to do
QCUPSSupport::setCupsOption(printer, option, value);
Change-Id: Id31583f1ec72644791d82776debbae5583a2be54
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
According to CUPS maintainer it is recommended to not show them[1].
GTK and Libreoffice behave like that.
[1] https://lists.cups.org/pipermail/cups/2015-September/027124.html
Change-Id: I82614003490554d41e38a125d44e3a599c2e7342
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Previous behavior:
* Open, change setting, cancel, open again, setting was as originally (i.e. unchanged)
* Open, change setting, accept, open, change setting, cancel, open again, the setting would be as before pressing cancel
* Open, change setting, accept, open, press cancel without changing anything, print, the initially changed setting is not applied
New behavior:
* Pressing cancel just cancels the changes since you opened the dialog, everything you accepted previously stays correctly selected
Change-Id: I483647504682f26d3d21c5229cc6530bf14fe519
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
First steps towards a public API for having multiple output sinks is
to allow this internally.
We give all the different log sinks the same signature, with a bool
return value to signify if stderr has been handled.
The logic of not logging to the alternative sinks when the function
qt_logging_to_console() returns true has been moved into each sink,
so that they in the future may choose to log even when also logging
to the console, allowing multi-sink output. They must then make sure
to return true if the native logging sink has also logged to stderr.
The logic of each sink has been kept the same when it comes to the
formatting of the message. Some of these sinks should ideally use
the raw message instead of the formatted one, as they are structured
logging sinks.
Change-Id: I441d3bc1db3e16180704e00d13a40564b6f06a6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Structured sinks such as systemd should capture each piece of information
individually, not bake it into the message via the message pattern.
Change-Id: I164c043683f123764a5445dc9faad049e25fd738
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The workaround was needed in older versions of MinGW-w64 headers that
did disable some common functions for -std=c++1z. Anyhow, this is not
reproducable anymore with any recent MinGW-w64.
Change-Id: I8e34a2e055f8e2356696dd4fe131a757c1527574
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
There's no way for the backingstore to end painting on the device by itself,
so we warn the user about what's going on. Failing to end painting on
the device will e.g. in the case of QRasterBackingStore result in having to
make a copy of the QImage data during flush.
Change-Id: I3fbac2d7a8a440fdb23197ac2d57d95bfaf9e125
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Removed unneeded \fn commands from two qdoc comments and
moved one of the comments to the file where its function
definition is located.
Change-Id: I4c4371f0541d2995398b0d32e1df409433061226
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
We seem to induce QCoreTextFontEngine to draw text the
wrong way in non-native QMenu popups. Here, we just
delegate menu items' text rendering to AppKit.
This is only a workaround pending a proper fix or better
understanding of the aforementioned issue.
Change-Id: I71088ebe2a534bebca2ad396b1ea6754be093f55
Task-number: QTBUG-65653
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
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>
Use the constructor taking a string and convert number unless
it is -1.
Change-Id: I18d1ba2c8e0d3f4af01b7955863967f75051746b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
To avoid the silent exits and potentially dangerous output values, the
caller must supply the correct parameters on input.
Change-Id: Ia9c56940adbf4ad34605a002dfc5c86b32c4658c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Original documentation commit included unresolved link target names.
This fix replaces them with the actual OpenGL function names.
Change-Id: I36a24eb237ef35d7207f3bae0771dc96476d7b19
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Otherwise the protocol name might clash with existing protocols when
using Qt as a plugin, and those existing protocols may have lived in
images that since have been unloaded, causing crashes.
Change-Id: I68fbe290bcbf2fabf463647c960f686971e066dd
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Objective-C category methods prohibit safe unloading of dynamic
libraries / plugins statically linked to Qt. Although they can be called in
convenient way they can be replaced with standalone functions without
noticeable drawback.
Remove unused qt_validModesForFontPanel category method.
Remove empty NSStatusItem (Qt) category.
Task-number: QTBUG-59884
Change-Id: I69503a115b1177623da91c67b62d72e56f43ffcf
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Factor out translation from the matrix applied on bitmap glyphs,
as that gets applied as position when painted.
Task-number: QTBUG-64313
Change-Id: Iab8d995c00ee02eda0896242903312d837b6d790
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 07fcfb793d)
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The function is declared as STDCALL, so we can't add a direct function
pointer to it (calling convention doesn't match what QtCore will try to
use). Instead, add a lambda as a trampoline.
Task-number: QTBUG-65471
Change-Id: I39332e0a867442d58082fffd1504002206e5cfaf
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The referenced static meta object for the superclass might be in a
different DLL. In this case, the whole QMetaObject can't be initialized
all via preinitialized data in the data section of the binary, but must
run code at runtime to fill in the value of the dllimported pointer.
In these cases, both GCC and MSVC initialize as much as possible statically,
while only filling in the dllimported values (QMetaObject::d::superdata)
at runtime. Clang, on the other side, initializes the whole struct
at runtime if some part of it needs runtime initialization, leaving
the struct completely uninitialized before constructors are run.
In C++, there are no guarantees for in what order constructors in
different translation units are executed. This in particular means
that there are no guarantees as to whether qRegisterWidgetsVariant()
in qwidgetsvariants.cpp runs before or after the runtime initialization
of QWidget::staticMetaObject.
With GCC and MSVC, this doesn't seem to have mattered since only the
superdata pointer of the staticMetaObject was uninitialized - everything
else was initialized, and the superdata pointer doesn't seem to be
accessed during qRegisterWidgetsVariant.
With clang, the whole staticMetaObject is uninitialized, unless the
staticMetaObject has been initialized before (and the initialization
order is undefined).
By setting a manual priority (which is a GCC extension that also
clang supports) for the staticMetaObjects, we can be sure that
these are initialized before the actual explicit constructor
invocations (without any explicit initialization priority) that
can access the staticMetaObjects.
Change-Id: I64a82f12d690528567509791bae088b6304e189b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QHeaderView::visualIndexAt() did not calculate the correct position in
right-to-left mode. This lead e.g. to missing vertical grid lines in
QTableView/Widget when scrolling horizontally.
Change-Id: Ia50e5cfd7830a6ad8abd17ff79d9fbb33dc4097c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Remove some c-style casts from int to uint which were needed in Qt3 (or
earlier?) but nowadays the values are all int.
Change-Id: Iecd739c450873adf952a17f635d7fb6825537907
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
As the HANA ODBC driver does not provide scrollable
results per default, the connection has to be established
with a specific option.
Change-Id: I14751a94f61d6fffd6d56c39076c24ec4d1f88ef
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joachim Puhr <jpuhr@gmx.de>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
AKA the model tester, living in QtTestLib now.
Underwent some significant refactoring from the original modeltester:
in particular, it will stop testing illegal indices.
[ChangeLog][QtTestLib] Added QAbstractItemModelTester, a class
to help testing item models.
Change-Id: I0e5efed7217330be11465ce3abb3590f3f2601a4
Reviewed-by: David Faure <david.faure@kdab.com>
Change the condition to strong equal, as 'bytes' was checked against
wrong value on the start of the function.
Change-Id: I4ec4768b9fff3292af233417c4a5862d72d4eeac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
There were several problems that i've fixed in a single commit since they are very interwinded
* The dialog used QPageSize::Custom for two things, the custom sizes coming from
the printer and the "user can write whatever size they want" size. Now only
the printer custom sizes use QPageSize::Custom and we use m_realCustomPageSizeIndex
for the "user can write whatever size they want" one.
* The dialog stored the QPageSize id as the combo userData, that doesn't work
when the printer has multiple custom sizes since they all share QPageSize::Custom
so now it stores the QPageSize itself
Task-number: QTBUG-58733
Change-Id: Ie640a07bb5e24b753db83c091c836e8af4ff126c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
We need to update the printer output format and the current print device
when changing the printer so that if the user opens the properties dialog
for that printer it reflects correctly the selected printer.
Change-Id: Ib6767a74b74b8eebe43ff17006b6105c483a08b6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
No need to call PQgetvalue() before PQgetisnull().
Change-Id: Ie83ee577b082dbe9d9ca2e86212a281abebdde6e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@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>
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>
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>
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>
[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>
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>
This reverts commit d7bcdc3a44.
Now that QPalette::setBrush() is a bit smarter (see
c564779c07), we can be
confident the palette's cache key won't change so often.
Therefore, we can use it again as part of every pixmap's
cache key.
Change-Id: I5cab2296a937f9149c7745291e0442eea24f4e9d
Task-number: QTBUG-65475
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Fixes a deprecation warning about QDesktopWidget::screenGeometry().
Change-Id: Ib56b2d3f62ddca60d84b4f626571b5e444304804
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The previous code assumed that ppdMarkOption returning non zero (i.e. it has conflicts)
also meant that the option wasn't applied at the ppd level, but it actually is.
What we need to do is after calling ppdMarkOption parse the tree again looking
to see if any option is conflicting and mark it as such in the UI.
Change-Id: I836f1902d14dc8c176bb06776471cbf4ed11786f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Since there may be some applications that want to make their comboboxes
scrollable or not with the mouse wheel then a style hint is added to
make this toggable. It defaults to true for all platforms except macOS
to keep it in line with existing behavior.
[ChangeLog][QtWidgets][QStyle] Added SH_ComboBox_AllowWheelScrolling as
a style hint to enable/disable the use of the mouse wheel in a QComboBox.
This defaults to true in all styles except the macOS one so there is no
change in existing behavior.
Task-number: QTBUG-53094
Change-Id: I6eb61e1990bfc79e3b3ea82d7b91ee39096fa077
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
It has been a while and it is supposed to be updated at every release.
[ChangeLog][Third-Party Code] Updated top level domain-list from Mozilla
Change-Id: Ifd3e5fe33166e793908b3ce28d29a507b483dd8a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
These options are used by winrtrunner/Qt Creator to control logging
and debugging behavior and should not influence applications.
Without this change applications that use
QCommandLineParser::process have to explicitly remove these values
from the arguments list or the application will exit with an
"unknown option" error when run from Qt Creator.
As winrt applications do not natively support command line arguments,
breaking the use case of having these values as valid command line
options is acceptable.
[ChangeLog][qtmain][winrt] -qdevel and -qdebug are removed from the
command line arguments and not passed to the application.
Change-Id: I60e5565148fd3dd0155b946607fdf5042139d2e1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Clang errors out on casting from a pointer to a smaller integer
type.
This is an adapted backport of a newer upstream harfbuzz
commit, 03b7a221f701a9b003890878e730ad175c3fdd86.
Change-Id: I0de62d90008021aed6acf4e946ce1d346f9aac8c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Not all X server vendors support the XKB protocol. Furthermore,
while X.org seems to use keycodes that match the usual keyboard
scancodes, other vendors may not do so. This means that using an
XKB keymap suitable for an X.org server results in garbled input
with servers for other vendors.
Both of these issues are addressed by using the core keycode
information as a fallback.
[ChangeLog][X11] Fall back to X11 core keycode information
if an XKB keymap could not be determined through the connection.
Task-number: QTBUG-44938
Change-Id: I64568aa31113d5a3fd90f70c63320a497db21477
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Setting the same brush on the same group and role should
not detach nor alter the result of QPalette::isCopyOf().
Task-number: QTBUG-56743
Change-Id: Ic2d0dd757d703b01e8c5d835a8c124b3317653f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When the user changes the advanced settings we call
setProperty PDPK_PpdOption so if the user cancels we
need to set them back to what they were originally
Change-Id: Idd0cb413fb1e68dd28cf66f7f66f7e0afb38393e
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Make the members private and add getters
Make some other functions also private
Move setCupsOptionsFromItems from QPrintPropertiesDialog to QPPDOptionsModel
Change-Id: Ibb555a6e6be53550f30c159c3ad611d55e2a767a
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Added missing template clause to a template friend function
of class QVariantAnimation.
Change-Id: Ia96dcbb1dad1f6678642564a55991445d0b6ba0e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
clang required adding template clauses to a several \fn commands.
There was also a case where Q_QDOC was changed to Q_CLANG_QDOC
in qtimer.h
Change-Id: I1184e507a3fa719fe5049ade80e5da24f52ac851
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
clang required adding template clauses to a few \fn commands.
|| defined(Q_CLANG_QDOC) was also added in qmutex.h.
Change-Id: I7e61f460a8f8f15032094fb35c02f73721a5eb8a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Added template clause to several qHash() functions and
created a \typedef comment for QHash::const_key_value_iterator.
Change-Id: Id56191f69bf9f36e606101e46bf1dfa528d88e09
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The incorrect ones had been removed already, but they
reappeared after a branch merge, I think. This update
removes the old ones again.
Change-Id: Ief971819651fa3517f374d9f226c68bf7f015cb0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
MinGW's headers and libraries are lowercase, and MSVC is generally
run on a case-insensitive file system. Referring to libraries with
a lowercase name is more compatible.
This fixes cross-building using MinGW, and matches a similar
change for headers in dfaa32a945.
Change-Id: I728376f239a23c700416643cae98e271bbcdff32
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This fixes a regression from ba44cdae38.
Task-number: QTBUG-65516
Change-Id: I989b075d3f96170660042349437e4a6a4a115cf9
Reviewed-by: Liang Qi <liang.qi@qt.io>
What was broken:
- m_xiGrab on successful ungrab (XIUngrabDevice) was never set to 'false'.
Which means that we would unnecessarily call XIAllowTouchEvents, even when
we are not grabbing (this did not have any apparent side effects).
What was non optimal:
- Redundant XIQueryDevice calls. XIQueryDevice with XIAllMasterDevices flag
already returns all required devices. Calling XIQueryDevice for every id again
does not make sense.
- Querying for master pointer info on every grab is unnecessary. Simply cache
ids of master devices whenever hierarchy changes.
What remains to be investigated some time later (or never):
The original and the re-factored code grabs all master pointer devices. Not
sure if that is the expected behavior on MPX (Multi-pointer X) systems. Could
there be two context menus, each dismissed separately? MPX concept was introduced
in XI2.0, but testing shows that this setup is not very well supported even on
modern desktop environments. Tested on Ubuntu 16.04, where multiple pointers is
enough for crashing a terminal. Also AFAIK there isn't any bug reports about
broken MPX support in Qt.
Change-Id: I53f99c6efd44abc43a0985e15cff8aae7ebba8f1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
QTreeWidget::visualItemRect() returned an invalid QRect when a column
was moved and then hidden (or the other way round). The reason was that
the logical index returned by QHeaderView::logicalIndexAt() was again
passed to QHeaderView::logicalIndex() to create the QModelIndexes needed
for QTreeView::visualRect()
Task-number: QTBUG-28733
Change-Id: I8676f21bcab8c05c2260b85d483902f18cbf3e24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
The menu indicator was not adjusted in RTL-Mode to be on the left side
of the text. Use visualRect() to adjust the rectangle before drawing
the PE_IndicatorArrowDown.
Task-number: QTBUG-50084
Change-Id: I20129499f111d06637c98ede23b4635a3fc34a6c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Q(Tree|Table|List)View was able to display a simple
QJsonValue::String, but not QJsonValue::Bool/Double. This
is an inconsistent behavior which is fixed with this patch.
Task-number: QTBUG-65082
Change-Id: I22c2fe2890f11e283cae4f7ea947aa67ff36f367
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Also adjusted the text segmentation and line break algorithms
so that they can handle the new data, and pass the test suite.
Change-Id: Ib727fd80003e34e96458d7a681996de3fa3691e7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The text segmentation data is not being updated in this change,
as it requires additional code changes. Updating those will
come in a follow-up commit.
Change-Id: I5d6b6bc96044e8dd0c25cf6f79756e7f68bf6e7c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Make sure we properly handle both directional embeddings as well as
directional isolates to determine the direction of the string.
According to the latest version of the Unicode bidi algorithm,
parts of the string contained inside an directional isolate is
to be ignored when determining the paragraph direction. Embedding
markers themselves are to be ignored as well, but not the characters
inside an explicit directional embedding or override.
This is also some required pre-work to get our BiDi algorithm
updated to the latest version of the standard.
Move the implementation to QStringView and implement the methods
in QString and QStringRef through that implementation.
Task-number: QTBUG-57743
Change-Id: I7f24e09198e22d6359c6534c9ae40a904e94c46e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
So invert the list and let "msvc-2017" be the latest, at least until we
know about a different version.
Change-Id: I39332e0a867442d58082fffd1504c316e27f51d0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
QTreeViewPrivate::itemAtCoordinate() did not calculate the correct item when
non-uniformRowHeights is enabled and vertical scroll mode is ScrollPerPixel.
This results e.g. in an activation of the item above when the click happens
on the very first pixel line of an item. Another, more problematic effect was
that once a drop happened on the very first line of an item,
QAbstractItemViewPrivate::dropOn() calculated the root as the drop index
because the visualRect of the calculated item is compared with the drop
position which did not match.
Task-number: QTBUG-57538
Change-Id: If89571bf0fb76fc01d60ba7139f1d985b49d70db
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Add an env variable QT_MAC_TABLET_IGNORE_BUTTON_MAPPING which, if set,
reverts to the old behavior.
The issues that it fixes are:
1) With a Genius tablet, it's not possible to generate a middle-click
at all, regardless of preferences, unless you set this variable
2) With a Wacom mouse (passive mouse used with an Intuos 3), the
side-buttons (normally mapped to forward and back buttons) do not
work unless you set this variable
[ChangeLog][macOS][Tablet support] If you have changed
the button mapping of your Wacom tablet in System Preferences,
it will be respected in Qt applications. To revert to the
old behavior, set the environment variable
QT_MAC_TABLET_IGNORE_BUTTON_MAPPING
Task-number: QTBUG-57487
Task-number: QTBUG-54160
Change-Id: I0a1c9c6550e4dfe6ee2daa2d993f22691430826c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Due to the integration of clang in qdoc, several qdoc warnings
appeared for class QRandomGenerator. This update corrects all
the remaining qdoc warnings.
Change-Id: I92fe9f7d9cb193e145ee8ad0e7198625b9a5bf7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unconditionally apply window cursors restoreOverrideCursor() also for
platforms with override cursor capability in case
a cursor was changed while the override cursor was active.
Amends b05d1c2ebf.
Task-number: QTBUG-65001
Change-Id: I7fd38a27dcf045f2fb48a16abb484342feaab5df
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
QTreeView makes columns movable except for the first one
(since Qt 5.0, see commit e0fc088c0c). This is indeed best
for actual trees, but not when using QTreeView as a flat
multi-column list (with no "root decoration"). Then it should
be possible to move the first column.
[ChangeLog][QtWidgets][QHeaderView] Flat treeviews can now allow
the user to move the first column (like in Qt 4.x) using the new
method QHeaderView::setFirstSectionMovable().
Change-Id: I6b5025e40850bf5c4c373124ee81f657f3f09d29
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Since DB2 can potentially have more than one error code, we need to join
these together using ';' as a separator.
Task-number: QTBUG-142
Change-Id: Idd376df84a8e3ae4c05b4722b4d0020fa4f3edad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QSqlDatabase objects can only be used in the thread that the connection
was opened for. So if the driver was created already then we check if
the thread is correct. If it is not then we output a warning and return
an invalid QSqlDatabase.
[ChangeLog][QtSql][QSqlDatabase] QSqlDatabase::database() will return
an invalid QSqlDatabase if the calling thread does not own the requested
QSqlDatabase.
Task-number: QTBUG-216
Change-Id: Ib5a25aa62129e3925f9819109af05961e5178bc5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>