Commit Graph

48214 Commits

Author SHA1 Message Date
Laszlo Agocs
60871b4fdf rhi: vulkan: Fix mipmap generation for cubemaps
Change-Id: Ia1aab06214be802aaabc97ffefa28947e11148e3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-09-25 09:24:25 +02:00
Assam Boudjelthia
342a8f29ea CMake: fix minor line indentation
Pick-to: 5.15
Change-Id: I1f064ecb38fcd6b0a59f3eaeb079cabbb7a8029f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-25 10:14:07 +03:00
Cristian Adam
d9d137c8f3 CMake Build: Fix iOS build with PCH and CMake 3.18.3
If a target inherits precompile headers from a different target
that has more languages enabled (CXX, OBJCXX), the target will
depend on PCH artifacts for a language that is not actually
present.

Change-Id: I230f16ee59f2c524a30d41a487093343272722d1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-25 08:59:42 +02:00
Mårten Nordheim
8bcab6d43f qt_add_plugin: Get CLASS_NAME as a one value parameter, add TYPE
I accidentally made the CLASS_NAME a multi-value parameter when adding
it.

Add a TYPE argument, which was likely intended to be there since it is
already used in an android branch.

Change-Id: Ic44dbbaeebc6863a984a7c2effbc00c3c2796b0b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-25 08:59:34 +02:00
Joerg Bornemann
3bbe97b444 CMake: Expose XKB::XKB as public dependency of Qt::GuiPrivate
Headers of xkbcommon are used in private headers, and consumers of
Qt::GuiPrivate should automatically link against XKB::XKB.

Change-Id: I99c67b5f291f64b529aed1499a00a215b5db3be2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-25 08:59:26 +02:00
Ulf Hermann
6b8ee60d8a tst_qmetacontainer: Remove non-existing typeflags.bin from build system
Change-Id: Icb1668493447e478f539016f330fe58c79dde454
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-09-25 08:50:11 +02:00
Allan Sandfeld Jensen
d3643d9690 Use c++20 when available at compile time
Also std::end is constexpr where std::next sometimes isn't always with
sanitizers active.

Change-Id: Ibe4c11eb4945fb286247e841b6a7f6cc3ff1eaa6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-09-25 08:18:03 +02:00
Kai Koehne
01697c5f9b .gitignore: Qt Creator files cleanup
Move Qt Creator files to a common section, like for the other
IDE's. While at it, fix CMakeLists.txt.user*.

Change-Id: I978c5698204c35ef8f14d2261e7875160484d0e6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-25 07:50:15 +02:00
Andreas Buhr
1c883682ee git: ignore CLion configuration files
modify .gitignore file to ignore the '.idea' directory created by CLion.

Change-Id: I63ca2fc8e3710ebcb08e99c7ad89d3bd57721dbd
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-09-25 07:50:10 +02:00
Kai Koehne
f7ee1bfe6b Doc: Update CMake snippets to Qt 6
Change-Id: I53021781a25c141db5d5fc6771192cd8d6ed732a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-25 07:50:02 +02:00
Allan Sandfeld Jensen
c2be9180b7 Replace Q_REQUIRED_RESULT with [[nodiscard]]
It was already used many places directly making the code inconsistent.

Change-Id: I3b14bc6c333640fb3ba33c71eba97e78c973e44b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-25 07:10:45 +02:00
Andy Shaw
31a1b3280c Fusion: Don't add unnecessarily extra padding for a groupbox
If there is not a title or an indicator for a groupbox, then there is no
reason to add extra padding for it when placing the contents of the
groupbox. So this accounts for when one or the other is not set so that
the space is used more evenly.

Fixes: QTBUG-86411
Change-Id: I536798b57e1195c5a13218f1f82431c4e91f6852
Pick-to: 5.15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-09-25 07:08:47 +02:00
Christoph Schleifenbaum
34b4dc11d9 QFontEngine: Do not call getSfntTable with uninitalized value
On FreeType font engine this results in a call to FT_Load_Sfnt_Table
with a pointer to an uninitialized value passed in as FT_ULong* length,
crashing. Instead initialize value to 0.

