Commit Graph

39899 Commits

Author SHA1 Message Date
Tobias Hunger
5c05c46e92 CMake: Set define for default QPA platform
This is used to set the default QPA platform and without it
all Gui applications trigger an assert in QString:-/

This is way simpler than going through configure.json.

Change-Id: I2c053e95c0f7e99e97a0b2918d8e4ac13d3494fd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-04-02 13:17:26 +00:00
Jędrzej Nowacki
b91e6f6f40 Issue a warning about unused result of qScopeGuard and QScopeGuard
If the result is unassigned then resulting QScopeGuard is destroyed
immediately, we can warn about it, as it is definitely a bug.

Change-Id: I627b05cecb3d0e62dbc24373e621f2be36d9b324
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-04-02 12:43:14 +00:00
Jędrzej Nowacki
b5f76eeb53 Add missing test to project file
The test was never used or compiled, it has to be fine to add it :-)

Change-Id: If210c19515a545a6dbaef18a16dc018c0348070d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-04-02 12:43:06 +00:00
Alexandru Croitor
e5f0fec762 Fix disabling AUTOMOC and AUTOUIC for generated resource cpp files
when using qt5_add_big_resources.

The previous approach of just setting SKIP_AUTOMOC and SKIP_AUTOUIC
on the generated source files is not enough because if AUTOMOC is
globally enabled, AUTOMOC will still run for the
rcc_object_{outfilename} target, which ends up creating a
mos_compilation.cpp.o file and adding it as a target object to the
target.

Thus later when $<TARGET_OBJECTS:rcc_object_${outfilename}> is passed
to the rcc invocation, the expression evaluates to a list of two
files: the rcc-related .o file and the mocs_compilation.o file.
Obviously that breaks the rcc invocation.

The fix is to disable AUTOMOC and AUTOUIC on the whole target, instead
of just the source files. This prevents the creation of the
mocs_compilation.cpp file.

Fixes: QTBUG-74270
Change-Id: I51f757b110e940fe224010acb25b88c52ef612b1
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-04-02 12:22:29 +00:00
Friedemann Kleint
9cd021f517 uic: Refactor reverse name lookup
Add a helper routine to look up the dom classes by attribute name and
change Driver::widgetByName() and Driver::actionByName() to use that
as does Driver::actionGroupByName() (all these functions are called
with names from the XML files).

Remove the name normalization in
WriteInitialization::findDeclaration() and refactor
WriteInitialization::acceptActionRef() to call findOrInsert() to
correctly use the unique name.

Task-number: PYSIDE-797
Change-Id: I34058361964719c442182faf798f055f11b40412
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-04-02 11:37:36 +00:00
Morten Johan Sørvig
f99fe9cee9 wasm: implement QDesktopServices::openUrl()
Call window.open(url, ”_blank”) for a new tab.

Change-Id: I227904f905262c7aedd086203ed816b53f66359c
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-04-02 11:19:47 +00:00
Allan Sandfeld Jensen
0683bbc67c Fix remaining Q_DECL_OVERRIDE instances
Change-Id: I512ea5a6c8cf2928b276af7f83f00a1df5879595
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-04-02 10:48:29 +00:00
Venugopal Shivashankar
05d9195669 Doc: Use the \nullptr macro instead of 0
This enables overriding the macro so that it translates
to 'None' in the Qt for Python context.

Change-Id: Ib3cecf57eeb0405a1929309b71e9f012a07f11cf
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-04-02 08:14:07 +00:00
Eskil Abrahamsen Blomfeldt
a65800cc68 Add a clarification about "characters" to QTextCursor docs
The function name QTextCursor::positionInBlock() may give users the
idea that it can be displayed to the user as the visual position of
the cursor in the current block. This becomes confusing with some
writing systems, since e.g. a surrogate pair will count as two
characters while only representing a single visual grapheme.

Since it is an side effect of the encoding that will be unexpected to
many, and since it also touches on some linguistic complexities, we
add a note to the documentation to make users aware of the
consideration needed.

Task-number: QTBUG-74725
Change-Id: Iba28ba8a6ad07ee38dbb7e6a5a4b68c93d4da76a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2019-04-02 06:51:21 +00:00
Qt Forward Merge Bot
2f8dcdf93c Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13 2019-04-01 23:08:25 +00:00
Qt Forward Merge Bot
ffe9c395dc Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ia5d893e57deb78bc32e2053a5a79543ff847fe32
2019-04-02 01:00:26 +02:00
Morten Johan Sørvig
81ed119da1 wasm: make windows fullscreen by default
(fullscreen as in use the entire canvas area, without
showing window decorations)

This is a better default for Qt on the web where window
decorations are not common. We also avoid the “window
close” trap, where there is no way to re-open a closed
main window.

