Commit Graph

42131 Commits

Author SHA1 Message Date
Olivier Goffart
0915a08b33 Remove a bunch of code maked for removal
Change-Id: I1bda415433b748a1b8408ef3b890a6de3e51b3ba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-14 11:30:24 +01:00
Johan Klokkhammer Helsing
d107706ab9 Move QOpenGLWidget from QtWidgets to QtOpenGL
Task-number: QTBUG-74409
Change-Id: I98a4f8a9e1d439bfdc24eb2910385273cedecd29
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-12 16:06:31 +01:00
Johan Klokkhammer Helsing
026a8ec802 Move QOpenGLTimerQuery to from QtGui to QtOpenGL
Task-number: QTBUG-74409
Change-Id: Ic8ef0a814700b2ed76b661d560907ad498334231
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-12 13:44:57 +01:00
Edward Welbourne
2a653fde48 Convert date-time faithfully in QDateTimeEdit::setDateTime()
Previously, setDateTime() was documented to ignore the new date-time's
time-spec. It used the date and time (determined using that timespec)
with the QDateTimeEdit's configured spec. It is debatable whether that
really counts as ignoring its time-spec. All the same, that's what it
did. Fixing it is a behavior change. Added tests.

[ChangeLog][QtWidgets][QDateTimeEdit] QDateTimeEdit::setDateTime() now
converts the new datetime to the QDateTimeEdit's time-spec, rather
than combining its date and time (determined using the time spec it
came with) with the QDateTimeEdit's date and time.

Fixes: QTBUG-71181
Change-Id: Ibf0bd87723c3957ca00a2199d51d992032ef57ee
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
2019-12-12 11:36:01 +01:00
Qt Forward Merge Bot
5b193e3dd4 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2019-12-11 14:52:25 +01:00
Qt Forward Merge Bot
a4a7c1bcf7 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp

Change-Id: I6b82507bf9a80a374c40393e72f4843f1557de89
2019-12-11 14:50:53 +01:00
Johan Klokkhammer Helsing
c3a66baff8 Move QOpenGLDebugLogger from QtGui to QtOpenGL
Task-number: QTBUG-74409
Change-Id: Ida7a89b214cd5e1a3b6fdfa651299a9c5a654f5b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-11 11:53:27 +01:00
Johan Klokkhammer Helsing
f08038fca7 Remove deprecated QGL* classes
Removes QGL paths in sub-attaq and chip examples.

The boxes example depended on QGL and has been removed.

The corresponding module and test directories for the opengl module are now
empty, but has been left there so we can move the QOpenGL* classes there.

[ChangeLog][QtOpenGL] The deprecated QGL* classes have been removed.

Fixes: QTBUG-74408
Change-Id: I52f56409af8f6901359462a7ba162103d051fe3d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-11 11:53:15 +01:00
Laszlo Agocs
e6de661a8a rhi: gl: Handle struct and array of struct uniforms
We have intentionally limited support for advanced things like
arrays in a uniform block. There is one very common case however:
a one dimensional array of a struct.

Typical example for Qt Quick 3D:

struct LightSource
{
    vec4 position;
    ...
};

layout (std140, binding = 1) uniform cbBufferLights
{
    int uNumLights;
    LightSource lights[MAX_NUM_LIGHTS];
};

With GLSL (uniform blocks disabled) this gets turned into two structs
where one has a 'lights' member that is an array of the other struct.

Teach the OpenGL backend of QRhi how to handle this.

This makes the QRhi port of Qt Quick3D functional with the OpenGL
backend as well.

Change-Id: I6a09b93276794f7ecdd38f5bfbd3491a9ef58146
Fixes: QTBUG-80628
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-12-10 17:37:28 +01:00
Laszlo Agocs
53804f553d rhi: gl: Destructure mat3 correctly
As per std140 packing rules.

