Commit Graph

47709 Commits

Author SHA1 Message Date
Nico Vertriest
2be708b801 Doc: Make snippets Qt Gui compilable - textdocument-imagedrop
Task-number: QTBUG-81486
Change-Id: I80b66fce31ba5ee511690283cf56ce4306702b14
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:03 +02:00
Nico Vertriest
6283f447cd Doc: Make snippets Qt Gui compilable - textdocument-frames
Task-number: QTBUG-81486
Change-Id: Ia027d2f07e61944e8a2cc40a24ee23b2d8e526b0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:02 +02:00
Nico Vertriest
b28870b2cc Doc: Make snippets Qt Gui compilable - textdocument-find
Task-number: QTBUG-81486
Change-Id: I97b2b9a9b672776971e4792b713a23272eb653ce
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:02 +02:00
Nico Vertriest
d76d37fd1a Doc: Make snippets Qt Gui compilable - textdocument-cursors
Task-number: QTBUG-81486
Change-Id: If02da7248b6c0299909fad83681fd5f08f3e29d9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:01 +02:00
Nico Vertriest
0f1c8d437f Doc: Make snippets Qt Gui compilable - textdocument-css
Task-number: QTBUG-81486
Change-Id: I4c73a0902bc1c47cd2fa90553941bf8824ba5914
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:13:00 +02:00
Nico Vertriest
2c7d46727e Doc: Make snippets XML compilable
Task-number: QTBUG-84459
Change-Id: I143a8b8869f7cb8547f1898831d0d6e86b7ac35d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-01 06:11:56 +02:00
Paul Wicking
1ca85a2fd1 Doc: Compile GUI vulkan snippets
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.

Change-Id: Ia16a7793b999e7ffd8d387fa3826117a4ade2c41
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-09-01 06:11:50 +02:00
Paul Wicking
4074c54270 Doc: Compile GUI util snippets
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.

Change-Id: Ieec8deb8aaf4358ffc35502fae6ea7c043d34672
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:11:46 +02:00
Paul Wicking
323d2b57e0 Doc: Remove unused snippet for removed code
QDesktopServices::DataLocation doesn't exist anymore.
Get rid of the snippet.