Change-Id: Ie0fbf6ada3f49244bee765ea882acb473809e715
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-04-01 20:24:58 +00:00
Jesus Fernandez
758f47eb5d Fix -Wweak-vtables warning
Change-Id: I0cb5916093edf08d72add93573b828021e86256a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-01 15:57:15 +00:00
Alexander Volkov
011794130c Forward physical parameters for derived QImages
More specifically, for masks and rotated images.
Add tests for it, also add tests that image metadata is
forwarded for converted and copied images.

Fixes: QTBUG-49259
Change-Id: I05d4a468b17f53a2625500b871c01b2c53b981a1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-04-01 15:21:27 +00:00
Alexander Volkov
685b8db13a Forward devicePixelRatio in QPixmap::mask()
Also add a test checking that devicePixelRatio is forwarded to
derivatives of QPixmap.

Change-Id: Idb2b3f033ccc0fd49bf54b11f5dffbce5a19b006
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-04-01 15:21:18 +00:00
Edward Welbourne
954b73445c Refine underflow check in QLocaleData::convertDoubleToFloat()
A string can parse as a non-zero double that's smaller than the
smallest float yet be a faithful representation of the smallest float.
So rather than testing for non-zero doubles less than the smallest
float, test for non-zero doubles that cast to float zero; these
underflow.  This means small values close below the smallest float
shall round up to it, rather than down to zero, requiring a tweak to
an existing test.  Added a test for the boundary case (and tidied the
test data).

Fixes: QTBUG-74833
Change-Id: I4cb30b3c0e54683574b98253505607caaf88fbfb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-01 14:40:14 +00:00
Edward Welbourne
4690d4efa6 Fix use of qrand/qsrand in an example
Convert an example to use QRandomGenerator::global().
This saves the need for seeding.

At the same time, use continuum random values rather than discrete
ones, to better fit what the example using it is doing.

Change-Id: I0adebaadb2e35832c629e314fda37e60b51f760d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-01 14:39:53 +00:00
Edward Welbourne
f3002b6e20 Use the QTime API less clumsily
Various patterns seem to have been copied, notably counting time from
QTime(0, 0) rather than using QTime::msecsSinceStartOfDay() and its
setter.  Unsuitable value types also put in an appearance, and
QTime()'s parameters after the first two default to 0 anyway.

Corrected a lie in QTime()'s default constructor doc; it does not work
the same as QTime(0, 0) at all.

Change-Id: Icf1a10052a049e68fd0f665958f36dbe75ac46d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-01 14:39:34 +00:00
Dmitry Kazakov
e453222414 Fix tablet jitter on X11
We should get the correct stylus position from the valuators,
not from the X11-provided global position. Global position is rounded
to the nearest FP16 values, which is not enough for smooth painting.

[ChangeLog][Platform Specific Changes][X11 / XCB] QTabletEvent
coordinates now come from AbsX/AbsY valuators in the X11 event, in
more precise 32.32 fixed-point format, scaled to fit the virtual
desktop.  It's possible to revert to using the legacy 16.16-format
event_x/event_y coordinates as in previous releases by setting the
QT_XCB_TABLET_LEGACY_COORDINATES environment variable.

Task-number: QTBUG-45375
Fixes: QTBUG-48151
Change-Id: Ie701446b3586296bcb8fb09158f387ba6a7cbf07
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-04-01 14:36:47 +00:00
Timur Pocheptsov
409e3eab09 QMacStyle - fix PE_InticatorTabClose handling
for the case a custom style sheet is in use and QStyleSheetStyle
replaces the widget (close button) with its parent (QTabBar).
We still need this button though to compare against tabButton
on a hovered tab. This allows us to have, indeed, native-looking
tabs as documented (aka similar to Safari or the "Terminal" application).

Change-Id: I53ff78699e705db6d7c7b84774b8e188a1277535
Fixes: QTBUG-61092
Fixes: QTBUG-74689
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-04-01 14:11:25 +00:00
Liang Qi
ad313595e0 Revert "Revert "Remove deprecated screen maintenance functions in QPlatformIntegration""
This reverts commit 300940a6c9.

The fixes for leaf modules landed already.

Task-number: QTBUG-74816
Change-Id: I1c7f0705c20d030419ceedca485106af73946b3c
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2019-04-01 13:48:48 +00:00
Andy Shaw
6ccbe7ffdf macOS: When a menu item has an italic font it should respect this
Change-Id: Id8d2c5c0d0407ead66700d38634f342f489a2842
Fixes: QTBUG-69489
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-04-01 13:10:55 +00:00
Andy Shaw
a49c564891 Implement support for WA_MacNoClickThrough
This is done by adding a QWindowPrivate::allowsClickThrough() function,
so this could easily be adapted later on if desired for other
platforms.

