The reason for using type-punning through an integer was
to avoid compiler warnings about float comparisons. We have
now a better mechanism to suppress such warnings,
so there is no need to be "clever" and trigger UB because
of the union usage.
Drive-by change: add constexpr+noexcept because now there's no
longer UB.
Change-Id: I29f7514e39055658d4ef6c431daf5abfc660df16
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Do not merely declare it as private, use C++11's = delete.
This has the nice side effect that subclasses are no longer
implicitly copy assignable either (they shouldn't be).
Change-Id: Icd03f71006c31baf7d079365fa3bea1a2a9d559b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In 5.12 only the variadic argument version is left (as all
supported compilers have variadic templates). Remove the docs
of the nullary overload, and fix the docs for the remaining
overload.
Change-Id: I54cc7ea71cc61ba1330a9ad92e4fa2ae7f749bac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Encode the consumed/filtered state in the _exit tracepoint and remove
the separate tracking of receiver event handling. Combined, this
reduces the size of the trace file.
Change-Id: Icb3cb2dd47798543905cea450046d6fad559a15b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit e0d2b50249 makes swapItemsAt
use ADL to find swap(). Problem is, QList has a swap() function
(that swaps the elements at the specificed _indices_); that function
will be found before ADL kicks in.
So do the second best thing: use qSwap instead.
Change-Id: Icf2b4e3ce09117e4056acbad3e2d8a625861d807
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QMAKE_PRL_LIBS contains absolute paths to libraries, e.g. libqtpcre2.a.
On "make install" the libdir is replaced with the installation target
libdir. If the libdir is in QMAKE_DEFAULT_LIBDIRS (e.g. /usr) then the
replacement was empty. That worked fine for include paths but not for
paths referencing files in that libdir:
/my/build/lib/qtbase/lib/libqtpcre2.a would become /libqtpcre2.a.
Add another replacement that takes care of file paths and inserts
$$[QT_INSTALL_LIBS].
Fixes: QTBUG-75460
Change-Id: I4e84478a50c24d4143ad5695493cad2992735cf2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
- Never for global inputs
- Otherwise only if the temporary is referenced more than once
-> meaning it's actually caching the result of some operation
Tests updated accordingly.
Change-Id: Ic76615370d23dee3965ca6350d5257a8be5a3e22
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Add the required datastream versions for 6.0. Of course the number for
5.15 and 6.0 is still something we can bump.
Change-Id: I676385817befc06ea8d0ff1e9eba9c94cb4698b0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
As the non prefixed variants are deprecated
Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The previous fix to decrease the limit to 1024 breaks the parsing
for some files. The limit is arbitrary, so increasing it to 4096,
which is what some linux distros have been working with.
Change-Id: I131f15278aa99c3f91db2e1ec2d14156ceed4775
Fixes: QTBUG-35459
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
This follows up on commit 84aea6c091, in
which I forgot to mention this possible return value.
Change-Id: I109bed66bc0fd63d7ee289bfaea65b3d05c6560c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Private classes to replace broken or even not working at all 'session management'
and 'bearer manager' (on at least two major platforms we support). This
implementation is macOS/iOS-specific and uses SystemConfiguration framework,
or more precisely SCNetworkReachability's part of it.
Task-number: QTBUG-40332
Change-Id: Iac5f44c4063c4092b93b8cf2bde3fb2c524855b3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This provides the ability to write live data from a table to Markdown,
which can be useful to load it into a text document or a wiki.
But so far QTextMarkdownWriter is still a private class, intended to be
used experimentally from QtQuick and perhaps later exposed in other ways.
Change-Id: I0de4673987e4172178604e49b5a024a05d4486ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Checkboxes are right-aligned with any bullets that are in the same
QTextList so that there is enough space to make them larger than bullets.
But hopefully mixing bullets and checkboxes will be a rarely-used feature.
Change-Id: I28e274d1f7883aa093df29eb4988e99641e87a71
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Also use QT_CONFIG to disable features gracefully if Qt is
configured without them.
Change-Id: I38e92bf5fd70f77fc4d5158769d590619be8905f
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Remove remaining handling of missing support for rvalue refs.
Change-Id: I78bab8bccfeeb9c76f464f345874364a37e4840a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It does not depend on QtGui.
Change-Id: If7b01d1a6d2ce3945562f4480177ce883abfdbf4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Mimicking what we currently have for QSharedPointer, but also adding
* snake_case version (matching the ones in std)
* rvalue-overloaded versions (matching the C++2a overloads).
[ChangeLog][QtCore][QSharedPointer] Overloads of
qSharedPointerObjectCast have been added to work on std::shared_ptr.
Change-Id: I26ddffd82b000bf876e7c141fdce86a7b8c1d75a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A QTextDocument can now be written out in Markdown format.
- Add the QTextMarkdownWriter as a private class for now
- Add QTextDocument::toMarkdown()
- QTextDocumentWriter uses QTextMarkdownWriter if setFormat("markdown")
is called or if the file suffix is .md or .mkd
- Add QTextEdit::toMarkdown() and the markdown property
[ChangeLog][QtGui][Text] Markdown (CommonMark or GitHub dialect) is now
a supported format for reading into and writing from QTextDocument.
Change-Id: I663a77017fac7ae1b3f9a400f5cd357bb40750af
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Requires a screen with working context permission parsing. Currently,
all context permission requests fail because the parsing is incorrect.
A context permission is added temporarily to prevent CLOSE/CREATE
events when Qt reparents foreign windows. Qt does this temporarily
when a foreign window is wrapped in a widget.
Change-Id: I84c18e70d43239286fcd53715332d7015cf1a826
Reviewed-by: Rafael Roquetto <rafael@roquetto.com>
The old code in QtActivityDelegate.updateHandles() and
EditPopupMenu.setPosition() could use size of EditPopupMenu.m_view to
calculate position of context menu before that size was calculated
during an asynchronous layout pass. In particular m_view reports size
0x0 when context menu is opened for the first time after start of the
application. In this case the context menu was displayed on top of the
text editor instead of being displayed above it.
This patch fixes that problem by moving all positioning code from
QtActivityDelegate.updateHandles() to EditPopupMenu.setPosition() and
adding an OnLayoutChangeListener which calls setPosition() again each
time the size of m_view changes, including when it changes for the first
time from 0x0 to a real value.
Change-Id: I670fef811a4dcba5524f7520ea41a47978dd10f1
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
The old code used size of m_cursorView to calculate position of the
cursor handle popup. But since on Android layout process is
asynchronous, both width and height of m_cursorView was 0 upon first
call to setPosition(). This resulted in selection handles being
initially displayed at a wrong position for a fraction of second and
then quickly moving to the correct position. In some cases handles
stayed at the wrong position until touched by user.
This patch replaces use of m_cursorView's size with use of m_popup's
size. Width and height of m_popup may be used immediately because they
are explicitly assigned in initOverlay(). The size of m_popup should be
always equal to the would-be size of m_cursorView because of how it is
calculated.
Change-Id: I9868c9a5ce0103d8328b2478cf82feaceba7f404
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Implicit copy constructors or methods are considered deprecated for
classes that has one of the two or a destructor.
The warning is enabled with -Wextra in gcc 9
Change-Id: Ic9be654f2a142fb186a4d5a7d6b4f7d6f4e611d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The file system appears to cache too aggressively, so if the reported
storage size doesn't change after flushing to disk, ignore the failure.
Change-Id: Iba7dce79591447fac296bfe92c2dc993d36d0c2a
Fixes: QTBUG-69868
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The implementations were practically identical, so we can just move the
code into qhostinfo.cpp, cleaning up things along the way.
Since QHostInfoAgent is an internal class, add the shared code as
additional static helper functions. And since half the code already used
QCoreApplication::translate anyway, we can remove the QObject
inheritance which was only added for getting a tr().
Change-Id: I58eafbdc3e7d06d2e898486a1add63cd63d98c96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When we trace a scope, then we pass the scope args to the _entry trace
point. There is no need to do that also for the _exit trace points, it
just blows up the trace data for no obvious gain. Any decent tracing
consumer can easily find the args for the _exit call by matching it to
its _entry call.
Note that this is standard practice in trace points, and also done like
this in the Linux Kernel trace points for example.
Change-Id: I273293b0c7e799767acc1960b50ab675fc765a36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use Q_TRACE_SCOPE and the corresponding naming scheme. Additionally,
don't change the behavior of the code when tracing is enabled, i.e.
continue to return early if possible.
Change-Id: I9ba9679869db1541a19bc832beede902224c52f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Don't reimplement the protected functions in the base class just
override the access with the using keyword.
Change-Id: I323487d9ddb1d458d5faca020c3eb4d931a9b226
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>