Change-Id: I85663d36a9fa617ea387e8f201677471b2ebd948
Fixes: QTBUG-80655
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-12-10 16:53:06 +01:00
Liang Qi
979b9335e5 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-12-10 17:53:06 +02:00
Liang Qi
90210d5d9c Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	tests/auto/network/kernel/qnetworkinterface/BLACKLIST

Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
2019-12-10 13:51:40 +02:00
Timur Pocheptsov
30e32870a0 QCocoaEventDispatcher: make 'interrupt' work
even if we are currently inside processEvents (apparently called manually
and not from QEventLoop::exec()). A carefully crafted application
(see, for example, the linked QTBUG or even updated auto-test)
can trigger itself into failing to exit the current (potentially nested)
event loop. We can harden our Cocoa event dispatcher to detect
such condition and properly propagate 'interrupt' to where it'll
do its job, indeed, interrupting the real event loop (aka [NSApp run]).
This mainly means we have to undo what bool blocker would erroneously do.
Also, long live (as people love to say these days) to another tricky
(somewhat) auto-test (surely, it's not flaky!).

Fixes: QTBUG-79477
Change-Id: I794f0cda23e24d36be67f2bb63d52b74be057c31
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-12-10 11:33:26 +01:00
Eirik Aavitsland
95689c645f Make inputmask 'X' mask character require non-blank input
The implementation for the X mask would accept any printable
character. Since that includes the blank character, there was no
difference in behavior between the requiring X and optional x: both
would allow the input to be unset, i.e. blank.

This change should be seen in conjunction with the doc improvement
da0af1e.

[ChangeLog][QtWidgets][QLineEdit] Inputmask X character now requires non-blank input.

Fixes: QTBUG-76320
Change-Id: I3e0363e9be5c13373a157cce69c99379615b5829
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-10 09:36:24 +01:00
Christian Ehrlicher
5231c26a82 tst_QSqlQuery: fix some tests
Fix some tests in tst_QSqlQuery:
 - make sure to use QSql::HighPrecision in tst_QSqlQuery::precision()
   (needed for psql)
 - remove outdated stuff for mysql 3.x
 - psql_bindWithDoubleColonCastOperator: the placeholder are stored as
   named placeholders in psql
 - avoid some useless old-style casts

Change-Id: I54d29a7e24f17d853cce6baa09a67d9278098810
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-12-10 06:27:09 +01:00
Andre de la Rocha
b209270825 Windows QPA: Export "checkable" info for menu items through UI Automation
In order to allow screen readers to say checked/unchecked for checkable
menu items, this information has to be provided through UI Automation.
Checkable menu items should implement the "Toggle" UI Automation pattern.
The "checkable" state must also be supported by QAccessibleMenuItem, which
is being added by a separated change.

Task-number: QTBUG-80551
Change-Id: I661668310d1b6b4701d0c0efdb1dcfd15d0db729
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-12-10 05:46:45 +01:00
Andre de la Rocha
e40e82ede1 Add "checkable" state to accessible menu item
The information about whether a menu item may be checked is necessary
to allow the platform code (in particular, Windows UI Automation layer)
to make this information available to screen readers.

Task-number: QTBUG-80551
Change-Id: Ibfcc4f2da1ebc68e7dc5df2cd46bbfc0a177da12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-12-10 05:45:51 +01:00
Volker Hilsheimer
c69a2448ab macOS: support copying lazily provided data to the clipboard
Using always EagerRequest type forces the application to provide the
data at copy or drag-begin time, even though the data might never be
requested (pasted or dropped into another application). For data that
is expensive to generate, this is wasteful, and on other platforms Qt
uses the functionality provided by the native clipboard to allow for
on-demand retrieval of data.

Changing the request type to LazyRequest for the cocoa clipboard works,
but then we need to make sure that we resolve all promises at shutdown
time so that the data is available (which is what the end user expects).
Commit ad0d2f463a disabled this for
lazy requests to prevent crashes when using drag'n'drop, where the
QMacPasteboard object is short-lived and stack allocated. We definitely
don't need to worry about lazy data that is not yet retrieved at the
end of a drag'n'drop operation, so limit the fix from the previous
commit to the drag'n'drop scenario.

[ChangeLog][QtGui][QClipboard] Support lazily provided copying of data
to the clipboard on macOS

Change-Id: Id2203999024a0d9d854d6933d39077cc4af925d0
Fixes: QTBUG-76263
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-12-10 05:24:11 +01:00
Lorn Potter
c978de990b wasm: set focus on canvas on new screen
This allows user to utilize the application without having to click on
it first to cause the focus-in event.

Change-Id: Ibc9582254dda91eb14ebcdf4b8ea4a4f862aa88d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-12-10 13:46:03 +10:00
Lorn Potter
73fada6d70 wasm: Fix clamp mode
Clamp mode was being obliterated by not appending to EMCC_COMMON_LFLAGS
This fixes crashes of integer overflow

Change-Id: Icae757a7189de25db5ed41df6d41d86304c39830
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-12-10 09:57:21 +10:00
Tor Arne Vestbø
c3bd5ffdc8 Don't wrap feature detection macros with QT_HAS_FOO() variants
Using wrappers for these macros is problematic when for example passing the
-frewrite-includes flag to preprocess sources before shipping off to distcc
or Icecream. It will also start producing warnings when compilers implement
http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example
https://reviews.llvm.org/D49091

Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at
https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
recommend defining '__has_foo(x) 0' as a fallback for compilers without the
macros, so that's what we go for.

Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767
Reviewed-by: Alex Richardson <arichardson.kde@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-10 00:48:07 +01:00
Eirik Aavitsland
191ac31598 Modernize shapedclock example
Relying on the hard clipping of QRegion widget masks to create
non-rectangular windows is a solution from a bygone era. The result
looks horrible with today's eyes, particularly on a high-dpi
screen. Update the example to create smooth anti-aliased edges using
translucent window bacground.

Task-number: QTBUG-64229
Change-Id: I8859d61177d2a2dc446632c23f27f42050e0d7c7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-12-10 00:38:40 +01:00
Eirik Aavitsland
03dc30acca Fix QPushButton style sheet style for overlay (content) image
Unlike comparable widgets like QLabel or QFrame, QPushButton would not
render a content image specified in the stylesheet, unless a border
style was also specified. Fix by explicitly rendering the content
image, if set, in the native-border codepath also.

Although the doc warns about the QPushButton border style having to be
set in order for the background styling to take effect (since the
native border painting otherwise hides it), the previous behavior does
seem unexpected.

Fixes: QTBUG-72029
Change-Id: I8b979b010515dab4dcf2f00344a187c87eeec096
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-12-10 00:38:39 +01:00
Edward Welbourne
f16bd40189 Convert some uses of QStringRef to QStringView
There remain QStringRef uses where QString::splitRef() is used.
Requires converting some .count()s to .size()s, as QStringView lacks count();
and some .toInt()s need to be handled by QLocale::c().

Change-Id: If9a49e063d217671ea9335a82e4bf977b7b48be0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-09 19:48:07 +01:00
Edward Welbourne
8310981b80 Prefer QDate::startOfDay() over QDateTime(const QDate &)
The latter can be invalid if midnight is skipped by a spring-forward.

Change-Id: Ibf98d165557229f19622774ebf9a27bb0911c7a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-09 19:47:55 +01:00
Christian Ehrlicher
c27123d743 QAbstractItemView: add a note about ToolTipRole in dataChanged()
Qt::ToolTipRole is not honored by dataChanged() which may be a little
bit surprising. Therefore add a small note about this behavior.

Fixes: QTBUG-78726
Change-Id: Ic4361f55e55ab59d5bae2fdb98907a62055604c5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-12-09 18:49:53 +01:00
Christian Ehrlicher
46d21a3b34 QPushButton: fix icon + text layouting in RTL mode
The fusion style did not properly handle the text layouting for a
QPushButton in RTL mode. Also the menu indicator was not adjusted in
this case.
Fix it by calling the base class implementation as QCommonStyle does it
mostly right. Since Fusion does not handle State_On or State_Sunken but
QCommonStyle does, explicitly mask them out.

Fixes: QTBUG-80083
Change-Id: Ide7bf997b4f4a5b61fcb8ea4a1a152122daef1e2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-12-09 18:47:46 +01:00
Christian Ehrlicher
9608e996a2 QAIV::sizeHintForIndex: return correct size when no delegate is set
QAIV::sizeHintForIndex checks if a delegate is set for this view but
does not check if there are row/column delegates which may be
appropriate for this task.
Fix it by retrieving the correct delegate directly with
delegateForIndex().

Change-Id: I264359b12e1983aab3a917db7dbcab11253a448f
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-12-09 18:46:19 +01:00
Joerg Bornemann
485e4a8f0b WebAssembly: Do not use sed directly for wasm_shell.html deployment
Use $$QMAKE_STREAM_EDITOR, instead, which will on Windows expand
to "qmake -install sed" (triggering qmake's own sed implementation)
and otherwise expand to "sed".

Change-Id: I57da5fb3a4f6e5a09ae25c947caa0a10d279b480
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-09 17:49:19 +01:00
Volker Hilsheimer
baed8534bc Move the tooltip out of the way of very large mouse cursors
Users that have large mouse pointers configured in their settings
can not see tooltips, as they are obscured by the pointer.
Native applications on Windows and macOS have the same problem,
which includes the tooltips for the minimize/maximize/close controls
in the window frame of e.g. Explorer.

Introduce QPlatformCursor::size that returns a value that is based
on the user's settings, or a default value. We can then use that
value to move the tooltip out of the way.

On Windows, the calculation of the cursor size is based on
experimenting with the settings, which are in logical independent
pixels. The placement of the tooltip attempts to keep existing
behavior, and to not end up with a tooltip that's very far away
from the tip of the arrow even for very large mouse cursors.

[ChangeLog][QtWidgets][QToolTip] Make sure that the tooltip
is not obscured by very large mouse pointers on Windows and macOS.

Change-Id: I8e13b7a166bfe8b59cef4765c950f90fefeaef9d
Fixes: QTBUG-79627
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-12-09 17:43:22 +01:00
Alexander Volkov
5272c35073 Doc: Clarify ownership of added menu for QMenuBar::addMenu(QMenu *)
Change-Id: Iaafba9557ece36607c86d5be4fbb5e4ac2e459d3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-12-09 19:43:22 +03:00
Alexander Volkov
8339ce2155 Avoid crash in menu that was previously shown as submenu
Reset sloppyState for the previous submenu, so that if it
will be shown as a menu, it will not use an incorrect pointer.

Fixes: QTBUG-80528
Change-Id: If2ba8c3a664983ee76eb90d2c9a8096e2bd0a4e6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-12-09 19:43:22 +03:00
Tor Arne Vestbø
009abcd7b6 QWidget: React to platform surface being created or destroyed
The platform window may create or destroy its surface from other entry
points than the QWidget API, in which case QWidget needs to sync up
its own state to match. In particular WA_WState_Created and the winId
needs to be recomputed.

Fixes: QTBUG-69289
Fixes: QTBUG-77350
Change-Id: I769e58ead3c2efcf8c451c363108848feade9388
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-12-09 17:43:22 +01:00
James McDonnell
e0a43e348c Register the screen pulse event
Future versions of QNX will, by default, require the use of registered
events. Currently, event registration is supported but optional.

Change-Id: Ie45484d5ca9fa832a28ccf08cb1764cf24262dcc
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2019-12-09 11:43:22 -05:00
Laszlo Agocs
7be4bbcbc5 rhi: metal: Do not fail pipeline creation upon compiler warnings
Change-Id: I39384de56d74cf9f1d345a5d395cc07030c6a2ab
Fixes: QTBUG-80629
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-12-09 17:43:22 +01:00
Allan Sandfeld Jensen
4d391514b0 Fix crash on debug output of null QColorSpace
Change-Id: I7d1d20d7dc2c5ac10dbe8d0a0b4111e8198bfabf
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-12-09 10:32:29 +01:00
Qt Forward Merge Bot
bef74b6c3a Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
2019-12-09 10:16:01 +01:00
Christian Ehrlicher
10f39c908d PSQL: set correct empty QVariant in QPSQLResult::record()
Since the QSqlField used to retrieve the data is reused in the loop, the
default empty value of the QSqlField is not set for all except the first
field since it was implicitly set by QSqlField::setType() only when the
value is invalid. Therefore we have to call QSqlField::setValue()
directly.

Change-Id: I1d3abe4e3c46f6378f9ff25529a79bbe33bb7b74
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-12-09 06:32:39 +01:00
Lars Knoll
f8d2975b6a Use QString::DataPointer instead of QStringPrivate
Preparations to move QString over to use QArrayDataPointer instead
of it's own private struct.

Change-Id: I7796a595393394083f6a85863e3c710ebbdea149
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-08 21:51:39 +01:00
Lars Knoll
20041afe3b Use QArrayDataPointer to implement QByteArray
Change-Id: I2ee28023c2dea9fc3160400112c59a47566a4868
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 21:51:33 +01:00
Lars Knoll
8e34d49201 Use the QByteArray::DataPointer typedef instead of QByteArrayData
The goal here is to move things over to QArrayDataPointer. This prepares
for it.

Change-Id: I32f54a47594274799600c618f7341c200ceaa306
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 21:51:27 +01:00
Lars Knoll
8da5d35ae8 Fix out of bounds read in tst_qsqlquery
Change-Id: I87962a17b13d212fa7fcc30bcd40174f2a7cded0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-12-08 18:20:43 +01:00
Lars Knoll
063e39df13 Get rid of QCharRef and QByteRef
We already detach immediately since change
c2d2757bcc. That basically removes
the main purpose of having QChar/ByteRef, and we can just as well
get rid of those classes for Qt 6.

Change-Id: I8dc566a1948ddc29c0cb8a77ec7310654a7219a4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 18:20:38 +01:00
Thiago Macieira
7cc977759b Use <type_traits> to properly have QVector<T>::parameter_type
That allows us to pass by value for all fundamental and pointer types.

This requires some magic to remove methods taking a T&& to avoid
ambiguous overloads for QVector<int/qsizetype>. Remove them for all
cases where parameter_type is T, as copying or moving will do
exactly the same thing for those types.

Change-Id: I8133fecd3ac29bb8f6ae57376e680bc3d616afbf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 18:20:31 +01:00
Lars Knoll
db89349bdb Optimize QArrayDataOps::compare for primitive types
Change-Id: If726e3ee8a3635dcec2a316f1a829392de298634
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 18:20:24 +01:00
Thiago Macieira
f247e94b51 Enlarge QVariant's private to fit the new QString and QByteArray
Change-Id: I8baecd0a4db13200b34cdd7c8aebc2a1cc0a0c75
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 18:20:17 +01:00
Thiago Macieira
eab6eb64d2 Final removal of the size and offset members from QArrayData
Those members are not required anymore and now part of the
object itself.

Change-Id: If9eb5355ca8f2cf9528f6f63ca4e172acc9f9aed
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 18:20:11 +01:00
Thiago Macieira
00fbc087dd Inline the size and data pointers in QByteArray
Change-Id: I82feeb2c9bd2900f421fc0c8d78698b1e83db043
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 18:20:04 +01:00
Lars Knoll
e58b44d557 Change representation of string data in the meta object
Don't store our string data as QByteArrayLiterals anymore, but revert
back to simply storing them as an array of char* and offsets into that
array.

This is required to be able to inline size and begin into QByteArray
itself. Once that change is done, we can then avoid creating copies of
the string data again.

Change-Id: I362a54581caefdb1b3da4a7ab922d37e2e63dc02
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 18:19:58 +01:00
Thiago Macieira
746ab4bbd6 Inline the size and data pointer members in QString
I'd have preferred to use QArrayDataPointer<ushort> for QString, but
that option wasn't the best one. QArrayDataPointer try to do some
operations using QArrayDataOps and that would expand to unnecessary
code. What's more, the existing code expected to be able to modify and
access the d pointer.

Instead, this commit introduces QStringPrivate (named differently from
QStringData to catch potential users), which contains the three
members. This POD class is also used in QJsonValue to store the
"inlined" QString. QHashedString in qtdeclarative will need a similar
solution.

Change-Id: I33f072158e6e2cd031d4d2ffc81f4a8dbaf4e616
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-12-08 18:19:50 +01:00