Commit Graph

41751 Commits

Author SHA1 Message Date
Samuel Gaist
c8aadc79fc QSet: Document to/from QVector transformation techniques
Change-Id: I2a2ff6332bd6e8ed3d4ba7b4765da0a94a06f133
Fixes: QTBUG-71067
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-10-24 23:10:21 +02:00
Shawn Rutledge
cffb88928c Update 3rdparty/md4c to post-0.3.4
0.3.4 is the newest tagged release. This updates to upstream
0354e1ab5a453e9913dcd5f87c2cfe9a2510dfda which has a change that
affects behavior of the ".\n" case in QTBUG-78870 (it will be
seen as a paragraph rather than a list item).

Task-number: QTBUG-78870
Change-Id: Ib01f9c1d3f71a39782608da071c2f42512845382
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-24 20:19:15 +00:00
Shawn Rutledge
d377d1f3a9 Enforce QTextDocument::MarkdownFeature compatibility at compile time
We use md4c for parsing markdown.  It provides flags to control the
feature set that will be supported when parsing particular documents.
QTextMarkdownImporter::Feature is a fine-grained set of flags that
exactly match the md4c feature flags that we support in Qt so far.
QTextMarkdownImporter is a private exported class (new in 5.14).
We don't expect the corresponding flags in md4c to change in
incompatible ways in the future: the md4c authors have as much respect
for avoiding compatibility issues as we do, and likely will only add
features, not remove them.

We now enforce QTextMarkdownImporter::Features compatibility with
QTextDocument::MarkdownFeatures by setting them directly.  We check
QTextMarkdownImporter::Features compatibility with md4c's #define'd
feature flags using static asserts, so that any hypothetical
incompatibility would be detected at compile time.
The enum conversion from QTextDocument::MarkdownFeatures to
QTextMarkdownImporter::Features is moved to a new QTextMarkdownImporter
constructor; thus the conversions from QTextDocument::MarkdownFeatures
to QTextMarkdownImporter::Features, and then to unsigned (in
QTextMarkdownImporter::import()) are adjacent in the same private class
implementation.  If incompatibility ever occurred, we would need to
replace one or both of those with another suitable conversion function.

Change-Id: I0bf8a21eb7559df1d38406b948ef657f9060c67b
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2019-10-24 20:58:44 +02:00
Christian Ehrlicher
9ae0fa4d49 cleanup QSortFilterProxyModel tests
Cleanup QSortFilterProxyModel tests:
 - adjust includes
 - use nullptr
 - use override
 - avoid unneeded casts
 - use new signal/slot syntax

Change-Id: I05f7c18cd2642bc8251bf1560803e7635684d24d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-24 19:41:16 +02:00
Christian Ehrlicher
31cbda4833 QItemSelectionModel: make parent an optional parameter
Make parent an optional parameter to be consistent with the rest of the
API.

Change-Id: I5942fee69ca33bd87d4d14b6919d2b8d5b60c0b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2019-10-24 19:41:15 +02:00
Christian Ehrlicher
5edf34848a QTableView: properly deselect row when column 0 is hidden/not visible
When the first column is hidden or not visible in the current viewport,
it is not possible to deselect the current row.
Fix it by passing the correct column to
QItemSelectionModel::selectedRows() when testing if the current index is
selected.

Fixes: QTBUG-79092
Change-Id: I9d8082d2b29ad2f799156aee910c6ff6e3217771
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-24 19:41:14 +02:00
Vitaly Fanaskov
5d5a0842dc QApplicationPrivate: Fix potential null pointer dereference
The situation when qGuiApp is null is possible, for example, during
static palette setup. This is also a bon ton to check pointers before
dereferencing them.

Task-number: QTBUG-71186
Change-Id: I8021cef073eedaa0e4c2eb621890e73e8126175c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2019-10-24 15:02:56 +02:00
Simon Hausmann
7a605edc22 Fix static linking when bearer management plugins are built, part 2
After commit 5f160a3699 moved the code
that's shared across all bearer management plugins into QtNetwork, there
is one piece of code remaining that's shared across the connman and the
networkmanager bearer plugin: The dbus ofono interface code. To avoid
linking that twice (and causing duplicate symbol errors), this patch
moves it into a static platform support library. This way for shared
builds the code is included twice, but for static builds only once.

