Commit Graph

41750 Commits

Author SHA1 Message Date
Qt Forward Merge Bot
84db112fe2 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I69f44ea7254cb2643a00b040bbb46f41b7f76a87
2019-10-19 01:00:45 +02:00
Tor Arne Vestbø
ff2ba8b9d2 macOS: Let system decide whether modal window should prevent app termination
The logic for preventing application termination when there are modal
windows active was a leftover from the Carbon to Cocoa port, and is no
longer needed. AppKit will deal with this on its own, by checking the
preventsApplicationTerminationWhenModal property of each NSWindow.

In some cases AppKit will also ignore this property, such as when
quitting the application from the menu entry, which means we now get
the default system behavior for this use-case.

Change-Id: Iac5d8d8e17eb0974448f7ee6f39c9b7761bf4d90
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-18 13:30:54 +02:00
Johan Klokkhammer Helsing
52484cc4b6 Widget tests: Skip tests that fail on Wayland
Either by testing for platform name or window activation.

After this gets in, we can enable widget tests in the Wayland bot, which
hopefully will reduce the number of regressions in the Wayland plugin.

Fixes: QTBUG-62188
Change-Id: I71ce8abd6b5891e5b953126b1c35345892585931
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-18 10:53:34 +02:00
Volker Krause
2c9bd677ab Make QSslError::SslError a Q_ENUM
This avoids error prone manual mappings when having to persist such values,
as eg. done in https://cgit.kde.org/kio.git/tree/src/kssld/kssld.cpp#n49.

Change-Id: Ib279c116a10ce8edc0b686b8b80cbd848b4b410e
Reviewed-by: David Faure <david.faure@kdab.com>
2019-10-18 08:37:43 +02:00
Ulf Hermann
a7df98a9a7 QSortFilterProxyModel: Add a cheaper way to find source_sort_column
There are two places where we are only interested in the mapping of
proxy to source sort column, rather than the full mapping. Creating the
full mapping is rather expensive as it iterates all rows and columns and
allocates a large number of objects. Just figuring out the n-th accepted
column can be much cheaper.

Fixes: QTBUG-41659
Change-Id: I7ea914cb695518b4d47cdc3ad67c7786380d8709
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-10-18 08:36:36 +02:00
Eirik Aavitsland
19f29802bf Fix: QPainter off-by-one clipping for some non-integer scalings
For some scalings, setClipRect(QRect) would produce a clip one pixel
different from setClipRect(QRectF) because of different
rounding. Ditto for setClipRegion. Fix by making sure to transform
QRectFs instead of QRects.

Fixes: QTBUG-78962
Fixes: QTBUG-78963
Change-Id: I0be721133858c30769ec6d81e978962a3d6b70cf
Reviewed-by: Christoph Cullmann <cullmann@kde.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-18 06:11:39 +00:00
Qt Forward Merge Bot
56e5e06ff2 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I24461492372fb9a2e46a3b8dfb6c854b85e9c600
2019-10-18 01:00:52 +02:00
Qt Forward Merge Bot
dce8849037 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4fbbf100b673ab100997dbf2f42bf195dc3c050f
2019-10-18 01:00:35 +02:00
Christian Ehrlicher
14b61d48e8 QPSQL: Add support for PostgreSQL 12
Add proper version check and replace long deprecated and now removed
access to pg_attrdef.adsrc.

[ChangeLog][QtSql][QPSQL] added support for PostgreSQL 12

Fixes: QTBUG-79033
Fixes: QTBUG-79064
Change-Id: Iec1b13945c34ea017139ad1c5539ab5b7f1e03aa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-17 22:30:30 +02:00
Volker Krause
e5c003b77d Set icon on the select-all action in the text edit context menu too
Makes this consistent with the rest of the actions here, and avoids
dirty hacks like KIconTheme::assignIconsToContextMenu.

Change-Id: I749f4d5f67efdbf595a52185dd507de5f87f6487
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-10-17 16:52:38 +02:00
Frederik Gladhorn
328122dddd tst_qiconhighdpi: fix target name
CMake will complain that we have a duplicate test name otherwise.
Generally it makes a lot of sense to name the test binary the same as
the test itself.

Change-Id: I27c4b51e6a2869f025e1100f1a9dd6b54ebdaf55
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Morten Kristensen <me@mortens.dev>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-10-17 16:44:51 +02:00
Frederik Gladhorn
898ab9677e Linux print dialog: use simpler terminology for duplex
Make the dialog more user-friendly by using simple terms.