Change-Id: I50d6df3b2296a05640d939e862bc50adb0fec921
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit e041f54596)
2020-09-25 05:03:26 +00:00
Joerg Bornemann
dae078e521 CMake: Export 3rdparty dependency find_package calls of private modules
Consider a Qt module with a 3rdparty library target in
PRIVATE_MODULE_INTERFACE, e.g. XKB::XKB in Qt6::GuiPrivate. Consumers of
GuiPrivate automatically depend on XKB::XKB. In order to do that they
must find_package(XKB ...). As all find_package calls for GuiPrivate are
in the same place as the ones for Gui, this package must be marked as
optional. Otherwise all consumers of Qt6::Gui would have to have the
xkbcommon package installed too.

This patch exports find_package calls for every 3rdparty public
dependency of private modules and marks them as optional.

Change-Id: Ia1eeb09c29927fb6634ef08b477684ed6f123267
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-25 06:58:55 +02:00
Shawn Rutledge
1783b048fd Get rid of QMutableEventPoint::stationaryWithModifiedProperty
Omitting stationary points from touch events is such a marginal
optimization that this code probably isn't worth maintaining.
It wasn't implemented correctly this time either, according to the
tst_QQuickMultiPointTouchArea::stationaryTouchWithChangingPressure()
test.

[ChangeLog][QtGui][QPointerEvent] We no longer attempt to avoid
delivery of stationary points within QTouchEvent: every pressed point
is now included in every TouchUpdate event.

Task-number: QTBUG-77142
Change-Id: If1fd666fb3057a17e0dffdd7ca7138693126b02b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-25 06:51:32 +02:00
Friedemann Kleint
aa5f2bf836 qwaitcondition_win.cpp: Fix deprecation warning about QMutex::isRecursive()
Remove the check since a QMutex can no longer be recursive, fixing:
qwaitcondition_win.cpp:164:28: warning: 'bool QMutex::isRecursive() const' is deprecated: Use QRecursiveMutex instead of a recursive QMutex [-Wdeprecated-declarations]

Task-number: QTBUG-85700
Change-Id: Ic1631c1e671cf3234b5823d6d20121d746304c8e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-25 04:40:13 +00:00
Wang ChunLin
789d487cb0 fix QComboBox currentText return placeholderText
If it does not add item,the currentText should return empty string

Fixes: QTBUG-86580
Pick-to: 5.15
Change-Id: I54c3a8b7ececfb1e62bcd7ac592feccaff3f8b48
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-09-25 10:52:27 +08:00
Wang ChunLin
75ca70288c fix qcombobox code style
modify some code style

Fixes: QTBUG-86793
Change-Id: I263bda1bd16dd34129ea5ae8948ad3eeaf833f3a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-09-25 10:52:02 +08:00
Volker Hilsheimer
ca6ac03845 Fix some qdoc warnings: undocumented parameters
Change-Id: I5d37f620caccbd1445c99a602b71779bdedd37d3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-25 04:42:27 +02:00
Volker Hilsheimer
5471180f2b Fix qdoc warning from undocumented enum value
Change-Id: Ie6ea916388867cc705a87544e893e55f715e83d7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-25 04:42:18 +02:00
Giuseppe D'Angelo
bf3649d639 QScopedValueRollback: code tidies
Add constexpr + deploy std::exchange.

Change-Id: I4c5e6f5d35cd74c464667f633344d27c0656f0eb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-09-25 03:02:09 +02:00
Lorn Potter
49517aad70 wasm: fix network status code propagation
Fixes: QTBUG-86620
Pick-to: 5.15
Change-Id: I911636739dc57e47bc2a07a583f4e67fc08b1b19
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-09-25 10:25:13 +10:00
Alexandru Croitor
3031787485 CMake: Fix sanitizer build when using Clang on Linux
Apparently the combination of the --no-undefined linker flag together
with ASAN when building on Linux with Clang does not work.