Fixes: QTBUG-41126
Change-Id: I1157e5e7e7667ff11d1a5d21b3ce8c4b13202272
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-04-01 12:22:54 +00:00
Eirik Aavitsland
3b7db8ac90 Fix assert/crash when creating QBrush with null QGradient
The QBrush constructor taking a QGradient would assert or crash if
passed a null (NoGradient) gradient. But it is not necessary for the
API to be as brittle as that: instead the result can simply be a null
QBrush object, i.e. the same as the default QBrush() constructor
creates (style == NoBrush).

This issue comes up now since with the recent introduction of
QGradient presets, the API opens for using QGradient directly, whereas
earlier, only the subclasses QLinearGradient etc. were to be used.

Fixes: QTBUG-74648
Change-Id: I1a9b1c4654e4375aa6684700a262cc0946851448
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-04-01 11:56:42 +00:00
Morten Johan Sørvig
69beb5f5a0 wasm: add resizeCanvasElement() API to qtloader.js
HTMl does not have per-element resize events, which
means Qt has not way of knowing that a canvas has been
resized and that the canvas buffer size should be updated.

Depending on the use case, the hosting JavaScript code
that caused the canvas resize could also inform Qt
that the canvas has been resized. Add API to do this,
which calls the existing canvas/screen resize implementation.

Other solutions taken/not taken:

- browser window resize events: these are available,
and we install an event handler in qwasmeventtranslator.cpp.

- DOM mutation events: would detect changes to the
the size attributes themselves, but not if the size
indirectly changed, e.g. “width: 100%” depends on the
parent width. Not implemented.

Change-Id: Ib324bb30f523e9fceea68000b95bf857a1d36b6c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-04-01 07:18:05 +00:00
Morten Johan Sørvig
73db765aaf wasm: support adding and removing canvases at runtime
Add qtloader API:
  addCanvasElement()
  removeCanvasElement()

These functions call the corresponding add/remove screen
functions on QWasmIntegration.

Task-number: QTBUG-64079
Change-Id: I537c11f3b5fb9240cca9b6313dd45f803d865ac6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-04-01 07:17:58 +00:00
Kari Oikarinen
18e4cf2900 Merge 5.12 into 5.12.3
Change-Id: I76905e3540585c3be221b89453c725828b05940b
2019-04-01 09:16:33 +03:00
Liang Qi
e104c19728 Merge "Merge remote-tracking branch 'origin/5.13' into dev" into refs/staging/dev 2019-03-31 18:45:03 +00:00
Joerg Bornemann
9e97d64ccd Fix installation of .pdb files for applications that have VERSION set
For applications that set VERSION the installation targets of pdb
files were wrong in qmake's nmake Makefile generator.

Replace code that tries to reconstruct that target's versioned
extension with TARGET_EXT which already contains the fully resolved
target extension.

Fixes: QTBUG-74265
Change-Id: I9553a5f70170e077a59c866079ae51647ae80bef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-03-31 12:45:24 +00:00
Joerg Bornemann
3cdf46059a Let "qmake -install qinstall" set default permissions 0644 and 0755
...like the install commands before Qt 5.9 did.
This ensures consistent permissions. Also, we can throw away the code
that took care of removing and re-adding the read-only flag on Windows.

Change-Id: I06bc3af8817f18c016119fbcb7360800d6c129bd
Fixes: QTBUG-74733
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-31 12:44:41 +00:00
Christian Ehrlicher
c19d556863 QVariant: deprecate qVariantFromValue/qVariantSetValue()
qVariantFromValue/qVariantSetValue() was marked as obsolete since Qt4.
Therefore mark them as deprecated with Qt5.14.
Since QVariant::setValue/fromValue() were using the now deprecated
functions move the implementation to them and let
qVariantFromValue/qVariantSetValue() call
QVariant::setValue/fromValue().

Fixes: QTBUG-74043
Change-Id: I46617cc4d5c1e8c162d0f1f7ae32e4cfe9ce915c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-03-31 12:25:46 +00:00
Christian Ehrlicher
ed49a84e6c QListWidget: don't hide setBackgroundColor with QT_DISABLE_DEPRECATED_SINCE
QListWidget::setBackgroundColor() is a virtual function. Hiding this
function when compiling/linking against QtWidgets when
QT_DISABLE_DEPRECATED_SINCE is set will therefore screw up the vtable
and it will crash on runtime.
Therefore don't surround them with QT_DEPRECATED_SINCE macro.

Fixes: QTBUG-74665
Change-Id: Icb0f253117a1e55a338d2d6969ec2d59fbd0679d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2019-03-31 12:25:32 +00:00
Liang Qi
29f01b32f5 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/configure.json

