Commit Graph

39317 Commits

Author SHA1 Message Date
Samuel Gaist
946d868619 QEasyingCurve: fix data stream operators
Until now, QEasingCurve was not streaming all it's internal state.
Therefore, doing store/reload operation through QDataStream would not
yield the same curve as the original. This patch fixes it.

[ChangeLog][QtCore][QEasingCurve] QEasingCurve now properly streams all
the data needed to QDataStream.

Change-Id: I1619501f5b4237983c8c68e148745a5e58863f55
Fixes: QTBUG-68181
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-04-06 21:12:40 +00:00
Allan Sandfeld Jensen
5c90a96998 Remove handling of missing Q_COMPILER_CLASS_ENUM
Change-Id: I1fd6d601e49e803b4c3308fb0ca41136c628afbc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-06 16:19:14 +00:00
Allan Sandfeld Jensen
4628e5cded Remove handling of missing very old compiler feature check
Removes handling of missing Q_COMPILER_NULLPTR, Q_COMPILER_AUTODECL,
Q_COMPILER_LAMBDA, Q_COMPILER_VARIADIC_MACROS and
Q_COMPILER_AUTO_FUNCTION.

We haven't supported any compilers without these for a long time.

Change-Id: I3df88206516a25763e2c28b083733780f35a8764
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-06 13:27:15 +00:00
Allan Sandfeld Jensen
1ef274fb94 Replace qMove with std::move
Change-Id: I67df3ae6b5db0a158f86e75b99f422bd13853bc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-06 11:00:38 +00:00
Qt Forward Merge Bot
980755bbcf Merge "Merge remote-tracking branch 'origin/5.13' into dev" into refs/staging/dev 2019-04-06 01:16:27 +00:00
Qt Forward Merge Bot
3460e6e941 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ib7c4fc52915b5e6c72b9aa262fb59f2a041dccd7
2019-04-06 01:00:46 +02:00
Allan Sandfeld Jensen
dbf7706413 Replace Q_DECL_NOEXCEPT with noexcept in QtGui
Change-Id: I43803b88fea8083782d73ce157c466b022208740
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-05 22:26:49 +00:00
Paolo Dastoli
6b66108c1f Add serializer/deserializer for Enumeration
Enum class are serialized using the declared size.

[ChangeLog][QtCore][QDataStream] Enumerations can now
be serialized through QDataStream without the need of
manually defining streaming operators.

Change-Id: Iae9a63eb62b5a5615b657766a3c4c66ba4d98d0e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Paolo Dastoli <paolo.dastoli@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-05 14:54:25 +00:00
Qt Forward Merge Bot
0998a9d1d5 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I010a6322d12e038fdce247a58dfb05e204c2ff3b
2019-04-05 10:57:24 +02:00
Friedemann Kleint
7ac2263f30 Windows code: Replace deprecated QVariant API
Task-number: QTBUG-74043
Change-Id: I6f5f47b74830597eec74e2582e24d2d7dd235a80
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-04-05 08:30:51 +00:00
Friedemann Kleint
5a5a96560e uic: Adapt connection syntax to Python
Extend WriteInitialization::findDeclaration() to return the class name
(on this occasion preparing for generating Qt 5 connection syntax) and
add a helper function for formatting the connection.

Task-number: PYSIDE-797
Change-Id: I7507f604c8275c93d347b7a6a5d5b5a2a5f3ffd5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-04-05 08:29:26 +00:00
Friedemann Kleint
5b8676578d uic: Add qualification with "self." for Python
Prepend "self." (this) to the name stored in the class Driver's hashes
as specifying it is mandatory in Python.

Task-number: PYSIDE-797
Change-Id: I1da110b84b2d1131ee6af915f9cc4ba21d7de710
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-04-05 08:29:19 +00:00
Friedemann Kleint
bc8633036c uic: Add python
- Add command line option
- Add import (include) handling
- Add language helpers like streamable classes for Function definition,
  object instantiation
- Implement header comment formatting

Task-number: PYSIDE-797
Change-Id: I15041ab16504ea159f6665781a829cd548585af1
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-04-05 08:29:11 +00:00
Friedemann Kleint
89120c4a76 uic: Refactor string constant formatting
Refactor the fixString() helper, moving the code into a streamable
class using a helper which can be used for different encodings.

Task-number: PYSIDE-797
Change-Id: I0f82945b6b334da8524882dda2f104327eba79d4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-04-05 08:28:56 +00:00
Orgad Shaneh
808758ad14 QFileSystemEngine: Fix typo
Change-Id: I538ef771dcf6b757025c8d31f13a91222c2ebd3e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-05 03:12:04 +00:00
Qt Forward Merge Bot
ed485243b5 Merge "Merge remote-tracking branch 'origin/5.13' into dev" into refs/staging/dev 2019-04-04 23:01:17 +00:00
Qt Forward Merge Bot
eb606d85b3 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: If4974bbf0a166de244dd57cb71b05fa28bcc34ce
2019-04-05 01:00:49 +02:00
Allan Sandfeld Jensen
8d7c97d428 Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usage
Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-04 18:01:38 +00:00
Allan Sandfeld Jensen
b6cf8cb794 Clang_cl: Use -O3 for full optimization
Pass it through as a traditional clang argument instead of relying on
what MSVC cl.exe can take.