Disable --no-undefined flag in such a scenario. Note that linux-clang
mkspec doesn't add that flag at all, which is why asan builds work
there.

Change-Id: I6167c757ce4be5d2263311bc84e5fb445b0f7c2d
Fixes: QTBUG-86879
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-09-24 18:23:17 +02:00
Friedemann Kleint
22bf3a4511 QWindowsPrintDevice: Fix signedness warnings
Remove the warnings suppression.

Task-number: QTBUG-83259
Change-Id: I3d8852ce8f62bac9b8f6ca4e13892164fb6d4059
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-09-24 14:22:57 +02:00
Friedemann Kleint
90231f5ab2 QWindowsPrintDevice: Brush up the code
- Replace C-style casts, use helper wcharId() for the printer id
- Replace typedef by using
- Replace NULL by nullptr

Task-number: QTBUG-83259
Change-Id: I066ff65bf7c1e894a6c6bb19cf0334c0b83fb759
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-24 10:36:38 +02:00
Friedemann Kleint
fb18fe0316 Windows: Build print support plugin directly into QtPrintSupport
Task-number: QTBUG-83259
Change-Id: I23042e1eb89d407692a96bfb2d6c4efdddbfb50f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-24 10:36:38 +02:00
Volker Hilsheimer
ab428e3000 Fix qdoc warning from QLibraryInfo after API change
In 557623cc4f, QLibraryInfo::location became path.

Change-Id: I71d61e44d3612b4613e1de58f2340174579eee3d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-24 06:52:41 +02:00
Volker Hilsheimer
f791c1c0b5 Fix some qdoc warnings in QMetaType and QVariant
Document new enum values, remove documentation for implicit members,
fix parameters, and tie documentation to function definitions.

Change-Id: I5f32d45be8709e5f614d099ddf21252e23e144f8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-24 06:52:23 +02:00
Christian Heimlich
e1cf5b2348 Fix redundant emission of editingFinished from QLineEdit with Return key
Current implementation of QLineEdit uses the "edited" bit-field flag to
prevent unnecessary emissions of editingFinished() when a line edit
loses focus but its contents have not changed since the last time the
signal was emitted; however, this flag is only cleared when the signal
is fired due to focus loss and not when the Return/Enter key is pressed.
This causes an unexpected double emission of the signal when focus is
lost following a press of the Return/Enter key if the line edit's text
was not further altered between the two actions.

This change includes the Return/Enter press as a trigger for clearing
the "edited" flag to make editingFinished()'s behavior more consistent
and expected. Prevents slots in user code from triggering twice in
situations where the line edit's current contents have already been
handled, but still allows the end-user to force an emission of the
signal via Return/Enter.

The effect of the "edited" flag on the signals behavior has also been
noted in the signal description as it was previously omitted.

[ChangeLog][QtWidgets][QLineEdit][Behavior Change] Pressing the
Return/Enter key in a QLineEdit will now also prevent editingFinished()
from firing due to focus loss if the contents of the line edit have not
changed since the last time the signal was emitted.

See - https://forum.qt.io/topic/116902/

Change-Id: I11aadd45341337b7852da8cf5802c7c9efdd614d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-23 20:33:33 -04:00
Volker Hilsheimer
9c5698a8fc Fix compiler warnings from deprecated QTouchEvent::touchPoints
Replace with QPointerEvent::points().

As a drive-by, turn QEventPoint copies into const references where possible.

Change-Id: Ia5e0645493984fe9177dd3ca16afdb4d56e384ee
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-23 19:50:26 +02:00
Lars Knoll
850d850c5a Use QMetaType instead of integer based type ids
Change the implementation of Qt DBus to use QMetaType directly
instead of integer based type ids.