Change-Id: I93ac67f3bf4844bc7c691183e94bceb922b7b919
2019-03-31 12:39:42 +02:00
Laszlo Agocs
28a264cfe2 Fix alpha blending regression with WA_StacksOnTop QOpenGLWidgets
0bc4288689 in Qt 5.6 introduced support for premultiplied alpha in the
raster-rendered QWidget content. Unfortunately this introduced a
regression for OpenGL content from QOpenGLWidgets with WA_StacksOnTop
set: these used standard alpha blending in 5.5 and earlier, and
switching them to premultiplied (in case the - unrelated - raster
content has a _Premultiplied QImage format) breaks all content that
was done with non-premultiplied alpha in mind, for example the qopenglwidget
example's "Transparent background" checkbox.

Restore the pre-5.6 behavior.

Fixes: QTBUG-74285
Change-Id: I76fcadd53cd436efa2b619b8d6739270995d044f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-03-30 19:22:17 +00:00
Yuhang Zhao
387f120bf9 Fix cross compile on Ubuntu
When cross compiling on Ubuntu with LTO enabled, the linker will complain about the "-fno-fat-objects" parameter even if the "-fuse-linker-plugin" is passed it.
But if the "-fno-fat-objects" parameter is removed, the linker will complain about "don't support linker plugin in this mode".
Remove both parameters can fix this.

Change-Id: I2d792ca70737f2e82a360bfc597f2b110513b954
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-03-30 07:34:30 +00:00
Qt Forward Merge Bot
0a7302abbc Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I9935bacae0d6ba532418fc3d28adbc7ca1463604
2019-03-30 01:00:07 +01:00
Liang Qi
300940a6c9 Revert "Remove deprecated screen maintenance functions in QPlatformIntegration"
This reverts commit 7a64ffb773.

This change landed in 5.13 too early, so there is no baseline with both APIs in
dev. This will be reverted later when the fixes for leaf modules landed.

Task-number: QTBUG-74816
Change-Id: Ie5ee41fbf6be53b8fcb4289ac1ec3974e5bf6e42
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2019-03-29 20:55:24 +00:00
Tony Sarajärvi
8d154810f5 Extend blacklistnig of tst_qwidgets to cover RHEL 7.6
Task-number: QTBUG-46116
Change-Id: I7d74dca7030a9c21b3654e3b5cde94015497208e
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2019-03-29 19:26:25 +00:00
Tobias Hunger
c4bdddf917 CMake: Re-generate printsupport
Change-Id: I8c859dad17dbb18694f52c4c87bf20d55f490099
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:39:32 +00:00
Tobias Hunger
2d1bc2dd6f CMake: Re-generate plugins/platforms/offscreen
Change-Id: Ie26bed794881835278f3874e318d00affad8aa05
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:37:14 +00:00
Tobias Hunger
dde95a3bdb CMake: Re-generate plugins/platforms/minimal
Change-Id: I1f5f3e9f2e3ba4505ff3c9572223ca9d2b043a0e
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:37:01 +00:00
Tobias Hunger
dba2cc84ae CMake: Re-generate plugins/bearer/networkmanager
Change-Id: I70ef85e4c758d76c23012da981c6f583c179dd02
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:36:51 +00:00
Tobias Hunger
107dc7568e CMake: Re-generate plugins/bearer/connman
Change-Id: I68f81b269573e2beaa7fce33adee9c090fae318a
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:36:42 +00:00
Tobias Hunger
9e37f8844b CMake: Re-generate plugins/bearer/generic
Change-Id: I1962b813ab64ac7d577d8645239e9bd0f1140947
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:36:31 +00:00
Tobias Hunger
dfe734567c CMake: Re-generate plugins/sqldrivers/odbc
Change-Id: I95184ab2202f2fd1d87a7182303549557a6cdd87
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:36:18 +00:00
Tobias Hunger
a660bf9aa3 CMake: Re-generate plugins/sqldrivers/psql
Change-Id: If02ae8f616600d49cbbcd2aee298395d03b68a8f
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:36:05 +00:00
Tobias Hunger
4a9ea61705 CMake: Re-generate platformsupport/graphics
Change-Id: Ib144f7ab7d73e408fb73e1c52e92d03377c890c5
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:33:22 +00:00
Tobias Hunger
ff15f36812 CMake: Re-generate platformsupport/glxconvenience
Change-Id: I1a8c376df4a29ca6d38f60b20a961a8706f246ba
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:33:10 +00:00
Tobias Hunger
4cf7ec0665 CMake: Re-generate platformsupport/platformcompositor
Change-Id: I4efe3cc2920c0efe83f8e2b7028020558a78c778
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:33:00 +00:00
Tobias Hunger
b7d3bb8c3a CMake: Re-generate platformsupport/eglconvenience
Change-Id: I0e159dad3efc812be7fad7637901822f9a29fb88
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-29 14:32:50 +00:00