Change-Id: Idf5414bc22fea45f11c600f28eaea91bb4dc6308
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-24 13:00:07 +00:00
Alexander Volkov
fcbf15c97b QKeySequence: Add missing names for multimedia keys
Task-number: QTBUG-40030
Change-Id: Ib34bcbf42d6dd1206209c2d76444fd8c777278fe
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-24 15:58:00 +03:00
Ulf Hermann
9ab043b688 QFileSystemEngine: Consistently check for invalid file names
stat() and friends expect a null-terminated C string. There is no way to
generate anything useful from a string that has null bytes in the
middle. It's important to catch this early, as otherwise, for example, a
QDir::exists() on such a path can return true, as the path is silently
truncated.

Extend the checks for empty file names to windows and add checks for null
bytes.

Change-Id: Ie9794c3a7c4fd57f9a66bdbbab8b45a08b6f9170
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-24 13:37:22 +02:00
Tor Arne Vestbø
f2edc6cb3a macOS: Don't set NSOpenGLPFANoRecovery for layer-backed views
The Apple software renderer is perfectly capable of being used when
compositing CA layers.

Change-Id: I3b78ff61a79869ecdb7bd431388041f2c124472e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-24 13:07:10 +02:00
Ville Voutilainen
9367d966e6 Fix a -Wclass-memaccess problem in qjson
qtbase/src/corelib/serialization/qjson_p.h:230:38: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of type ‘QJsonPrivate::qle_ushort’ {aka ‘class QSpecialInteger<QLittleEndianStorageType<short unsigned int> >’} with ‘private’ member ‘QSpecialInteger<QLittleEndianStorageType<short unsigned int> >::val’ from an array of ‘const class QChar’; use assignment or copy-initialization instead [-Werror=class-memaccess]
  230 |           str.length()*sizeof(ushort));
      |                                      ^

Change-Id: Ie58e7fe4bae3003227364012ad56ab23bd560d8c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-24 13:58:50 +03:00
Tor Arne Vestbø
312793f28e macOS: Respect Qt::AA_UseSoftwareOpenGL
Change-Id: Ia83e8e9e571e4f46d2a8d810c376015552755457
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-24 12:33:51 +02:00
Tor Arne Vestbø
f39230fcac macOS: Skip NSOpenGLContext flush if window exposed size is out of sync
Some clients such as QOpenGLWidget will end up drawing and flushing
during the resize event, which for GL will result in an immediate update
on the screen. The problem is that the underlying Core Animation layer,
and the window's frame, has not been visually updated yet to the new
size, so we end up drawing "ahead" of what the window server is showing
the user.

Ideally we'd be able to present the GL drawing in a transaction, in sync
with the drawing of the window frame, but this API is only available for
CAMetalLayer and CAEAGLLayer.

As a workaround we detect when the exposed size is out of sync with the
window geometry, and skip the flush until the exposed size has caught
up. We know this will happen eventually as AppKit will always ask us
to display after a resize.

Change-Id: I1739ac8878b3fc6820a55dd017ddd170fd5f55d6
Fixes: QTBUG-79139
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-24 12:33:40 +02:00
Tor Arne Vestbø
7c9ffe3e46 rhi: Use Q_GLOBAL_STATIC for QRhiGles2 GL program cache
Defers initialization until actually needed.

Change-Id: Idb09dbad0dfa602949d381ee61565d9050e77e7c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-24 12:18:30 +02:00
Tor Arne Vestbø
444e947aad macOS: Improve handling of wantsBestResolutionOpenGLSurface
We were disabling wantsBestResolutionOpenGLSurface whenever we detected
the Apple software renderer, but this isn't needed when layer-backed,
and did in fact result in the exact same visual result as the bug the
code was working around -- only rendering to a quarter of the viewport.