Change-Id: I999023b58fa50dcc3504386467faf09874f7d2cf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-23 19:30:28 +02:00
Lars Knoll
be714154fa Use a hash to store the DBus marshalling data
A QList<int> where int is the metaType id is a bad idea in Qt 6,
as custom types will start at index 65536. Use a QHash instead.

Also fix the API to use QMetaType as arguments and return values.

Change-Id: Ia0b894126271be1f01dc4593b5155fb75d713720
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-23 19:30:22 +02:00
Lars Knoll
d39bd9e258 Cleanup DBus type registration code
Modernize the code base, use QMetaType and avoid
reinterpret_casts.

Change-Id: I0bad2ee393a0f850cf40b248cb9439b06ed9f663
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-23 19:30:15 +02:00
Lars Knoll
abd1b7f306 Cleanup QDBusPendingReply
Remove the limitation of max 8 arguments and clean up the
template code.

This required a bit of special work to ensure
QDBusPendingReply<void> works the same way
as QDBusPendingReply<>.

Change-Id: I8e822b2f97f0712746b917056ea8f3d5c219c7f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-23 19:30:10 +02:00
Timur Pocheptsov
720e2e0c92 QCocoaDrag::drag - make sure clipboard is ours and populated
This fix is not final yet, it's just to plumb the serious bug/regression
of accessing NSPasteBoard in some strange state and the one we have not
populated yet/do not even own (?). Drag image(s) is broken atm and will
be fixed in the follow-up patch.

Pick-to: 5.15
Task-number: QTBUG-71939
Change-Id: I5c3ac3ec138d7407c2e0c206485478aa5244ae15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-23 18:55:53 +02:00
Volker Hilsheimer
8a50a11437 Initialize trayWatcher from QSystemTrayIconPrivate
Coverity-Id: 59488
Change-Id: Ide8d9b62304b72105d2c1d4266ba2a52576ef75a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-23 18:44:16 +02:00
Volker Hilsheimer
2f319f3be9 Give QPixmap a move constructor
It already has a move-assignment operator, and implements swapping.

This requires a specialization of the QExplicitlySharedDataPointer
destructor to be forward declared, and an implementation that is
identical to the default version. Otherwise we would need
QPlatformPixmap to be fully defined in the public QPixmap header.

Change-Id: I2651bbc29a7083a93e3b3ad671d3aeea659b7d5a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-09-23 18:00:54 +02:00
Laszlo Agocs
d3c985631d rhi: gl: Enable seamless cubemap filtering
...when available. This is mandatory in order to match results with
other APIs where this is always on.

Change-Id: I3b8ef2cb806a7297c83e60a3eb1fa71b50780dbe
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-09-23 17:35:03 +02:00
Alexander Volkov
7c483a251b Simplify QHighDpi::fromNativeLocalExposedRegion()
... by using QRectF::toAlignedRect().

Change-Id: I310b2f0ad87c541aa0d63d6a8061783aff791abb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-09-23 18:34:02 +03:00
Andreas Buhr
bf548091da QDateTime change documentation to reflect usage of C locale
In the past, string formatting and parsing was done in the users
locale. Now, the C locale is consistently used in QDate(Time) and
localized functions are offered in QLocale. This patch reflects
this change in the documentation.

Change-Id: I81afda9063fa232d06841d63f69e19b49f8083f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-23 17:33:39 +02:00
Cristian Adam
079cf55111 CMake Build: Add support for -qtlibinfix configure parameter
Rename all libQt6*.so to libQt6*<infix>.so

Task-number: QTBUG-85438
Change-Id: I4b91ffaaec7bea61454b0d3c794c77f2d0868d54
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-23 17:31:13 +02:00
Edward Welbourne
42500dd9ca Add a ValidWhenMask to QDateTimePrivate::StatusFlag
This saves some repetition of verbose status-setting code.
At the same time, save the function that uses it a repeated
getStatus() call hidden inside its getSpec() by inlining getSpec().