Fixes: QTBUG-79100
Change-Id: Ie4fa61cd0dc2a7fe5af9fd5834abe9d0e88c55de
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-10-17 16:44:30 +02:00
Johan Klokkhammer Helsing
4b5ff2be7c QGraphicsView tests: Prefer exposed over active
Makes the tests pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I5860c1ae6dd3d15632d827f4e357cb6c2cc9c5e3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-17 13:12:17 +02:00
Johan Klokkhammer Helsing
ee4a604a2e tst_qdialog: Wait for exposed instead of active
This makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: Ib67cf8913055bbe753f71791095aff035342c18d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-17 13:12:12 +02:00
Lars Knoll
2c47d53249 Don't use a QList on a type that can't be copied
QGlyphSet would not copy correctly, but also didn't have
a Q_DISABLE_COPY defined. This can easily lead to undefined
behavior, and was visible when trying to do the QList
to QVector conversion.

As we only have a 10 item large LRU list here, implement it manually.

Change-Id: I903085ddeac59224715dca6e8a1ff26c44f5b0b0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-17 13:11:49 +02:00
Ulf Hermann
c5e9d7e504 Generate metatypes.json for QtCore, QtGui, and QtWidgets
These libraries contain types which are exposed to QML from
qtdeclarative.

Change-Id: Ie0edaef94fcb40074b6f6b2ea1a1c3a77ed3e9a9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-17 12:50:35 +02:00
Ulf Hermann
7dd14c6009 Move CBOR debug stream functions into qcborvalue.cpp
Some of them were already there, and this way they continue to function,
even if the cborstream feature is turned off.

Change-Id: I6828d2f525ab0a1437fc940a0fe786f6fa56fd6a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-10-17 12:50:35 +02:00
Qt Forward Merge Bot
6f27bb1352 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ica69de99be9c8af4d28a52e4b69e6af748ed983c
2019-10-17 01:01:01 +02:00
Samuel Gaist
c222a9283d QAbstractItemModel: implement QRegularExpression support for match
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

[ChangeLog][QtCore][QAbstractItemModel] The match() method now
supports the new Qt::RegularExpression match flag value. This
will allow users to use either a string or a fully configured
QRegularExpression when doing searches. In the second case,
the case sensitivity flag will be ignored if passed.

Task-number: QTBUG-72587
Change-Id: I07c8d72a661c48b7f4fcf13ef8e95980bcdcb998
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-10-16 21:53:30 +02:00
Simon Hausmann
dc4212b3a6 Fix duplicate platform plugin definitions
androidplatformplugin.cpp and main.cpp both tried to define the platform
plugin entry point. That happens to work with the android toolchain by
chance, but it's certainly not intentional.

Change-Id: Ie92281abfb2335aa3ee83bc0ba660700d3485b2d
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-16 17:10:21 +02:00
Ulf Hermann
85ed676dff Provide a feature for CBOR stream I/O
We need to turn it off in bootstrap code.

Change-Id: I826e49fbc5f6128e56f84b58d29358dd7b0b9dc5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-10-16 12:16:04 +02:00
Tor Arne Vestbø
5c37258b06 macOS: Don't dismiss menu during applicationShouldTerminate
The logic was a leftover from the Carbon days and is no longer needed.

Change-Id: I557b669eadea902fa439c43162218c5864077df9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-16 12:04:57 +02:00
Christian Ehrlicher
d5c4cd7a25 Examples: fix compiling tablet example on qnx
std::abs(int) is defined in cstdlib which is not included on QNX.

Fixes: QTBUG-78763
Change-Id: I14d087069369db7ab4e5db9d4f816a3fbffe95f6
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-16 09:18:04 +02:00
Eirik Aavitsland
ea377c5a2f Add testing of fillRect() to QPainter lancelot test
Change-Id: I3be230d3fafa178a37cf7387f79f372c8d8aeb05
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-16 06:31:59 +00:00
Christian Ehrlicher
78d349eaab tst_QSqlQuery: remove tests commented out a long time ago
Remove some code which was commented out with 'NOT_READY_YET' since the
initial Qt5 import. Since the mentioned bug reports are no longer
available remove this code.