We now apply the workaround only when software rendering is combined
with surface-backed views.

The logic has also been improved to not rely on string comparison to
look for the software renderer, but instead uses the renderer ID that
the context provides.

Since tweaking the wantsBestResolutionOpenGLSurface is only relevant
when using a window for GL rendering the logic has been moved into
QCocoaGLContext.

Change-Id: I021aaefbb7a9782bc8ee3c9703da246510326d50
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-24 12:14:33 +02:00
BogDan Vatra
86a0f1cfd7 Add build-id flag
This flag is needed by LLDB & simple perf tools to locate the right binary.

Change-Id: Iffa1b0678663cfb9d1d699da5ad6fe672863918c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-24 12:30:53 +03:00
Oliver Wolff
c686e885c0 qmake: Disallow building Qt examples inside the source tree
Building examples inside a Qt source tree is considered unsupported.
Instead of checking, whether the build is done "in source" inside the
source directory, we also have to check for "shadowed example builds" as
they are done by Creator. An example would be:
qtbase/examples/widgets/widgets/build-wiggly as a shadow build for
qtbase/examples/widgets/widgets/wiggly.

Fixes: QTBUG-76237
Change-Id: Iceb88af006fad249a4c13fa0b0345cf3f7086252
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-10-24 10:41:29 +02:00
Robert Loehning
c46eec096f QStateMachine: Don't scream at the user
Change-Id: I171606d10985bc7338b0f24ceb142fc0d88e7932
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-10-24 10:26:03 +02:00
Qt Forward Merge Bot
4158de330d Merge "Merge remote-tracking branch 'origin/5.13' into 5.14" 2019-10-24 10:25:37 +02:00
Qt Forward Merge Bot
b327807c5e Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/io/qstandardpaths_unix.cpp
	src/corelib/tools/qsharedpointer_impl.h
	tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
2019-10-24 10:23:44 +02:00
Friedemann Kleint
31a971f727 QColorDialog: Fix memory leak when picking screen colors
Pass the dialog as parent to the event filter class
in QColorDialogPrivate::_q_pickScreenColor().

Fixes: QTBUG-53469
Change-Id: I9110c19a8f49a545a0fbf7cfdb3ded70fea4dcce
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-10-24 10:20:05 +02:00
Laszlo Agocs
4106275a7f rhi: metal: Fix and clean up committing resource bindings
Make it readable by using names instead of mere indices for the stages.

There is an important fix in there as well: when in a render pass, only
resource for VERTEX and FRAGMENT are taken into account, while in a compute
pass those are skipped. This ensures that we do not send messages to a nil or
invalid MTLRender/ComputeCommandEncoder. (nil would not be an error but the
other is fatal)

Task-number: QTBUG-79447
Change-Id: Ibef108cb7c82b5b0fdd2a299cd89fbebe8c3606a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-24 10:03:20 +02:00
Laszlo Agocs
cc631c15a0 rhi: metal: Remap resource bindings based on the QShader table
...when available. Fall back to the QRhi (i.e. SPIR-V) binding
point otherwise (which becomes unsafe once shadertools bumps
its SPIRV-Cross snapshot, but is fine for existing .qsb files)

Task-number: QTBUG-79368
Change-Id: I2d452fdd4efb484867732c358171a800d3261dcd
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-10-24 10:03:20 +02:00
Laszlo Agocs
6326d1df39 Store a native resource binding map in QShader
The deserializer remains compatible with .qsb files without this
additional section.

Task-number: QTBUG-79368
Change-Id: I03e2a634febbd88da7f6a4369f104855ea31e3af
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-10-24 10:03:20 +02:00
Ulf Hermann
4514b67d7c moc: When generating metatypes, allow empty MOC_DIR
We don't want the metatypes to be generated into the file system root in
that case.

