Compiling the default examples should be possible without compile errors.
Task-number: QTBUG-46857
Change-Id: Ie323798df09cdbebc67eb617a7e0ec4c66cb2357
Reviewed-by: Simon Hausmann <simon.hausmann@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>
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>
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>
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>