Change-Id: I98686e53d85619f01d16105d147eba79b557a104
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-16 08:25:38 +02:00
Johan Klokkhammer Helsing
821c2eb131 tst_qfiledialog2: Don't assume window activation is available
Prefer qWaitForWindowExposed over qWaitForWindowActive whenever possible, skip
in the other cases.

Makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I60b4000c72c3727a2f33b79a5038469055b0fef2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-16 07:06:12 +02:00
Johan Klokkhammer Helsing
8814c5778d tst_QAbstractScrollArea: Use qWaitForWindowExposed instead of active
Makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I53011ad623e4bdb557d79c136f06ce7ac00a08ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-16 07:03:09 +02:00
Qt Forward Merge Bot
e3f5912747 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I8348c823117dd3d594d365fc3583f7e44d44a81c
2019-10-16 01:01:07 +02:00
Qt Forward Merge Bot
faab18c65a Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ifd83db69416230175ddc3161f640b612755018fc
2019-10-16 01:00:49 +02:00
Simon Hausmann
5f160a3699 Fix static linking when bearer management plugins are built
The bearer plugins include copies of moc generated code that results in
duplicate symbols when static linking pulls in multiple bearer plugins.
Instead of relying on toolchain defined behavior, this patch moves the
code that is shared into the shared library as private API. This way it
will exist only once in memory and once at link time, resulting no
linking errors about duplicate symbols.

Fixes: QTBUG-79211
Change-Id: Iafa45c234e7fdd998971fc9cb7116334d08907bc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-15 20:51:26 +02:00
Ulf Hermann
06ca5c49e7 Cbor: Avoid QUrl in bootstrap code
QUrl is not available when building qmake. Hopefully we can get rid of
this mess in Qt 6.

Change-Id: Ia234996dd4f27d7f843db227e4cf2db869c92dc1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-15 20:39:32 +02:00
Johan Klokkhammer Helsing
80ddac3a0a tst_qgraphicseffect: Wait for exposed instead of active
Makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I3900925e74d8d940a8c5af87ea64a6ec3c8c3293
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-15 20:39:32 +02:00
Sona Kurazyan
9cc040a806 Prepare for deprecating the QDesktopWidget
QDesktopWidget is marked as obsolete in docs, but it is not yet
completely deprecated, some of its methods are still in use.

Replace uses of the following methods marked as obsolete:
- QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen()
- QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry()
- QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry()

Task-number: QTBUG-76491
Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-15 20:09:29 +02:00
Laszlo Agocs
92b9dcfe2b rhi: gl: Do not let external rendering trash our vao
Task-number: QTBUG-79221
Change-Id: Ie8e6376f79c816071c12962dc054838aeaabcaa5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-15 20:09:29 +02:00
Tor Arne Vestbø
027d45cb57 macOS: Simplify Objective-C namespacing
We only need to use the QT_MANGLE_NAMESPACE macro when declaring the
interface of the class. As long as we couple that with an alias
declaration using QT_NAMESPACE_ALIAS_OBJC_CLASS, any further uses
of the class name can be un-namespaced, including declaring
categories on the class.

The only snag with QT_NAMESPACE_ALIAS_OBJC_CLASS is that it can
only be used once per class and translation unit, so forward
declarations get hairy, but we can avoid that by just including
the headers instead.

Change-Id: I333bcd18fe1e18d81fbd560b0941c98b1c32460e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-15 20:09:28 +02:00
Christian Ehrlicher
ed7dd9a6ed QODBC: Fix crash when a prepared statement is deleted after the db was removed
When a prepared statement is still alive after the database was removed
with QSqlDatabase::removeDatabase(), the cleanup routine is trying to
access the driver which is no longer alive which results in a crash.

Fixes: QTBUG-79019
Change-Id: I4630e3b947a12b23ed062f015abc373fc0e246c1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-10-15 13:37:42 +02:00
Andy Shaw
2ec93e29f7 Cocoa: Update the PPK_PrinterName property if one is explicitly set
When a QPrinterInfo is passed in to the QPrinter then it needs to ensure
that the underlying session is set up to use the specified printer,
otherwise it uses the default one as it has not been changed.

Change-Id: I90012223e9831303d02fd3ffc68223dc492ece0c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-15 09:43:34 +00:00
Albert Astals Cid
3026c0630d pass QSqlDatabase by const &
Change-Id: I326c09ab9313098470cb657571f67755fd7810c7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-15 09:04:53 +02:00
Friedemann Kleint
05a829f923 Win32: Consolidate registry code
Add a RAII class for registry keys and use it throughout
the code base.