Change-Id: I91bab20fa498de0f2918d8ee5b2f230cc0610aae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-24 09:27:00 +02:00
Eirik Aavitsland
03717be788 Fix: confusion in QImage paintEngine creation on shared images
During the creation of a raster paint engine in QImage::paintEngine(),
the QImage will be detached. At least old gcc versions would get
confused so that the newly created paintengine would end up in the old
QImage copy insteads of the newly detached one. Work around by
dropping the temporary engine pointer.

Fixes: QTBUG-79383
Change-Id: I27b1f24312269bc2bcc641dc4334397a92e3bfbb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-24 08:56:21 +02:00
Qt Forward Merge Bot
563dc21c51 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ic062a5bd62621877b17cc0d47303b3c879241385
2019-10-22 01:00:49 +02:00
Volker Hilsheimer
6e3b5801d2 QDateTimeParser: always use locale for AM/PM texts
The default implementation used the locale, the reimplementation
supported translating the texts. This mixing of l10n and i18n concepts
resulted in bugs and inconsistencies.

Using the texts for AM/PM from the locale that is set on the date/time
control is sufficient.

[ChangeLog][QtWidgets][QDateTimeParser] AM/PM strings in QDateTimeEdit
and other classes using QDateTimeParser are provided by the locale, and
are no longer translatable.

Change-Id: I83a5dab470ae5ba35b3ce4040ad1877908f462c7
Fixes: QTBUG-75866
Task-number: QTBUG-72833
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-21 22:39:33 +02:00
Ulf Hermann
35adb74ddd Reimplement JSON support on top of Cbor
In turn, deprecate the QJsonDocument methods that deal with JSON binary
data. You should use CBOR for data serialization these days.

[ChangeLog][Deprecation Notice] The binary JSON representation is
deprecated. The CBOR format should be used instead.

Fixes: QTBUG-47629
Change-Id: Ic8b92ea36de87815b12307a9d8b1095f07166db8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-21 19:12:51 +02:00
Hernan Martinez
b61c6164c1 QtGui: Disable Windows on ARM64 preprocessor conflict in QtOpenGL
The Windows API MemoryBarrier function is actually a macro when
_M_ARM64 is defined and it conflicts with the MemoryBarrier method when
it's declared and used.

Task-number: QTBUG-77388
Change-Id: I762edfc4ca1a44cbe095724de708c7cdad34ae65
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-10-21 09:14:18 -04:00
Mårten Nordheim
559b563d71 Use Schannel's incomplete data guesstimation feature
It tells us how many bytes we will need before the call succeeds. It's
not accurate but will reduce the amount of calls to their slow functions

Change-Id: I82393d5acd68b84c6e6f3377ba40bb1d5c51ca8a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-21 13:48:07 +02:00
Mårten Nordheim
69a43c6c3e Schannel refactoring
This moves some repeated code into functions (namely readToBuffer and
retainExtraData) while also changing how the intermediateBuffer is
handled to avoid deallocating and reallocating repeatedly.

Change-Id: I49e6cee641f961565051a67123c56b1c8f3c0259
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-21 13:47:54 +02:00
Mårten Nordheim
399f815143 qdiriterator benchmark: test against std::filesystem
If c++17 is available and the header is available (not
experimental/filesystem) then we'll try
std::filesystem::recursive_directory_iterator as well.

Results on my PC (Windows, VS 2019):

PASS   : tst_qdiriterator::posix(C:\depot\qt\main/src/corelib)
RESULT : tst_qdiriterator::posix():"C:\depot\qt\main/src/corelib":
     23 msecs per iteration (total: 94, iterations: 4)
PASS   : tst_qdiriterator::diriterator(C:\depot\qt\main/src/corelib)
RESULT : tst_qdiriterator::diriterator():"C:\depot\qt\main/src/corelib":
     17 msecs per iteration (total: 71, iterations: 4)
PASS   : tst_qdiriterator::stdRecursiveDirectoryIterator(C:\depot\qt\main/src/corelib)
RESULT : tst_qdiriterator::stdRecursiveDirectoryIterator():"C:\depot\qt\main/src/corelib":
     6.7 msecs per iteration (total: 54, iterations: 8)
