Remove incorrect read from QSslSocket::readData()

QIODevice makes readData() call only when its read buffer is empty.
Also data argument points to the user or reserved read buffer area.
So, no need in data transfer from read buffer at this point at all.

Change-Id: Ieb4afdf7eec37fdf288073e4a060e64424f22b9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QTextStream: add fast path for writing char and QChar.

Avoids allocating a QString for every char being written out.
The benchmark went from 5.5 ms per iteration to 0.8 ms,
and from 40 million instructions to 6 million.

Found using Milian Wolff's heaptrack tool.

Change-Id: I1784c47b944454bc947a607a22c39d249372ed55
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
QAbstractItemView: add iconSizeChanged signal.

This is useful when writing a generic preview-icon-generator which
should work with different type of views, itemviews and QML views.
A way to be notified of a change of icon size was missing on the itemview side.

[ChangeLog][QtWidgets][QAbstractItemView] Added iconSizeChanged signal.

Change-Id: I19b3049961002ca27d71aefbb6980d1e6f225c79
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
QRegularExpression: more QStringRef tests

So far we've only tested matching against QStringRefs which were
spanning the entire underlying QString. Instead, use the offset
matching to also perform tests using "proper" substrings.

Change-Id: Ia66e23f738b52997311ed2cf869e595079984292
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Add qEnvironmentVariableIntValue()

A lot of code in Qt uses VAR=1 for enabling or disabling some feature
or other, ignoring qEnvironmentVariableIsSet(), which was added for
that purpose. Other code actually reads numerical values from
environment variables. For both use-cases, provide a non-throwing,
non-memory-allocating way to get the numerical (int) value of an
environment variable, complementing qEnvironmentVariableIs{Set,Empty}().

[ChangeLog][QtCore] Added qEnvironmentVariableIntValue().

Change-Id: I81c85287ea10d355c1bbf8d7807ec9a0e477bce0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QLibrary: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I8d440619edfbd90045564e1f92676f1e1f87e136
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QLibrary: simplify qt_debug_component()

Instead of initializing debug_env to -1 (thus forcing the variable
into the data segment), and then overwriting the -1 with a read
from the env-var, dynamically initialize the variable from the
env-var directly, thus allowing the variable back into the bss
segment (which doesn't occupy storage in the executable).

There may have been a reason to do it this way when the old code
could fail due to the memory allocation involved, but now with
qEnvironmentVariableIntValue(), that is no longer a reason.

Change-Id: I9f21b0783ff348f50b574395fc07f2869a14102e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QPainter: use qDeleteAll()

Change-Id: I167e4d7a57e92eb5ea7c39b04246ac2f44c91de0
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
QPainter: drop a pointless check

There's no need to check for nullptr before invoking delete.

Change-Id: Ied751f76f15f390bf86bbba53c14a3e450aa81e8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
QHash: remove unnecessary #ifdef

There's no need to use a macro here, since we can just store
the pointer value in a qulonglong and have the second shift
operation be done unconditionally. For 32-bit platforms, it
will yield 0, and xor'ing it into 'seed' will have no effect.

Change-Id: I3e63bd504e81c84d13935d5503c3707d40d74d6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QPainter: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Ie41b95c09f2c6106a6683ba4637513c974555840
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
eglconvenience: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Id50609c1f3511287d99e24b03e48c0a254893194
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
QFbVtHandler: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I18c00da9504dd3744e6fbb23ea9b9fb7c6d669c9
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
QEvDevTouch: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I64de0b2644c50469a35fdba9ecde167862975b79
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Android: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I6d79852613228658f9093a272edf9b434e60286c
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
eglfs: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I4c43809954ed720de95b3056c13bf520577e3280
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
QKmsScreen: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Iaaba62396de2d70f611bfa2ba5badb070087fa24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
QMinimalIntegration: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Idaad6ec1d92d9aa58d61e2d98e136f108be2bb4c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
QNX: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I211d6de32da06bf465c4f721f39d73289206745f
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
WinRT: use qEnvironmentVariableIntValue()

It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I73d548ad4e25424fc41722961f527e63632a7b56
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>