These are all error conditions, and should not happen in practice.
Naturally, there's no savings in executable size, because the
compiler just shuffles the layout of the branches around.
Change-Id: I52b98cc696fd808735c7d73c1f21e02478ff4f5a
Reviewed-by: David Faure <david.faure@kdab.com>
... by centralizing the common part of repeated qWarnings() in a single
function, passing the variable part through %s.
Change-Id: I114d10f41d4b0bbf59ef87f75308dc5b3ccd3967
Reviewed-by: David Faure <david.faure@kdab.com>
The integration, screen, window and cursor classes were split in Qt 5.3 under a plan
of sharing these between eglfs, the Android port and potentially other future plugins.
This never materialized.
Maintaining the artificial split is getting difficult and is prone to errors. Therefore
it is time to merge back these base classes into eglfs. The result is cleaner, smaller,
and potentially better performing code. eglconvenience is now restored to be a collection
of convenience classes instead of platform plugin bits.
Change-Id: I75c6ad876ef66a1a0c5b39c1c307f928d2ed47d4
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
[ChangeLog][QtCore][Logging] QT_LOGGING_RULES now supports multiple
rules separated by semicolons
Change-Id: I7fdd62a3d719aeb16cad54f193befb6c203bc160
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Use segmentCount() and segmentAt() instead of going to m_segments. This
is done in preparation for a major refactor of QVersionNumber that will
store the version numbers in the object itself, without QVector.
Change-Id: I03dbdee59a3c74c21a0a4e70c1bb9182250f6223
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Commit ffcad3244f did that for the GCC-
compat mode, but I forgot the MSVC one.
Change-Id: Ib1d49f003062638b4e27e5ead4554e25f539c373
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Like on OS X and Linux, ICC uses the native compiler's standard library
headers, so the C++11 features that depend on headers need special
attention.
* <initializer_list> is missing with MSVC 2012. It is present on 2010
for some reason and it appears to work
* ICC disables Unicode string support prior to MSVC 2015, probably
because MSVC Standard Library headers have a typedef for char16_t
std::nullptr and std::move should have come with MSVC 2010, but I'm not
keeping compatibility with MSVC 2008. It's been deprecated since ICC
14.0 (Composer XE 2013 SP1, released in 2013) and support was removed in
15.0 (Composer XE 2015, released in 2014). ICC hasn't supported MSVC
2005 since ICC 13.0 (Composer XE 2013).
Task-number: QTBUG-47119
Change-Id: Ib306f8f647014b399b87ffff13f139174aeeafff
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
An object that throws in its constructor cannot be reentered. This
violates both C++11 and C++98. It's also a regression from MSVC 2013.
The unit test is renamed to indicate what it really does, as opposed to
a misleading name that was probably a "thinko" on my part.
Task-number: QTBUG-47224
Change-Id: Ib306f8f647014b399b87ffff13f132436d0578ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Define both qHash() and operator==() outside of the class, like
it is already done for operator!=(). Defining it inside the
class limits it to argument-dependent lookup, which in turn
means that the lookup rules for operator!= and operator==
were slightly different (e.g. if one would compare variables
of a type that is implicitly convertible to QSslEllipticCurve).
As a side-effect, this also fixes a qdoc warning.
Change-Id: I40ab2f8cd2b6b5f42481dd254229a88b678f3f15
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Any function using the non-dsa helpers and glTextureParameterf() would
crash as this code path failed to initialize the function pointers.
Task-number: QTBUG-47133
Change-Id: I8970c9693ec471a96b135ae5728ab6407ee06a6f
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This improves SecureTransport logging consistency:
- include error code in SSL error when a native backend call fails
- use qt.network.ssl category for debug / warning messages
- do not use duplicate qWarning when error is already reported via QSslError
Change-Id: I52d457b11f0cef2cc3579305e457663b61b92f3f
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
We use menus to implement the ComboBox popup in QtQuick Controls,
and therefore, all the items are actual menu items. If that's the
case, we can skip the new style background.
Task-number: QTBUG-47084
Change-Id: If46ebf8115b36f45b4b5e6068ddc0d61afe307b8
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The ldrexd and strexd instructions require 64-bit alignment, but Clang
for iOS aligns those types on 32-bit boundaries inside structures. We
can't use Q_ALIGNOF because it returns the alignment for the type inside
a structure.
Task-number: QTBUG-46949
Change-Id: Ib056b47dde3341ef9a52ffff13ef17bede0846f2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Commit 5d366f7e was not correct. The time displayed would always be the
same (the start time of the application).
[ChangeLog][QtCore][Logging framework] Fixed a bug that would cause a
"%{time boot}" field in the logging framework's pattern to always
display the same value, instead of the time since boot.
Change-Id: I255870833a024a36adf6ffff13ecb1dca4a688ed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Somehow the const int is no longer understood to be an immediate. GCC
4.8 still compiles this fine.
qstring.cpp:316:34: error: the fifth argument must be an 8-bit immediate
Change-Id: Ib056b47dde3341ef9a52ffff13ef24d541833abc
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QTemporaryFileEngine does not store the pattern, so it needs to get it
again from QTemporaryFilePrivate prior to reopening the file. It's
possible to lose the pattern when remove() is called on the object.
Task-number: QTBUG-46156
Change-Id: I66a35ce5f88941f29aa6ffff13dfc7f83d4fa3a2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: David Faure <david.faure@kdab.com>
I can't find the function for NetBSD and OpenBSD. There's a good chance
QtCore simply fails to compile.
Change-Id: Ib056b47dde3341ef9a52ffff13efaff642bd7bb9
Link: http://www.freebsd.org/cgi/man.cgi?query=kinfo_getproc
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In the common case, macroExpandIdentifier was called in the
"not a macro" case, and a temporary vector with a single item was
allocated. Now, we catch this common case at the caller site
and put the single item directly into the result set, bypassing
the temporary list.
Change-Id: I71d92afc486ccdaae5930405d028f53f48073b8c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
[OS X] Mangle the event handle related calls on QNSApplication, so that
the events are passed through the correct QApplications when several
Qt5's with different namespaces do UI in the same process.
Change-Id: Ibb44246fbcf4a2bc3af5a93c48db0382a1380328
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Since findAllLibSsl() and findAllLibCrypto() differ only in the
filter passed to QDir::entryList(), so Extract Method findAllLibs().
In the new function, cache the filters QStringList instead of re-create
it in every loop iteration.
Change-Id: I1bdd05e83fa1f9bb3f47b9b2ae5da9654ec1525b
Reviewed-by: Richard J. Moore <rich@kde.org>
It prevents the compiler from synthesizing move assignment
and move constructor.
Change-Id: I864d143d5a6233e45f3f2fc343a147db89559f33
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
ItemDecoration is larger than a void*, so holding it in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.
Fix by marking the type movable and holding in QVector instead.
Change-Id: I06d7a77529f7cff2ba503c5e8d6e5df0ad801a21
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
They are held in Qt containers or QVariant.
Change-Id: Ida1b904120d4fb53a5596f1c3cbc973bd2ca315e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Previously, a temporary list was allocated and then fed into the
bigger list of results. Now, we push data into the final list
directly, removing the overhead of the temporary allocation.
Change-Id: I9bea0fd3c23b1434b4be2728c60ac22a66908efc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
In cause of doubt this is more efficient, see
https://isocpp.org/wiki/faq/ctors#init-lists
This also fixes the initialization order to match the declarartion order
of the variables in the class which some versions of GCC otherwise would
complain about.
Change-Id: I642f7156d624c2c65f2f3525d813f5289c092f96
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Return true from isArgvModified() when __argv is null (as is the
case when using wmain()) indicating arguments are modified.
Task-number: QTBUG-47023
Task-number: QTBUG-30330
Change-Id: I44329ed3369cd4db79ba1b7c19303895f67b1616
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Currently when the remote server disconnects gracefully (for example upon
returning an HTTP request with Connection: close) the call to SSLRead
will return errSSLCloseGraceful which is incorrectly reported as
QAbstractSocket::SslInternalError.
This patch aligns the behavior with that of the OpenSSL backend and instead
reports QAbstractSocket::RemoteHostClosedError.
Change-Id: I8c6679280ac0c6fbd71d5f0d29b25f692eca5b24
Task-number: QTBUG-47154
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
The first change is to make libGreaterThan a function object.
This allows all compilers to inline the comparison into the
sort implementation.
The second change is to use QString::splitRef instead of
QString::split to extract the components.
The third is to extract the element comparison into a
function object and replace the rest of libGreaterThan
with a suitable call to std::lexicographical_compare,
rendering most code comments (present or missing) moot.
Change-Id: I3a761d721aa7cf5fa727dcc4ddca4b922f413899
Reviewed-by: Richard J. Moore <rich@kde.org>
This allows the compiler to inline the function call into the
std::sort instantiation.
Change-Id: If2b948c1d7202d6a81afd8a58cc9fab50a9709c1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
SideWidgetEntry is larger than a void*, so holding it in QList
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.
Fix by marking it movable, and holding in a QVector instead.
Change-Id: Ia87b9ac634ad9386bc667355e6e236bc3d56ab29
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QItemViewPaintPair is larger than a void*, so holding it in QList
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.
Fix by holding in a QVector instead (was already marked movable
as a QPair of movable types).
Change-Id: I6f4042d2df306ecf0ec576ecbc6678736268014e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
ExtraStruct is larger than a void*, so holding it in QList
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.
Fix by marking it movable, and holding in a QVector instead.
Change-Id: I02f2089859c2deccf0e6c451bf80da07893cc3f0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QPointer is larger than a void*, so holding them in a QList is needlessly
inefficient. Worse, the code could come to depend on the fragile property
of (inefficient) QLists that references to elements therein never are
invalidated.
Change-Id: Ia224a4fe01acc1d4ca9b57c62941dd0f37780c67
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Q(Multi)Map::keys() returns duplicated keys, so keys().size() will
always be the same as the map's size().
So use that directly instead of creating temporary QLists to check
the size.
Change-Id: I0600d1845e25be3b825e4ae470c1ef41a3a5d2c9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QModifKeyName is larger than a pointer, so holding it
in a QList is horribly inefficient.
Fix by marking it movable and using QVector instead.
The logic for filling the lists-turned-vectors is a bit
fishy in that it is not thread-safe. Maybe it doesn't
have to, it's not marked as \reentrant.
Change-Id: I8421e6d8b980eff022badfe3c61b3537783b5cfa
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
ints are only half the size of void* on 64-bit, so
QVector<int> uses only 50% of per-element memory,
compared to a QList.
Change-Id: I18db97d2ec0e46ec4301e8939ac21dff558172b2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QPropertyAssignment is larger as a void*, and wasn't marked as
movable, so QList<QPropertyAssignment> is horribly inefficient.
Fix by marking it movable and using a QVector.
Change-Id: I34e21e3f28f64dd8b187c144fb5bee022414216b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
All values in the table fit into 8 bits, so don't use a
16-bit type.
Change-Id: I685727e16a264a49ea501d36eb6815c6d5aaa9b2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The MaxKeyCount symbolic constant was introduced for use by QKeySequenceEdit,
but never applied to QKeySequence itself. To prevent the two from getting
out of sync, use it in the QKeySequence implementation itself, too.
This required re-writing most expressions involving QKeySequenceEditPrivate::keys
with algorithms, but we already determined in the discussion around 1cf9a139
that GCC generates the same code as the loops unrolled by hand, and if Clang
doesn't, it's its own fault.
Where using MaxKeysCount was not possible, e.g. in documentation,
static_asserts were used to indicate the need for manual changes.
Change-Id: I559fffdfd552d488448ba4a5a1ac10708c16a2ae
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>