Change-Id: I94405ce6ab80d16b687e62c9aa4b2866ba84f0e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-04 16:59:29 +00:00
Allan Sandfeld Jensen
7d02fb3045 Fix recursive include
qatomic.h included qbasicatomic.h which included qatomic.h.

Due to a define in qbasicatomic.h, the definitions from QAtomic would
change depending on which was included first. Fortunately qbasicatomic
does not need qatomic.h so the include can be removed.

Change-Id: I086009f2e16a6e20b2b76fc6b3bf66a343414206
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-04 16:59:05 +00:00
Eskil Abrahamsen Blomfeldt
d1bab5b1e3 Allow word break wrapping in Korean text
In Korean text, they typically can use both the "Western" style of
word wrapping, i.e. breaking on spaces, as well as the East-Asian
style of potentially breaking between all syllables. However,
the Unicode Line Breaking Algorithm, TR14 defaults to breaks on
syllables and specifies a possible tailoring where Hangul is
mapped to the AL class instead:

"When Korean uses SPACE for line breaking, the classes in rule
LB26, as well as characters of class ID, are often tailored to AL"

When using Qt, the user would expect the WordWrap wrap mode to
break between words in Korean. If you want the syllable-based
text layout, you would use WrapAnywhere, probably accompanied
by line justification.

To avoid breaking QTextBoundaryFinder and other potential clients
of QUnicodeTools which depend on getting the precise Unicode
data from the algorithm, we do this by passing a flag from
QTextEngine when initializing the attributes. This way, it
can also be made optional later on, if we decide there is
a reason to add an additional wrap mode specifically to
handle cases like this.

[ChangeLog][Important Behavioral Change] WrapWord now
correctly prefers line breaks between words in Korean text.
WrapAnywhere can still be used to get breaks between syllables
instead.

Done-with: Alexey Turitsyn <alexey.turitsyn@lge.com>
Task-number: QTBUG-47644
Change-Id: I37b45cea2995db7fc2b61e3a0cc681bbdc334678
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-04-04 10:25:10 +00:00
Simon Hausmann
a334156e81 Add QMetaProperty::relativePropertyIndex()
Add a "sibling" function for QMetaProperty::propertyIndex() for the
relative index. That way in QtQml we can avoid using

    propertyIndex() - metaObject.propertyOffset()

where the latter traverses the parent chain.

Change-Id: I113a956801b0e8d56a30a847b5b919da703824e2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-04 14:39:31 +00:00
David Faure
90c86d738e QCommandLineParser: warn if defining a duplicate option
Fixes: QTBUG-74907
Change-Id: I3741a5241515dfaf4353458a9ef13ceaeb9fea0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-04 13:33:50 +00:00
Eskil Abrahamsen Blomfeldt
bcd2fa484a Fix font matching of typographic families on Windows
9204b8c31e broke font matching on Windows.
After this change, if you request a specific face of a family, such
as "Arial Black", and Qt detects that its typographic/preferred name
is "Arial", then it will be added as the single style of the Arial family,
which will in turn be set as populated=true.

So if you later request a regular font of "Arial" family, then it will
see that the family has already been populated, skip this step, and
then see that there is only one style available, i.e. "Arial Black".

To work around this, we need to make sure the typographic family is
properly populated the first time it is registered.

[ChangeLog][Windows][Fonts] Fixed a bug where it would be impossible
to request different faces of a font family after a specific type face
has been in use.

Task-number: QTBUG-74748
Change-Id: Ia0caace2b88a32e6114ff23ad10ee1ea8f5a3e03
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-04-04 10:24:57 +00:00
Joerg Bornemann
4eb865cd38 Remove superfluous inclusion of qtwidgets-config.pri
Every module already includes its own config.

Change-Id: I1ef630092f61f118d79dc9b39ce38f4bdea14f43
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-04-04 09:48:08 +00:00
Morten Johan Sørvig
e227c33455 wasm: improve event coordinate handling
targetX and targetY are canvas-local coordinates,
while Qt generally works with window-local and global
coordinates.

Add coordinate mapping calls where needed and make
sure we pass correct coordinate types to Qt.

This starts mattering when we have canvases which
are not located at (0, 0).

Change-Id: I28563310ca17d0cc5535317cff99fcd82d3723db
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-04-04 09:30:02 +00:00
Morten Johan Sørvig
7bae1bd5cb wasm: hide canvas text caret
Another side effect of setting contenteditable on the
canvas. Seen on Firefox.