Task-number: QTBUG-81486
Change-Id: Ibc938437c916b3c08ec64d7692a31e69944c1b30
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-09-01 06:11:42 +02:00
Giuseppe D'Angelo
c1454d07cf Take the right lock before using a connection's receiver
When a signal/slot connection is activated, a lock on the receiver
object is taken (to be sure it doesn't get destroyed).
The path for blocking queued connections however took the lock on
the sender by accident, fix that.

Pick-to: 5.15 5.12
Change-Id: I8cd938a50eca2bf71e7bfb86768ee0c8431afdfa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-01 02:48:40 +02:00
Marc Mutz
2c9529e158 Long live Q{Any,Utf8}StringView!
We need to add these two classes at the same time, because
QAnyStringView makes all QUtf8StringView relational operators moot. We
might want to add some later, esp. for UTF-8/UTf-8 comparisons, to
avoid the pessimization that we can't early-out on size() mismatch in
QAnyStringView equality operators, but that's an optimization, not a
correctness issue, and can be fixed in a source-compatible way even
after Qt 6 is released.

To deal with the char8_t problem in C++20, make QUtf8StringView a
class template out of which two UTF-8 views can be instantiated: the
Qt 7 version, which depends on C++20 char8_t as value_type, and the Qt
6 version where value_type is a char. Use inline namespaces to map the
QUtf8StringView identifier to one or the other, depending on the C++
version used to compile the user code. The inline namespace names must
needs be a bit ugly, as their inline'ness depends on __cpp_char8_t. If
we simply used q_v1/q_v2 we'd be blocking these names for Qt inline
namespaces forever, because it's likely that inline'ness of other
users of inline namespaces in Qt depends on things other than
__cpp_char8_t. While inline'ness of namespaces is, theoretically
speaking, a compile-time-only property, at least Clang warns about
mixed use of inline on a given namespace, so we need to bite the
bullet here. This is also the reason for the QT_BEGIN_..._NAMESPACE
macros: GCC is ok with the first declaration making a namespace
inline, while Clang warns upon re-opening an inline namespace as a
non-inline one.

[ChangeLog][QtCore][QUtf8StringView] New class.

[ChangeLog][QtCore][QAnyStringView] New class.

Change-Id: Ia7179760fca0e0b67d52f5accb0a62e389b17913
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-31 22:57:49 +02:00
Peng Wenhao
f0ae973244 Qpagedpaintdevice: Use marginsF instead of internal struct margins
resolve remaining Qt6 TODOs

Change-Id: Iad659a09ddfe136bdc545bc0635b4c695540c58b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-01 04:57:48 +08:00
Tor Arne Vestbø
90358f6042 Deprecate and remove uses of AA_DisableHighDpiScaling
Change-Id: Ibadce68775858c524b998aacad310905ba2c2e8e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-08-31 19:14:55 +02:00
Tor Arne Vestbø
8028474e62 Remove unused exported functions from QWSI
Change-Id: If85231373bc0ec9a9259f628cd0c62a3a75b813b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-08-31 14:29:01 +02:00
Tor Arne Vestbø
ef854c0bba Remove QWSIPrivate::EventType::FrameStrutMouse
Change-Id: I66eb05ae7ed58ff3375b756c29a96d5067251cc3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-08-31 14:29:01 +02:00
Tor Arne Vestbø
2dc46c0902 Deprecate and remove all uses of AA_UseHighDpiPixmaps
High-DPI pixmaps are always enabled, and cannot be disabled.

Change-Id: I01a006b404e5431582b64ef812974c1c022b39ae
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-31 14:29:01 +02:00
Edward Welbourne
8adb0dde19 QTextStream: purge deprecated API
All deprecated in 5.15, for removal in 6.0

Change-Id: I40415d388cfcf3e428bce3327297a775ec756eeb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-31 10:32:47 +02:00
Edward Welbourne
e40320c552 QWeakPointer: purge deprecated API
Since 5.0: assignment/construction from QObject pointer
Since 5.14: data() to recover the packaged pointer

Change-Id: I5d6ab561ce39bc0d9d3e5035eb2ca38139cd76b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-31 10:32:39 +02:00
Nico Vertriest
860c68522b Doc: Make snippets Qt Gui compilable - textdocument-charformats
Task-number: QTBUG-81486
Change-Id: I460917c979eb9bd90b9ab7694c0928ab252adae9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-31 07:12:44 +02:00
Nico Vertriest
886cc0e442 Doc: Make snippets Qt Gui compilable - textdocument-blocks
Task-number: QTBUG-81486
Change-Id: I663c53d11e4bd3086c4afee0c994d00ecc0c7cad
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-31 07:12:40 +02:00
Paul Wicking
bbbbd642d5 Doc: Remove obsolete/removed snippet code
Task-number: QTBUG-81486
Change-Id: Ifc6ac9203a046b6b5da6140931c59875f0dc08c3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-31 07:12:37 +02:00
Paul Wicking
52abab1b42 Doc: rename qfontdatabase snippet project file
The project isn't included as a subdir of the parent because
the project file name doesn't follow proper convention. Fix
by renaming the project file.

Task-number: QTBUG-81486
Change-Id: Ie32aaa587cdaa6802644588d6631b14e61558ae2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-31 07:12:33 +02:00
Nico Vertriest
5e566d004e Doc: Make Qt Gui snippets compilable - clipboard
Task-number: QTBUG-81486
Change-Id: I41b0c5f021ea9fbbe384f224443608f4397dec24
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-31 07:12:21 +02:00
Topi Reinio
49e8d0f3d5 Doc: Fix documentation warnings in Qt Network
Pick-to: 5.15
Change-Id: I3653977a4511aa5c296a3954399342d98ac71586
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-08-31 07:12:13 +02:00
Topi Reinio
0ac7a81250 Doc: Fix documentation warnings for Qt XML
Content for the deprecated SAX interface was removed, remove rest of
the linking as well.

Pick-to: 5.15
Change-Id: Idd233a821139837b779e551aeba914114500e39e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-08-31 05:12:06 +00:00
Lars Knoll
d3ba159ed2 Fix alignment of QVariant::Private::data on 32bit systems
We want a suitable alignment to hold a double even on
32bit systems.

Change-Id: I35145ded9320c147d4fcd7a04c4b3630912cc00a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
2020-08-30 21:11:22 +02:00
Laszlo Agocs
8641d5d729 rhi: gl: Correctly report WideLines for OpenGL
In core profile contexts a line width other than 1 may not work
as expected since it is deprecated in the core profile.

Change-Id: I3fc33cf90c65156aa87d04f08518c9ddcfb62625
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-30 17:45:02 +02:00
Laszlo Agocs
9390edb119 rhi: Work around qsizetype fallout in manual tests
Change-Id: I9f0e210caacc6eefe5ed1ee6fa97574ad5e9edcc
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-30 17:45:01 +02:00
Laszlo Agocs
67faf0641d rhi: vulkan: Enable features on the device
The silly fine-grained enabling of features on the VkDevice
seems to be ignored in practice by the implementations, but
wideLines becomes relevant because the validation layers warns
if a line width is set on the pipeline without enabling the feature
on the device. So to play nice, enable the features we care about.

Change-Id: I0c64a0d10a8279fe43d899118b0d6f0e4f875d41
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-30 17:44:59 +02:00
Laszlo Agocs
fb4760bb21 rhi: gl: Also try GLSL 140 and 130
Change-Id: I21e3ca92d62f20f3ec608bef54c68f9bd09a207f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-30 16:17:16 +02:00
Marcel Krems
49efc168e1 QSqlError: Remove unused members, kept for binary compatibility
Also optimize the construction of QSqlErrorPrivate.

Change-Id: I791ebe0b66fab43e74093186a798ef9656f97dbd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-30 03:22:31 +02:00
Eskil Abrahamsen Blomfeldt
cba147d359 Fix text issues when using typographic names
By default, only the legacy family names are populated on Windows,
since we are using GDI to do the population.

The actual typographic names are added later as aliases when
the font is loaded.

This can cause us to fail matching a font against its typographic
name before it has been loaded and e.g .in Qt Quick we will cache
the glyph indexes for a fallback font instead. If the font is later
loaded and aliases are populated, we will use the cached glyph
indexes and get seemingly random glyphs displayed.

We reuse the mechanism invented for CoreText to do lazy population
of aliases. The population will now happen when the first non-match
occurs, and a second attempt will be made after we populate aliases.

[ChangeLog][Windows] Fixes an issue where fonts would sometimes not
fail to work when selected using typographic names.

Fixes: QTBUG-84786
Pick-to: 5.15
Change-Id: Ic7b65cde26ddcbf1a257f1673b9af37154660c2f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-30 01:57:37 +02:00
Morten Johan Sørvig
707b64bece Display combobox popup on the correct screen
Display QCompoBox popups on the correct screen, also
when the parent window spans multiple screens. In this
case, QWidget::screen() will return the main screen for the
window, which will not necessarily be the screen at
the combobox popup position.

Change-Id: Ib8a8163a757f7b849883b833fbde27a1e01af49a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-30 01:56:05 +02:00
Samuel Gaist
a646bcf2be QAbstractItemView: make clipboard copy less constrained
Currently when copying from an item view, only QString value types are
considered. This severely limits the usefulness of the feature as it
does not even allow to copy number nor dates that can be translated to
text.

This merge request changes that by checking if the content being copied
can be converted to a string rather that just being a string. This will
also allow for custom types to be handled.

Fixes: QTBUG-86166
Pick-to: 5.15
Change-Id: If57c986ef5831d59eeb59f9c4b900fa126ec31ea
Reviewed-by: David Faure <david.faure@kdab.com>
2020-08-29 23:26:58 +02:00
Volker Hilsheimer
add8262f72 Remove QStyleOptionProgressBar::orientation member
Address ### Qt 6 comment; the information is already stored in the
state variable, using the QStyle::State_Horizontal bit.

Change-Id: I61d143ba057776f9d622793a0592b5dd4726f25d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-29 22:05:09 +02:00
Lars Knoll
62c0844109 Move the data for QTimer into the d-pointer
We shouldn't expose it inline in the header file.

Change-Id: I400d805fd0769f788f257bbf78311fe1fb56df79
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-29 21:01:10 +02:00
Lars Knoll
f098aee532 Fix comparison of QVariants that contain pointers to QObjects
Allow comparing variants of different types, if both types
are pointers to related objects.

Amends change 4a69cd7f72

Change-Id: Ib52b17781b0b7f60cfd5da42fce733faacfa0ae8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-29 21:01:02 +02:00
Lars Knoll
4a1567ab12 Inline some methods that only forward to another overload
Change-Id: Iba74962d20c00de8996834f0a003f38c2d2cc3e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-29 21:00:51 +02:00
Edward Welbourne
78cf89c07d Use checked string iteration in case conversions
The Unicode table code can only be safely called on valid code-points.
So code that calls it must only pass it valid Unicode data. The string
iterator's Unchecked Unchecked methods only provide this guarantee
when the string being iterated is guaranteed to be valid UTF-16; while
client code should only use QString, QStringView and friends on valid
UTF-16 data, we have no way to be sure they have respected that.

So take the few extra cycles to actually check validity in the course
of iterating strings, when the resulting code-points are to be passed
to the Unicode table look-ups. Add tests that case mapping doesn't
access Unicode tables out of range (it'll trigger the new assertion).
Added some comments to qchar.h that helped me understand surrogates.

Change-Id: Iec2c3106bf1a875bdaa1d622f6cf94d7007e281e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-29 18:15:27 +02:00
Marcel Krems
ab5e444c8f Remove remaining traces of deprecated QtMsgHandler
Change-Id: I28aecb444eb9bc9e26e6ff8998904dbf28419f25
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-29 16:24:21 +02:00
Marcel Krems
2a896becdf qarraydataops: Fix compiler warnings under MSVC 2019.7
qarraydataops.h(444): warning C4127: conditional expression is constant
qarraydataops.h(444): note: consider using 'if constexpr' statement instead
...
qabstractitemmodel.h(261): note: see reference to class template instantiation 'QList<int>' being compiled

qarraydataops.h(1209) : warning C4702: unreachable code

qarraydataops.h(1104): warning C4913: user defined binary operator ',' exists but no overload could convert all operands, default built-in binary operator ',' used
src/corelib/kernel/qobjectdefs_impl.h(96): note: could be 'void QtPrivate::operator ,<std::reverse_iterator<QTypedArrayData<T>::iterator>>(std::reverse_iterator<QTypedArrayData<T>::iterator>,const QtPrivate::ApplyReturnValue<void> &)'
        with
        [
            T=QTextEdit::ExtraSelection
        ]
qarraydataops.h(1104): note: while trying to match the argument list '(std::reverse_iterator<QTypedArrayData<T>::iterator>, std::reverse_iterator<QTypedArrayData<T>::iterator>)'
        with
        [
            T=QTextEdit::ExtraSelection
        ]
...
codeedit.cpp(84): note: see reference to class template instantiation 'QList<QTextEdit::ExtraSelection>' being compiled

Change-Id: I3c5007e40f709c28bc8b3b3bec5ea98ea5f34e5a
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-29 15:07:54 +02:00
Marcel Krems
7e1432898e Remove MSVC workaround for QPolygon
Change-Id: I62f7c6da7629dcdfda653a136d3bcd483359c86c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-29 14:49:15 +02:00
Marcel Krems
fd92abb093 QLocalSocket: Print value OperationError on debug output
Pick-to: 5.15
Change-Id: Ib3e38e8c0a46b2070eca1e65f081b2d6d2774020
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-29 12:37:00 +00:00
Paul Wicking
e1b1dd7917 Doc: Remove obsolete snippet code
Obsolete code that is unused/not referenced from
documentation - get rid of it.

Task-number: QTBUG-81486
Change-Id: I82ee65b6e827666f88fa8ecf6d87ae736c893cc3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-08-29 14:23:04 +02:00
Nico Vertriest
80cc233c59 Doc: Make Qt Gui snippets compilable - draganddrop
Task-number: QTBUG-81486
Change-Id: I0a10e4d353f864e295833ff7d4f47950c5199a21
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-29 14:22:49 +02:00
Paul Wicking
5596344100 Doc: Make Qt Gui snippets compilable - brush
Remove unused code in snippet files not referenced from anywhere.

Task-number: QTBUG-81486
Change-Id: I80b46c013bde99e1aea86311d3579ccc922b8fd7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-29 14:22:42 +02:00
Paul Wicking
5bf7ceb4d4 Doc: rename snippet project file
The project file name is wrong, so the project won't become
part of the parent subdirs project. Rename the project file
to correct this.

Task-number: QTBUG-81486
Change-Id: I069004caa5e7bdeecc0550fafe78f8977fbf7a87
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-29 14:22:36 +02:00
Andrei Golubev
a2b1b0292d Prepend optimize QString
Added prepend optimization to QString

Task-number: QTBUG-84320
Change-Id: Iaa8df790a10c56ecceb06f7143718fb94874ce76
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-29 14:20:06 +02:00
Andrei Golubev
4b9ec00534 Support GrowsBackwards in QByteArray
Updated main QByteArray operations to support prepend-optimization path

There are still many things to consider especially algorithms that use
QByteArray::data() or do raw memory operations (e.g. memcpy) regardless
of the underlying memory layout, which was somewhat valid before but
will likely break now given free space > 0 at the beginning of the byte
array memory. Looked at existing cases in the scope of QByteArray, they
seem to be OK. Hopefully, CI would find missed violations if any

Task-number: QTBUG-84320
Change-Id: I7990cda165b8e77a397e41df4e145468e7a86be0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-29 14:20:06 +02:00
Andrei Golubev
7f3c0d8a05 Reserve extra space for '\0' in QArrayData::allocate
Added implicit space reservation for '\0' in allocation functions used by
containers. In current setting, this means sizeof(char16_t) bytes extra
memory is allocated each time and implicitly exists. The extra memory is
uninitialized by default

Task-number: QTBUG-84320
Change-Id: Ia3cc268183c00ea24ea9d326db3f392f71868d52
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-29 14:20:05 +02:00