PASS   : tst_qdiriterator::fsiterator(C:\depot\qt\main/src/corelib)
RESULT : tst_qdiriterator::fsiterator():"C:\depot\qt\main/src/corelib":
     23 msecs per iteration (total: 92, iterations: 4)

And as a drive-by fix: move the 'data' function out of the private slots
so it is not invoked as a test function (it doesn't cause any problems
but is ultimately pointless).

Change-Id: Ia160ee276423ec51e35e554a4cd63d4d940c0e6a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-21 12:40:49 +02:00
Samuel Gaist
9294d02395 test: migrate QDom test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I74ca824d5a2ee6c295c41cd577eab466326395f0
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-21 10:38:23 +02:00
Samuel Gaist
9fc5902d23 test: migrate manual dialogs tests to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I9eae3291bc6934375404224c7242e2b23af2019b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-21 10:38:02 +02:00
Leena Miettinen
a9dcd772c0 Doc: Replace \b {Note:} with \note
Change-Id: I1f6947acec4494c151317e1faf79720dad0da6bb
Reviewed-by: Martin Smith <martin.smith@qt.io>
2019-10-21 10:37:52 +02:00
Samuel Gaist
439f343416 test: migrate QDBusInterface test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I47a047e27432c874b47bd25581806e1bc156e94f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-21 10:37:15 +02:00
Christian Ehrlicher
aa4b0f5cb7 Uic: fix crash when trying to resource icon information
Fix a typo introduced in be56db2c49 to
avoid a crash when a pixmap is given for selected on but not for
selected off.

Fixes: QTBUG-79125
Change-Id: I84072b6b4e8a4d21684be21f5bff1deeaddbba6d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-21 09:48:30 +02:00
Laszlo Agocs
5288c8dae3 rhi: Enhance swapchain size query docs
Inspired by a recent Qt Quick fix. Make sure we make it
clear that QRhi-based rendering code should base output
size calculations (e.g. for setViewport() and similar)
on the pixel size reported from QRhiSwapChain, instead
of going to the QWindow.

Change-Id: I2fc22972162ccc6307ac07ceb7766c746d5f562a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-21 09:28:33 +02:00
Richard Moe Gustavsen
d71dbe3e93 docs: clarify usage of css 'qproperty' in stylesheets
Clarify that the qproperty properties will only be
evaluated once.

Fixes: QTBUG-2982
Change-Id: Ie294ced118f740c7378c62c0b5a4924d5628e118
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2019-10-21 07:22:23 +00:00
Eskil Abrahamsen Blomfeldt
d3398207d0 Revert "Release left button before showing the popup context menu"
This partially reverts commit 5e8b16f0e4.
Releasing the mouse button synthetically made it impossible
to use tap and hold gestures. When investigating, it seems
that other changes have fixed the original issue that
5e8b16f0e4 was meant to address,
so this is no longer needed.

[ChangeLog][Android] Fixed regression that made it impossible for an
application to use the tap-and-hold gesture.

Fixes: QTBUG-72408
Change-Id: I53f687d047a4ad0fdf3c8c96a00ed1b11d09f047
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-21 09:14:08 +02:00
Eskil Abrahamsen Blomfeldt
5205510524 Enable cursor in ligature test on Windows
The default font on Windows ("Times" is not found) does not have
a ligature for "fi", so the test would not actually be testing
what it was supposed to on this platform, and would pass even
when the code was buggy.

To enable the test on Windows, we select a standard font which
has the ligature (Calibri).

Change-Id: Ic117cd8e549aa729a0cd68006d7c180c6c89c053
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-21 09:01:26 +02:00
Eskil Abrahamsen Blomfeldt
cc4087b18a Remove mapping from CJK/Latin to Common script in Harfbuzz NG
The original commit message says this is to ensure compatibility
with the old Harfbuzz, but since OpenType features such as
kerning are often matched based on the writing system of the glyphs,
it will break kerning (and other OpenType features) for text in these
languages in some fonts. Even font that were successfully kerned by
the old Harfbuzz are broken.

