Replace outdated LGPL21 with LGPL license header.
Use GPL-EXCEPT for all autotests.
Also use canonical contact url.
Change-Id: I6e5cc8a4285569c4f862730a980f492b8a933a72
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Change-Id: I34821150f66255df30d12572b27779e0e729ebc8
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The FP16 extension in IEEE mode is mandatory for Aarch64, so there is
no aarch64 configuration where the tables will be needed for conversion.
Change-Id: I9804e55c193cc9b5adcaedb720d8b980624139cc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Glen Mabey <Glen.Mabey@swri.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The implementation now uses the relaxed-constexpr
qCountTrailingZeroBits() function from QtAlgorithms, making the
QSizePolicy(Policy, Policy, ControlType) constructor constexpr on
C++14 compilers. The explicit check for DefaultType remains to keep
the constructor C++11-constexpr when called with just (Policy,
Policy).
Extend the constExpr tests a bit.
Change-Id: I59690f0921d9bdee08e3615d0d1f4a9b92870c32
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Even though we revoke its Q_COMPILER_UNIFORM_INIT for certain bugs
that affect existing usage in Qt, it turns out that MSVC 2013 supports
enough of braced initialization to make the macro magic in
Bits::transformed() moot.
Change-Id: I824d7fa298a2b95b4ad45c9e259e91c5ececfc0c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This was a mistake in cb37ab8298
Change-Id: I5897ceb34ab4aa1655efd20697d0e761cf7796b1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Use Q_RELOCATABLE_TYPE now that we have it.
Change-Id: I04bb946695ebb9f0899bb73becbef301805389ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Embeddeding a QWindow via QWidget::createWindowContainer() fails to
deliver the SurfaceAboutToBeDestroyed event. This breaks any OpenGL
or Vulkan based QWindow that releases resources upon this event, and
is particularly critical with Vulkan where the only way to do properly
ordered swapchain - surface cleanup is via this event.
In the non-embedded case close() eventually ends up in an explicit
destroy() in QWindow. In the embedded case destroy() only gets called
from ~QWindow. This then silently breaks since the subclass' reimplemented
event() virtual is not getting called anymore.
To remedy the problem, simply add an explicit destroy() to
QWindowContainer.
Task-number: QTBUG-55166
Change-Id: I1671e8f4d39f6c44e19eca7b9387f55fe3788294
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Improves performance when appending temporaries, esp. since
the aliasing fix in the lvalue overload in 0f730ef made that
overload correct, but a bit slower across reallocs.
The unit tests already also pass rvalues, so the function is
covered in the existing tests.
[ChangeLog][QtCore][QVarLengthArray] Added rvalue overloads
of append() and push_back().
Change-Id: If3a6970f03a160cba5b42d33d32d3d18948f6ce3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We always send mouse move events through the application event filters
even if the widget has no mouse tracking enabled. This code portion is
an almost verbatim copy of QCoreApplicationPrivate::sendThroughApplicationEventFilters().
The only difference is that previously the filter and the widget had
to be in the same thread. Now, we compare the filter's thread to the
application's. This is without consequence since widgets must live in
the application thread.
Change-Id: Ifee9c041e06d80ea0c2d2a947231e58ee4dfa24d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
A QDockWidgetItem will be leaked if a QDockWidget is dragged out of a
floating tab window, and then plugged back somewhere.
The problem is that QMainWindowLayout::unplug was not returning the
QDockWidgetItem* from the floating tab's layout. When that's the case,
a new QDockWidgetItem is created in QDockWidgetPrivate::startDrag
and will be put into the layout, leaking the old QDockWidgetItem.
Change-Id: Ifb9c1c562cb74383ebff1df0f91ee225c5cdb296
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Replace an array of pairs of pointers with an array of pairs of
arrays. Remove the unused end marker. Add a static_assert to
verify that the size of the array matches the constant all loops
use.
Also extract the common part of the mime-type name and append it when
building a QByteArray from it. This is free, as both the new
QStringBuilder expression as well as the old construction from a const
char * incur one memory allocation each.
Replace one indexed loop with ranged-for.
Results on optimized GCC 6.1.1 Linux AMD64 builds:
text -96B
data -160B
relocs -16
Change-Id: Ic23eb06bacbf70afb6f60e2fb8a140bdd3880aca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Turn arrays of pointers into arrays of arrays.
Results on optimized GCC 6.1.1 Linux AMD64 builds:
text -264B
data -512B
relocs -43
Change-Id: I0b64615913d50c286596e66675e89758ce1ec2ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove the dead QByteArray(data, size) fall-back. We've been
requiring lambdas since Qt 5.7.
Change-Id: I4d9023ab4583f2ee80a74a828fba0d95c2fdb0df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of contains()/value()/remove(), all of which perform a new
lookup, and a new application of qHash(), get an iterator using
find(), deref it, then pass it to erase().
Also add some optimistic std::move().
Change-Id: I27a623dcd974de9c67d11d030e9b98d7598efc93
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Instead of the incomprehensible "names" .first and .second, the code
can now use .index and .path.
Change-Id: I1449ba668f703b9a8b9391b0a0774072c8c6e8aa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Fix a couple incorrect references to the integer precision classes.
Update snippet to use floating point precision classes.
Task-number: QTBUG-51630
Change-Id: I9b08cfb68937a8e1179ee414d7981956ef7bc106
Reviewed-by: Martin Koller <kollix@aon.at>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The call to trimmed() makes sense for URLs typed in a browser's location bar,
but its use in every code path made it impossible to open a file with a trailing
space in command-line tools that uses fromUserInput(cwd) to handle command-line
arguments, as recommended. For instance kde-open5 "file.txt " would fail.
Change-Id: Ie61182684521d91f077d3e76f95b7240965ab405
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This allows to test specific filenames without polluting the current dir.
Change-Id: Ieb99019a2e37e30f294d85c5d80af1de1b919019
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
operator=, which was only used for clearing, wasn't clearing the hash.
This led to a mismatch between the vector and the hash (given that the hash
points into the vector).
Spotted by interrupting kmail in gdb, and it was in this code
iterating over a 2000 entries hash (the first vector entries not matching
the hash, this code keep appending new entries for the same formats).
This fixes QTBUG-8862 again, the initial fix having been accidentally
reverted in 467b15a.
Change-Id: Ia34b3d002a0199e1930431a4bbdb2ec981ed4ffc
Task-number: QTBUG-8862
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This is mostly straight-forward, but some things are worth noting:
1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
not at the contents of the function to determine whether to return true.
The more conditionally-noexcept functions are used, the more important it
becomes that low-level classes are correctly marked noexcept. In that, it
is like constexpr.
2. In accordance with the rules governing noexcept specifications for the
standard library itself, the set*Stretch() functions are not marked as
noexcept, since they have preconditions and thus a narrow contract.
Narrow-contract functions should not be noexcept. All other functions
have wide contracts (ie. no preconditions).
Change-Id: I853e0fc2d98cf3fcb16402a18ab136cccca24d89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The default query type for QNetworkProxyQuery is TcpSocket (that's what
our QNetworkProxy::applicationProxy() requests). Unfortunately, this
can result in http_proxy found and QTcpServer::listen() failing
(probably, QUdpSocket is also affected). So now we extract applicationProxy's
logic but modify it to provide the exact query type we need.
Task-number: QTBUG-58706
Task-number: QTBUG-41053
Task-number: QTBUG-58374
Change-Id: I79ce0efb779bbaf08afd78c44cbe92d08730152b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As recommended in API review: use 'is...STS...Enabled' and 'set...STS..Enabled(bool)'
function names instead of stsEnabled and separate enable/disable functions.
Replace QList with QVector in the public API.
Change-Id: I1526124c830450058967ebc192d27575cc89292d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Ensure that tablet moves are delivered iff tabletTracking is true.
Task-number: QTBUG-26116
Change-Id: Iaa360e181f0c6484cfbde6fa5365f2f0dc77433a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
It's only used in the autotests, and it private API, so
downgrade from Q_CORE_EXPORT to Q_AUTOTEST_EXPORT.
Fix a use of QTimeZonePrivate functions unprotected by
QT_BUILD_INTERNAL in tst_qtimezone.cpp.
Change-Id: I70eaea06f8fcf2983aeafb6894c3a5d2a4b272a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This adds the tabletTracking property in the same way that mouseTracking already
existed: there is a WA_TabletTracking attribute, and a TabletTrackingChange event
to notify when it changes. So for widget applications it's an opt-in feature.
QtQuick applications don't yet make use of tablet events, but when they do
in the future, we don't yet have a mechanism to turn the move events off;
it remains to be seen whether that will be necessary.
[ChangeLog][QtWidget] QWidget now has a tabletTracking property, analogous
to mouseTracking, which will enable TabletMove events while the stylus is
hovering, even if no button is pressed. This allows applications to show
feedback based on the other tablet event properties such as rotation and tilt.
Task-number: QTBUG-26116
Change-Id: Ie96e8acad882b167e967796cdd17f1ad747a2771
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The main reason for this is to get feedback about the stylus orientation
(angles and rotation) before the user presses it. For example an application
might provide an image of the brush which rotates along with the stylus. As
with mouse events, applications can distinguish hovering by the fact that no
buttons are pressed.
On the xcb platform we need to stop blocking the hover events, and in
QWidgetWindow we need to send the event to the widget being hovered, while
keeping the existing "grab" behavior: after pressing the stylus (or any button
on the stylus or on the tablet), keep sending the events to the same widget
until release.
Task-number: QTBUG-26116
Change-Id: Iaed8b3b94961290dbb29b5fd2ea892fed7221685
Reviewed-by: Dmitry Kazakov <dimula73@gmail.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This reverts commit 3b38392844.
The change caused test compile failures with MSVC2015 in qqmlsettings;
a variable was not captured in the lambda expression. This appears
to be a compiler bug of MSVC.
Task-number: QTBUG-59096
Change-Id: I3bf5288eb005b2e1661819bb33bc54fb944d0150
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The QSystemLocale constructor remembers the most-recently-constructed
instance - a dodgy enough proposition at the best of times - and
shares it with much of the rest of QLocale. There is a global static
instance, actually of a derived singleton class, to which it is
usually set on program start-up. However, the constructor deleted the
remembered instance before remembering any new instances; there was no
way this could not lead to bad consequences. So let's not do that.
Change-Id: Ie8f3d655c9d4f75f6ec00a5861d98d6020ecc633
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In 0ae4b948515af904dba397448839056d9b7965af, we added a work-around
specifically for the Android emulator, causing it to override the
precision qualifiers in shader code, since the emulator would send
the shader code directly to the host OpenGL driver and thus there
was no guarantee that the qualifiers would be supported.
Since then, the original issue with the emulator has been fixed,
so now Qt applications are failing because of the work-around.
[ChangeLog][Android] Removed old work-around which was causing
OpenGL shader compilation to fail on updated Android emulators.
Task-number: QTBUG-44697
Change-Id: I0da879b3a8fbe7cb2d0969cdf45664d0b3499891
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Sometimes, users need to add compiler flags to QMAKE_CXXFLAGS that
aren't supposed to be passed to the predefs dump. That's especially true
for -include options, as that would change completely what's
defined. Not to mention that -include is a preprocessor option and
shouldn't be in CXXFLAGS in the first place (Automake has CPPFLAGS, but
qmake only has INCLUDEPATH and DEFINES).
[ChangeLog][qmake] Added the ability to suppress the collection of the
compiler predefined macros for moc's use. To disable the collection, use
CONFIG += no_moc_predefs.
Task-number: QTBUG-58857
Change-Id: I4139d5f93dcb4b429ae9fffd14a34d49825d9b85
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
There's nothing wrong with cloning a const QTimeZonePrivate, so make
clone() const.
Also, if you're cloning a QTzTimeZonePrivate, you already know that
you get a QTzTimeZonePrivate back. C++ supports covariant return types
for this reason, so use them.
Change-Id: I60e19e89b1b7bad080c552f1baca314ab0a6295e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- Don't init m_icu with 0. It's a QSharedDataPointer, which inits to
nullptr anyway.
- The copy ctor didn't do anything out of the ordinary, so = default it.
It's also only used in the implementation of clone(), so make it private.
Removes three #if QT_CONFIG blocks.
We can't use ctor delegation here, because systemTimeZoneId() is a
virtual function.
Change-Id: I2cd06c3349686b6f21c897acb5c12185a36d5b9f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
MSVC 2013 complained:
src/corelib/tools/qbytearraymatcher.h(143) : warning C4351: new behavior: elements of array 'QStaticByteArrayMatcher<6>::m_pattern' will be default initialized
Fix the same way as 9a07ab9234: by suppressing
the warning.
Change-Id: Ic41f7eabe7e39709d76e6062f5891cdcfaa6e1ed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Unfortunately, that ctor also takes a ControlType argument (defaulted),
and calls the non-constexpr, non-inline function setControlType().
In order to make at least the two-arg version constexpr, I added
a use of the ternary operator to check for type == DefaultType,
making all calls of the ctor that use type == DefaultType
constexpr. For init'ing an aggregate type without ctor in the
ctor-init-list, I needed to require uniform initialization, too.
C++11-style constexpr cannot call void functions, so I needed
to extract the transformation part of setControlType() into a
new function that returns the result instead of storing it directly.
Saves a surprising 2K in QtWidgets text size on GCC 4.9, AMD64 Linux
stripped release builds.
Change-Id: Ib4adf5fd6e54d5345dbfe1c298554278faf13c58
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This is one of the pillars of my static container checking toolbox,
one of the main checks being that every type put into a Qt container
has been marked up with Q_DECLARE_TYPEINFO.
Obviously, we cannot upstream such a checker and inflict it upon the
world, but we can put some foundations in. This is the most central
one.
Change-Id: I9185facb2f37ba9fcc12c9aae5675eed454d755c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A window can resize while dragging, this happens on Windows when dragging
across screens, to a screen with a bigger scale factor. When that occurs
it might lead to the press pos being outside of the window.
Change-Id: Ic61ec7088c8fa81395d43ce665952dbd2eecba39
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
RunLoopModeTracker as one of Qt Cocoa classes was not wrapped
in namespace which limited its use in Objective-C single symbol space.
Change-Id: Ida2c62c6f543a3bf5107f28c78d27435bcb3470d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>