Change-Id: I32aee521c1885408f822ecb47ab1ed76f92852a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-23 17:17:20 +02:00
Edward Welbourne
e33b0d4bb0 Make QDateTime() unconditionally noexcept
As proposed by Lars in code-review; its Data::Data() is in fact
noexcept even when CanBeSmall is false.

Task-number: QTBUG-86400
Change-Id: I351e4332660f5895fff34b950227cbb811fd9f81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-23 17:16:48 +02:00
Tor Arne Vestbø
e4f647e272 macOS: Don't assume NSSlider is never flipped
We need to take into account the possibility that the slider is flipped,
otherwise we end up with inverted rects, as noticed in Big Sur.

The logic to use the ticks as input to whether the bar rect should be
inverted didn't make sense.  If the graphics context has been flipped,
then we should reflect that through the slider.

Pick-to: 5.15
Pick-to: 5.12
Change-Id: I3574027c14807460affb42a9763211981c4ed528
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-09-23 17:04:12 +02:00
Allan Sandfeld Jensen
7c1f94f387 Fix Qt6 todo in qcssparser
Colors with wrong number of elements are now invalid.

Change-Id: I32c934894de86095d9790baa5f0d2001d76bcd3c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-23 17:01:29 +02:00
Edward Welbourne
df4cbaf8dc Assert some conditions instead of testing for them
In one case, handle an error by an early return so that we can do so.

Change-Id: If98eaaf2dfd47c1df1d09497fcc3e9ab784dc6df
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-23 17:00:00 +02:00
Edward Welbourne
1ec67b5e26 Make more consistent use of m_offsetFromUtc()
In QDateTime::toMSecsSinceEpoch(), all non-short date-times know their
offsets from UTC, so can use that, saving the TimeZone ones the need
to call (costly) zoneMSecsToEpochMSecs() and, when not short, the
LocalTime ones the need to call localMSecsToEpochMSecs().

Moved the setting of offset clear of refreshZonedDateTime()'s check
that the date and time match the milliseconds being handled, so that a
sensible offset value is set even when the date-time comes back
invalid due to being in a spring forward.

As refreshZonedDateTime() now sets d's m_offsetFromUtc for both specs,
it no longer needs QDateTimePrivate::setUtcOffsetByTZ(). In any case,
the private time-zone access that provided is equivalent to the
difference we already have between msecs and epochMSecs, except in a
zone-gap. Add assertions to confirm this in zoneMSecsToEpochMSecs().

This brought to light a problem with whole-day transitions, where
QDate::startOfDay() assumed the gap it was hitting would end by end of
day. Search backwards from noon tomorrow, instead; likewise, for
endOfDay(), search forward from yesterday.

Task-number: QTBUG-75585
Change-Id: I6151d1dfccab321605753c98e01152281461bfe2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-23 16:59:08 +02:00
Edward Welbourne
3bd6901429 Use same-msecs optimization more in QDateTime comparison
QDateTime's comparisons just compare milliseconds when both values are
local times and their statuses (hence DST-ness) match. It can do the
same for time-zones. While doing the same for UTC and fixed offsets
wins nothing, it also costs nothing, given that we're already checking
the spec.

Task-number: QTBUG-75585
Change-Id: Ib6d824569aba8def2f1319ef3a11cca6869a5b5e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-23 14:59:08 +00:00
Edward Welbourne
691762e0e3 QStringBuilder: use qsizetype for size() methods
Prompted by a ### Qt 6 comment on one of them.

Task-number: QTBUG-85700
Change-Id: Id78a05a7bf77ba04207e0f5bc2a316984b13c9ae
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-23 16:59:08 +02:00
Volker Hilsheimer
3299476791 Fix qdoc warnings for QByteArrayView
Provide simplified declaration of fromArray for qdoc runs;  fix a small typo.

Change-Id: I8c7300a014270e8ab7f18afd94ee66af4734e0c7
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-09-23 16:59:08 +02:00