Change-Id: I789ba4d7e6fbbdbf14b66fe1ae57183ec04e04bb
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-04-04 09:29:50 +00:00
Andy Shaw
5caaa0b6a2 Doc: Update QImage::depth to indicate we support 64 bpp now
Change-Id: Icbd4920ed03655cec483a402de9d0ae3378ff3ef
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-04-04 08:31:47 +00:00
Allan Sandfeld Jensen
7518da2441 Update scanline documentation
Change-Id: I019b102e99f99377b528ad5c8a4ccb2a7929f14f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-04 08:31:33 +00:00
Friedemann Kleint
ab47587856 Windows QPA/File dialog: Avoid UI hangs caused by empty results
Typing in invalid URLs results in empty result lists.
Emit rejected() in this case.

Task-number: QTBUG-71785
Change-Id: Ia257b85a5c4370227f753752f6a473bbb3a054be
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-04 08:28:07 +00:00
Joerg Bornemann
30e2bf8712 Remove unused *-mwerks scope
The Metroworks mkspec was removed in 2003.

Change-Id: I4bc56a20f3bda00bb76a2c3b73f277d238603d02
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-04-04 08:01:29 +00:00
Qt Forward Merge Bot
f80b7995f3 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ia7328524f2cd9d5995ac8705f0fe0bf570b2e831
2019-04-04 01:00:07 +02:00
Joerg Bornemann
6fff899697 Document in which Qt version a qmake function was introduced
...starting with Qt 5.0.0.

The text is manually inserted there, because \since does not work
within sections.

Task-number: QTBUG-74737
Change-Id: I0fe2d0a113d48be0266030c8466b062c6f743aab
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-04-03 20:23:29 +00:00
Morten Johan Sørvig
c4d46723eb wasm: disable XDG_RUNTIME_DIR warning
XDG is not very relevant on the Web platform.

Change-Id: Ibd885e28da15114d0601c73e34dec556e65cbe75
Reviewed-by: David Faure <david.faure@kdab.com>
2019-04-03 18:41:49 +00:00
Friedemann Kleint
06d753e87b Brush up and stabilize tst_QSizeGrip
- Remove unused dummyWidget and thus empty slots initTestCase(),
  cleanupTestCase().
- Add slot cleanup() checking for an empty top level widgets list
  and introduce QScopedPointer to ensure it passes.
- Use QTRY_VERIFY in hideAndShowOnWindowStateChange().

Flakyness has been observed on openSUSE:

 FAIL!  : tst_QSizeGrip::hideAndShowOnWindowStateChange(Qt::Window) '!sizeGrip->isVisible()' returned FALSE. ()
           Loc: [tst_qsizegrip.cpp(126)]

Change-Id: I340fc1892dc00bcff1985e5a8a1e535975736484
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-04-03 15:06:06 +00:00
Miguel Costa
7ab84cfe74 factorial example: Fix issue with WinRT console output
Replaced the display of the calculation output, generated using
fprintf(stdout, ...), with qInfo() << ... In WinRT, fprintf to stdout
does not cause output to be generated.

Task-number: QTBUG-67566
Change-Id: I3b95bbf888e863683cbaf54deb26c3821433a5b8
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2019-04-03 13:59:47 +00:00
Allan Sandfeld Jensen
a1e62e7ba1 Replace Q_DECL_NOEXCEPT with noexcept in corelib
In preparation of Qt6 move away from pre-C++11 macros.

Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-03 13:49:45 +00:00
Tor Arne Vestbø
accf7ce024 macOS: Disable explicit layerContentsPlacement
It was needed to allow lazy resize of the backingstore IOSurfaces, but
that feature hasn't been enabled yet, and explicitly setting the layer's
contents placement to NSViewLayerContentsPlacementTopLeft resulted in
the layer animating when the window was moved from screens of different
scale factors.

We need to investigate this further, but in the meantime fix the
visual regression by disabling the explicit layer contents placement.

Change-Id: I63ea1eab9cf3fa6480e88844918ed98e6aa72620
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-04-03 08:01:28 +00:00
Allan Sandfeld Jensen
6c761a0db1 Replace Q_NULLPTR with nullptr in corelib
Change-Id: I9cdb5b7015c62c50b35f8a6519ea4e777db97683
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-03 07:08:03 +00:00
Allan Sandfeld Jensen
53abc0f664 Remove special NOTHROW handling
We no longer have any MSVC support that wouldn't set Q_DECL_NOEXCEPT

Change-Id: I3e2c74cb89b9c56ffaf17001004c87b88622da82
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-03 07:07:19 +00:00
Qt Forward Merge Bot
682513bed4 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I99a27f9a0402e1ccad45a2d062d784f8d9a08dd3
2019-04-03 01:00:11 +02:00
Friedemann Kleint
163a0475eb Windows: Fix QFileSystemEngine::id() for FAT32 drives
GetFileInformationByHandleEx() which is used to to obtain the ID, has been
found to fail on FAT32 (USB removable drives). Fall back to
GetFileInformationByHandle() for these.

Fixes: QTBUG-74759
Change-Id: Ib3ef60a6bf9e9edaf41af86bf71666001cb0aa58
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-02 16:21:39 +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