By adding std::move where it makes sense.
This is not only good for move-only types, but for any type which
can be moved as it saves copies of the return value in any case.
[ChangeLog][moc] Move-only types are now supported as return types
of signals and slots.
Change-Id: Idc9453af993e7574a6bddd4a87210eddd3da48a9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The xpm handler did not properly check that the information read from
the file header was sane.
Task-number: QTBUG-59211
Change-Id: I84099777a16b2b0c473d139f5fdec1d0cb5d515e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
We can add basic constructors now on all supported platforms, and can
make initialization consistent on all platforms, choosing undefined
as the default.
Note this changes behavior on gcc and clang builds, but is consistent
with pre-c++11 gcc and clang builds and with msvc.
[ChangeLog][QtGui][QRgba64] The default constructor on Clang and GCC
builds now no longer initializes with 0s, but leaves the value
uninitialized. This is consistent with MSVC behavior and pre-C++11
behavior of GCC and Clang.
Change-Id: Ib0e3d7f4274a13a768db62931b67877e3898945e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Even if it is normaly not used, templated code might still try to access it
Task-number: QTBUG-59414
Change-Id: I9f7aadd714843059c8f89cdac48c60a3e2ca7294
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Cross-compilation on linux with mingw-w64 failed, since it provides
all libraries in lowercase name.
Change-Id: I8e82a4504d4ec9d3047af6b1d6a11945754f182d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The code compared a QString* with a QString, which only compiled
because the QStringRef(const QString*) ctor was implicit. We're going
to fix that, and it's nice to see that the change exposes bugs like
this one.
The fix is to deref the QString* argument, which we know from previous
checks to be non-nullptr, to enable normal QString/QString comparison.
Change-Id: Idc7b214cb26e8b7c18ee1ba0a2b7236f814f0810
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Adding both development team and provisioning profile to Xcode
switches off the automatic signing
Task-number: QTBUG-38782
Change-Id: Ic869e16490c11e369b6674c815e860cac66c5afa
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
It's a Qt 3 compatibility vehicle, and as such inherits the now-alien
property to distinguish empty and null strings. Particularly worrisome
is the following asymmetry:
QString("") == QString::null // false
QString("") == QString(QString::null) // true
Instead of fixing this behavior, recognize that people might use it as
a weird way to call isNull(), albeit one that once was idiomatic, and
simply deprecate everything that deals with QString::null.
[ChangeLog][QtCore][QString] QString::null is now deprecated. When
used to construct a QString, use QString() instead. When used to
compare to a QString, replace with QString::isNull().
Change-Id: I9f7e84a92522c75666da15f49324c500ae93af42
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
A few small visual issues were introduced during recent QTabBar
restyling (see 175f33ed85)
Change-Id: Ifab8b9f24e2cad6e1a827b1061471882a1bc9f5e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This corrects an issue where the file system paths returned for some
QStandardPaths values on Apple Platforms would be URL encoded, for
example having %20 instead of an actual space character.
Task-number: QTBUG-59389
Change-Id: I771a44eb20b756842c324ac6fc9bdc475ce84826
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Stale Lock files in the future can happen in some situations. For exemple
two computers with different clocks access the same file system. It could
be that one of the timestamp is totaly off (several years into the future).
[ChangeLog][QtCore][QLockFile] Fixed a deadlock occurring if a corrupted
lock file's modification time is in the future.
Change-Id: I8dac98a0e898c76bcef67f8c195e126c996b6add
Reviewed-by: David Faure <david.faure@kdab.com>
Makes sure we don't use backslashes on Windows systems, which could lead
to the following warnings being emitted:
In file included from main.cpp:43:0:
repparser.h:2:10: warning: unknown escape sequence: '\.'
#line 57 "..\..\src\repparser\parser.g"
caused by lines like
#line 57 "..\..\src\\repparser\parser.g"
Change-Id: I6cfe0e39a2a58eb39f9d385ece30374bcfa09e05
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
GCC 4.8 seems to get the failure memory order wrong when using the
overload that only accepts one memory order and produces errors such
as:
bits/atomic_base.h:577:70: error: failure memory model cannot be stronger than success memory model for '__atomic_compare_exchange'
return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
^
(as seen on Android).
Fix by explicitly passing the failure orders corresponding to the
success orders, as specified by the standard:
relaxed → relaxed
release → relaxed
acquire → acquire
acq_rel → acquire
(cf. http://en.cppreference.com/w/cpp/atomic/atomic/compare_exchange).
Task-number: QTBUG-59399
Change-Id: If046e735888cf331d2d6506d8d5ca9aa7402f9ad
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
QSysInfo has a customized deprecation directive that QDoc needs to
ignore to generate documentation for the deprecated functionality.
Change-Id: I1c378f14a2f842f1e9a55614d43fe509bb77fd89
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
If a later month-or-day were to have a name that's a prefix of an
earlier one's name, the code would have selected the longer name as
best match when the text matched is the shorter name, simply because
it found that one first. (Found, on Turkish Cuma(rtesi)? in Thiago's
recent new test, by reversing the loop that iterated the list.)
Make an exact match win and a match of a full name beat any prefix
match of the same length.
Change-Id: I8d954b83ccc25e4f47af2e558036d714685cef5e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Decouple from the callers' offset into a larger list; just search for
an entry in a list, let the caller deal with the offset. Also, defer
a .tolower() to save the need to allocate a copy of each list entry.
Change-Id: I748d5214c2cc6dc592fe2bd41e3f8150f71c335b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit fb376e0fcc removed an array that
facilitated returning the names of built-in types, to avoid the jump tables
from the switch statement. This commit brings it back but makes the array a
compile-time constant string offset table.
The array is created by way of a set of C++11 constexpr functions, so we
require that compiler feature. I've tested that MSVC 2015 does support
it as well as the ICC 17 when masquerading as MSVC 2015, so I've enabled
for that too. The only compiler left out is MSVC 2013.
If we didn't need to support MSVC 2015, this could have been written
more simply with C++14 relaxed constexpr.
This also adds unit tests to confirm that QMetaType::typeName() does
return null when we said it would. We're testing QMetaType::User-1
(which we'll likely never use) and QMetaType::LastWidgetsType-1 to
select something inside the range of the built-in types.
Task-number: QTBUG-58851
Change-Id: I4139d5f93dcb4b429ae9fffd14a33982891e2ac1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Since QPrinter can be used to write to PDF and this was working in
previous versions, there is no reason not to enable it here.
Task-number: QTBUG-58376
Change-Id: I5760b74881995679e8df657b7d770bba00a33551
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
[ChangeLog][moc] Added Support for C++17 nested namespaces
Change-Id: Ib83fc5bf48f66546fa97b49710582fbf9c984503
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Simplifies everything and avoids bugfixes in one not propagating to the
other.
Change-Id: I95c9e502ccc74af3bcf0fffd14a69f0cde60cc8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Both SPDY and HTTP/2 work with a single qhttpnetworkchannel (and this means one
socket per qhttpnetworkconnection). Normally, HTTP/1.1 connection is using up to 6
channels/sockets though. At the moment a failure to negotiate SPDY/HTTP/2 leaves us
with a downgraded HTTP/1.1 connection (with only one channel vs. default 6).
Since we initialize channels (and establish connections) in a 'lazy' manner
it's ok to pre-allocate all 6 channels and then either use 1 (if SPDY/HTTP/2
indeed was negotiated) or switch back to 6 in case of failure.
Change-Id: Ia6c3061463c4d634aaed05ce0dde47bfb5e24dd8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
warning: Can't link to 'controlType()'
warning: Can't link to 'horizontalPolicy()'
warning: Can't link to 'verticalPolicy()'
Change-Id: I6b31acebf183defee7b4ab36976034ed4a3fc98a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Like in other functions, allocate arrays of quint64 instead of QRgba64
to avoid the cost of initializing large arrays on every small scanline.
Change-Id: Ie132b3157003a18a444ca5c4f94ae668d17327fd
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
As pointed out in the previous code-review:
Replace a bool ctor parameter with QFlags<enum> to conform to
Qt API Design Principles (Boolean Parameter Trap).
Since the bool with its many unwanted implicit conversions is
gone from the ctor parameter list now, drop the explicit
keyword again. It was requested because of the boolean parameter
in the first place.
Change-Id: Ibaf287a6a3e38c22f033fd5d9e024c54f30a1fd4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
QWindowsWindow::handleResized would call isFullScreen_sys which checks
if the window's screen geometry matches the one of the window. When
switching back from fullscreen, Windows will have set the geometry to
fill the next window, but we don't switch QScreen until later in that
function, inside handleGeometryChange. This would result in our window
to take the whole screen geometry, but the FullScreen state wouldn't
be transferred to the new screen.
Fix the issue by using screenForGeometry and check if we are fullscreen
on any screen.
Also make sure that we check the validity of m_savedFrameGeometry when
restoring after a screen remove, since we would previously restore to an
area not covered by any screen anymore.
Change-Id: I43bc02738007918e9a26c1d27a699c51d3365034
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This patch fixes the example that contained problems showing up
with mesa/nouveau drivers.
Change-Id: Ic90f6028e394138781f00bcc00c145c56134f441
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
The base implementation takes care of updating visibility and emitting
signals.
Task-number: QTBUG-59313
Change-Id: I270b37c894420902488d89dc0c79f4c12b8d9a29
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
... as a replacement for two QPairs and move some common
QFont/QPalette functionality into it.
Change-Id: Iaab92130dd54eaa7900ac2048014a80cbd04bfb6
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Some were 5s, others 1s. Pick one (the higher).
Change-Id: I81929d4f49c2e41b4d4b75c3e2bf8ff75af868ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Let's take the beginning of the description: WaitForSingleObjectEx can
be up to 16 milliseconds early. This is proven by the fact that there
are tests doing:
wait(waitTime);
QVERIFY(timer.elapsed() >= waitTime - systemTimersResolution);
and failing.
Task-number: QTBUG-59337
Change-Id: Iae839f6a131a4f0784bffffd14a9a79523d69d94
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Update the treemodelcompleter example to use the new QRegularExpression
class in place of the deprecated QRegExp.
Change-Id: I9fa91ca6e847603de37019e4ca86fc69a51a3772
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
The example creates a view on the heap but doesn't delete it on
application end. This patch uses a QScopedPointer to fix that.
Change-Id: I3b0c8589999d243c193bd02e1470c03eabfabe40
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
By default, it enabled only for Gnome
Task-number: QTBUG-59298
Change-Id: Ib44f52b3175ed1904f24ec9e21f00ea3f3334287
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Call sites of NmakeMakefileGenerator::writeResponseFileFiles expect that
the output is terminated with '\n'. Do not bail out if files is empty.
Task-number: QTBUG-59305
Change-Id: Id3fef8dbc506dad1868e6b352119f5f27b50a368
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
When the insertion into the cache fails then it will delete the entry
for us which already calls releaseKey(). So we should not call it a
second time.
Task-number: QTBUG-58259
Change-Id: I816c6f29ef97fe3a245f145c4faf1e0649f72dc5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Lambda functions provide all the benefits of std::bind() plus more
Change-Id: Iec30b20bb35ac0fae560435b323f80af2f2e5fce
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It is ignored (and is unnecessary to begin with) in that case,
and emits an annoying warning which this patch silences.
Change-Id: I6059969724b203d6e0e2eea81ad3e3e8f8d536d6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>