To avoid regressing on finding cursor positions inside ligatures,
we need to amend 9f837af945. This
would enable cursor positions inside ligatures for languages
where they are only used for cosmetic purposes, and this was
generalized to Common and Greek at the time. This now has to be
expanded to include all the writing systems that were previously
covered by "Common".

[ChangeLog][Text] Fixed kerning error with certain fonts.

Fixes: QTBUG-77908
Change-Id: Id261fef05f86841b1533b7d87207c3d17e01e96e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-21 09:01:17 +02:00
Christian Romberg
8409844bd6 Fix java mkspec for compatibility with JDK 12
Starting with JDK 12, javac no longer supports source and target
version 6. This commit changes the source and target version to 7.

[ChangeLog][General]

Fixes: QTBUG-79094
Change-Id: Ife8966db01c68251de2fe85307de30c31e658172
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-21 07:54:01 +02:00
Qt Forward Merge Bot
daa8040b50 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I642be6de9ef32491b09db97185146c671266240e
2019-10-21 01:00:56 +02:00
Volker Hilsheimer
5e9b2ade67 Read a unique thread identifier from CPU registers
This is, depending on the implementation of pthread, significantly
cheaper than using a pthread library call.
Even if we don't know the assembler for an architecture, taking
the address of the thread_local variable is still faster.

As QThread::currentThreadId() is documented to be used internally
and not meant for application code, we don't have to care about
what exact value we return. Internally, we use it only to compare
thread IDs for equality, which this implementation is sufficient
for, even if a thread ID is re-used when one of the threads
terminate and a new thread starts (since the other thread is still
executing code). Besides, pthread_self documents [0] that a thread
ID may be reused, and that the returned pthread_t cannot be
portably compared using operator==(); using pthread_equal would
require adding a Qt thread-ID type that implements this correctly,
and would make things even slower.

[0] http://man7.org/linux/man-pages/man3/pthread_self.3.html

Change-Id: Id08e79b9b9c88976561f7cd36c66d43771fc4f24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-20 17:08:57 +02:00
Topi Reinio
51edfdd212 Doc: Prevent QDoc from auto-linking certain words
'macOS' appears in the documentation frequently, and because it
resembles a variable/property name, QDoc links each occurrence
of it.

'WebChannel' appears as part of a module name, but it's also
a QML type - auto-linking each word to QML documentation is
confusing.

Likewise, there's no need to link 'OpenGL' each time.

Explicit links such as \l [QML] WebChannel continue to work.

Task-number: QTBUG-79135
Change-Id: I76cc84b0076255e260aa88c244102702a48f35a6
Reviewed-by: Martin Smith <martin.smith@qt.io>
2019-10-19 18:36:13 +02:00
Tor Arne Vestbø
1b6db18494 Propagate application termination requests through QPA
Instead of having each platform plugin deal with application termination
in their own weird ways, we now have a QPA API to signal that the system
requested the application to terminate.

On the QGuiApplication side this results in a Quit event being sent to
the application, which triggers the default behavior of closing all app
windows, and then finally calling QCoreApplication::quit().

The quit event replaces the misuse of a close event being sent to the
application. Close events are documented as being sent to windows.

The close events that are sent to individual windows as part of the
quit process can be ignored. This will skip the final quit() of
the application, and also inform the platform that the quit was
not accepted, in case that should be propagated further.

In the future the logic for closing windows should be unified
between the various approaches in closeAllWindows, shouldQuit,
and friends.

Change-Id: I0ed7f1c0d3f0bf1a755e1dd4066e1575fc3a28e1
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-19 11:58:35 +02:00
Tor Arne Vestbø
2967510213 macOS: Merge [QCocoaApplicationDelegate canQuit] into callsite
The logic for handling termination without any event loops has been
moved up as an early exit, and the code has been modernized.

Change-Id: I202720b9923e35732cffea656e1ce108ef11953d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-19 08:29:08 +02:00