Change-Id: I666b2fbb790f83436443101d6bc1e3c0525e78df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-14 20:26:42 +02:00
Johan Klokkhammer Helsing
51f092905a QTest: fall back to qWaitForWindowExposed in qWaitForWindowActivated
...if window activation isn't supported.

Task-number: QTBUG-62188
Change-Id: Ia83de59d9a755d95b7150eb5261bc43dd7b60588
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-14 20:02:10 +02:00
Giuseppe D'Angelo
50481fb909 QEndian: do not use "raw" constexpr
Use the Qt's macros instead, since constexpr support may be revoked
on certain compilers.

Amends d26289ffb4.

Change-Id: I62354b14b57ae5fcbf3f1186ddb48bcf26535e90
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-14 18:03:55 +02:00
Leena Miettinen
3478f6c447 Doc: Describe using QVERIFY to verify validity of QSignalSpy
From https://wiki.qt.io/Writing_Unit_Tests

Change-Id: I3186efe30cde465766800aee1f0a530fb80907fb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-14 14:10:47 +02:00
Kari Hormi
79d7487c89 Fix cursor not showing in empty block preceding a table
When an empty text block precedes a table in QTextEdit, the cursor in
the said text block is drawn twice (in order to make sure that the
cursor is drawn on top of the table) with inverted colors, resulting in
nothing showing up. This commit checks for an empty block before the table
and skips the first drawing of the cursor if that's what it finds.

Fixes: QTBUG-62919
Change-Id: I828d06e0645007ac42e3f308a35868b4f0db1380
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2019-10-14 15:10:46 +03:00
Edward Welbourne
689405fb5c Use arrays rather than assigning literals to char* (warning-fix)
Integrity has a hack, to let us link to the library mmap is in, that
depends on two extern "C" symbols of type char *; but assigning a
string literal to a char * variable as initializer is a const-ness
violation (as the Integrity compiler does point out), so change the
two variables to be char[] instead of char *, so that the literals
populate (and determine the size of) the arrays, instead.

Change-Id: Iab34fb378bc0522e14539592ead066f068751ad0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-14 14:10:46 +02:00
Johan Klokkhammer Helsing
332c255c69 tst_qgraphicsitem: Skip tests that fail on Wayland
Task-number: QTBUG-62188
Change-Id: If0638d51bffa6ef375476c0a601c387bd05583ae
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-14 14:06:32 +02:00
Friedemann Kleint
95ac2072bb QtWidgets: Suppress QEvent::WindowActivate when minimized
Prevent call to activateWindow() for minimized windows in
QWidget::setWindowState() by clearing the flag.

Fixes: QTBUG-46763
Change-Id: I40389d0906438ffe251fc79f18a523ecb53edb1b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-10-14 10:36:43 +02:00
Sona Kurazyan
ffac899576 Fix the size calculation of QHeaderView when stylesheet is used
When calculating the header section size based on its contents when a
stylesheet is used, the size hints from the stylesheet are used. In case
if the stylesheet specifies only one of the sizes, the other is set to
-1. Because of this the actual content size is ignored.

The solution is to calculate the size based on the application style, in
case if it's not specified in the stylesheet.

Fixes: QTBUG-75615
Change-Id: I3453fa623d75b6b32832edf753de6e3e4e7f5a22
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-14 10:17:07 +02:00
Lorn Potter
139246faa3 wasm: fix arch detect on windows with WASM_OBJECT_FILES
Fixes: QTBUG-79146
Change-Id: I00188013b98687f34582aeb7b29b6d7439334536
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-14 17:40:41 +10:00
Tor Arne Vestbø
b03e75670b CoreText: Preserve font descriptors when resolving fallback families
From macOS 10.15 and iOS 13 forward it's not possible to create font
descriptors for system fonts such as .AppleSystemUIFont based on the
family name.

This means we have to preserve the font descriptors we get from CoreText
for fallback fonts, so that we can populate them along with the family name.

Task-number: QTBUG-78821
Task-number: QTBUG-77467
Change-Id: Ifce01da65f90afb7dc2bc3005c3c5870b9c116de
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-14 07:28:01 +00:00
Tor Arne Vestbø
253ce59c12 CoreText: Use StyleHint as fallback when family is not found
Change-Id: I11fb6cafe9d41c38eac6ca0695c89f30f998f257
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-14 09:04:29 +02:00