The warning isn't printed when EGL_NO_X11 (the new macro) is defined.
Fixes: QTBUG-80042
Pick-To: 5.15
Change-Id: I99ab0f318b1c43b89888fffd160b5d99f94c8c9b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Expected and actual were inverted.
Pick-To: 5.15
Change-Id: Idc3fae4d0f614c389d27fffd15e9fa6a0a8f25e6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Use DockCount enum value for the size of the array, and explicitly
handle when toDockPos returns DockCount (which it might).
Change-Id: Id52399607fb1ae74a24a050de7a8481264c03e47
Fixes: QTBUG-83983
Coverity-Id: 218539
Pick-to: 5.15
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
In that specific wrapping mode, it will first try a normal word wrap. If
it doesn't fit within the specified line width it will discard the
result of that and try WrapAnywhere by calling layout_helper()
recursively. The problem was that at the point it called itself again it
had already adjusted eng->maxWidth:
eng->maxWidth += line.textWidth;
This was not restored, but carried on to the recursive call to
layout_helper(), so the end result was that the maximumWidth would
accumulate text widths from parts of the same line twice.
Due to the same recursive behavior the minimumWidth also had a problem:
It always returned the width of the widest word because it took the
qMax() of the minimum widths of the two passes, (WordWrap and then
WrapAnywhere) effectively making the minimum width always be the width
of the widest word (even though it could wrap at finer granularity).
Pick-to: 5.15
Task-number: QTBUG-77337
Change-Id: Ie7e9c17b157506352c2da38cc7f4a8dfa1283966
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.
Change-Id: Ia9e837ebba88aeb1916da041fc8460a0692a03e4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We have at least one user that only ever passes rvalues.
Change-Id: I3f190b8d074e40a23c52e791635c9a1c45ba00ab
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.
Change-Id: I59242287debfd1e41c663aa2b88d0d3ea44f43fb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use the DotMatchesEverythingOption for all places
where we interpret .pro files, to increase compatibility
with QRegExp.
Change-Id: I347d6b17858069f3c9cedcedd04df58358d83f27
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This is required to be able to port qmake over to use
QRegularExpression instead of QRegExp.
Change-Id: I0ad2c19bf3c0a28e52c1e12b4d3daa0300a75ed2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Should improve performance and is going to be required in
the future anyway.
Change-Id: I89d7c50441d2491da1ab0a4d564dcc91f52ade85
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Qt Designer let's you add custom slots and signals to the main
form; they should use string-based connection syntax since the
class is not known in setupUI(). Amends
da3cb1deb6.
Task-number: QTBUG-76375
Change-Id: I5a3a5630f77c812d48db1cdb7a8658a4d2718228
Reviewed-by: Liang Qi <liang.qi@qt.io>
Fixes enabling of fPIC that got removed as a side-effect of commit 39fc377bf.
Fixes: QTBUG-83949
Change-Id: I2bed7edb5b1f97192cbcf9e12dd927a17803d864
Pick-to: 5.15
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Various places in Qt use arrays indexed by some function of
Qt::Orientation input. None document their dependence on the numerical
values of the Qt::Orientation enum, some waste space, none is
type-safe.
QHVContainer is a private container of two values, one for
Qt::Horizontal and one for Qt::Vertical. Its salient API is the
indexing operator, taking Qt::Orientation, thus making the class
type-safe.
Use it to port QGridLayoutItem and QAbstractScrollAreaPrivate.
Change-Id: I0d9f17431a5eb141bfb0763c83155710bb82a537
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This happens when there are two screens (configured in the json file),
QT_QPA_EGLFS_HIDECURSOR is set, and the mouse moves to the secondary
screen: m_bo is null.
Pick-to: 5.15
Change-Id: I5cef9835e7c9a6a39264bf9a028bf1feeabc6995
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
A failure in testlib is apt to imply misleading failures elsewhere, so
catch those first. Likewise, broken tools or corelib break
everything. Put the rest of the list in alphabetic order.
Restructure auto.pro to use conditional SUBDIRS += (in the right
order) instead of setting SUBDIRS to a full list and then doing
conditional SUBDIRS -= for most entries. This more closely matches the
way the generated cmake config does things, although it still doesn't
regenerate cleanly.
Change-Id: Idc15326c3534eb4fdce55394269f2dfbc17fcd99
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Instead of selecting a Qt::Orientation value based on the integer loop
variable, just loop over the possible Qt::Orientation values directly.
Change-Id: I25b6f0d49c9b5a7e16e974dcc37668f801e65224
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The default implementation does nothing; the processing of accepted
close events remains in the QWidget::event handler, so that subclasses
don't have to call the super class in order to free window system
resources and emit lastWindowClosed signals.
QWidgetWindow::event is reimplemented to handle QEvent::Close as well,
calling QWidgetPrivate::close_helper, which then delivers a separate
QCloseEvent to the widget.
The order of execution for widgets is after this change:
1) QWidgetWindow::event
2) QWidgetWindow::handleCloseEvent (calls QWidget::event/closeEvent)
3) QWindow::event
4) QWindow::closeEvent <- does nothing, not overridden
5) default cleanup handling in QWindow::event
and for Qt Quick after the corresponding change in qtdeclarative:
1) QQuickWindow::event
2) QWindow::event
3) QQuickWindow::closeEvent <- emits closed
4) default cleanup handling in QWindow::event
[ChangeLog][QtGui][QWindow] closeEvent has been added as a virtual
function.
Task-number: QTBUG-31019
Change-Id: I201f5ee9c6a73b949986648e3bd288d2c7898f28
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
As discussed in the mailing list and in the Qt Contributor Summit 2019.
Tested on Linux, macOS and FreeBSD, showing these fallbacks:
OS environment setlocale() call
FreeBSD empty "C.UTF-8"
FreeBSD LC_ALL=C "C.UTF-8"
Linux empty "C.UTF-8"
Linux LC_ALL=C "C.UTF-8"
Linux LANG=en_US "en_US.UTF-8"
Linux LANG=de_DE@euro "de_DE.UTF-8"
Linux LANG=en_GB.iso885915 "en_GB.UTF-8"
Linux LANG=hy_AM.armscii8 "hy_AM.UTF-8"
Linux LANG=ja_JP.sjis "ja_JP.UTF-8"
Linux LANG=ru_RU.koi8r "ru_RU.UTF-8"
macOS empty "UTF-8"
macOS LC_ALL=C "UTF-8"
Versions tested: FreeBSD 12.1, Linux w/ glibc 2.30, macOS 10.14.2.
See
* https://wiki.qt.io/Qt_Contributor_Summit_2019_-_QtCore
* https://lists.qt-project.org/pipermail/development/2019-October/037791.html
Change-Id: Ia2aa807ffa8a4c798425fffd15d97ddb4f35b0ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The proper solution is to use qint32 everywhere, but that is left as
a separate exercise.
Change-Id: Id0c06b102b56a1b3b48dd67c6c29c28da7d1f22d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Fix some warnings that are flagged as errors on clang10.
Change-Id: I906634c8b2bd94db42d74a7f3d10efb086e373cc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit bc726ed5d9)
Since Android native file manager supports mimeTypes, I use
QMimeDatabase to get the correct mime type for the nameFilter
used with the file dialog.
[ChangeLog][Android] Support setting mimetypes and and namefilters for
Android native file dialog.
Task-number: QTBUG-83089
Change-Id: I46545576dc9b51aa872bb37dbf4fe12b2533bdd9
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Use :/i18n/, because this is the place where translations are stored
by default if using qmake's CONFIG += lrelease embed_translations.
Also revert change of app.exec() done in 16da0b2cf8. First of all,
both QGuiApplication and QApplication feature overloads of exec(),
so using QCoreApplication::exec() might miss functionality.
Anyhow, while it's true that all of them are static member functions,
the vast majority of our examples and templates call them with
class member access syntax, so let's try to be consistent.
Finally, the example since a while uses QCoreApplication::translate,
not tr(), so let's not mention it in the description.
Change-Id: Ic6e5d91cf04d3f0d1a4296c5c09e790773e6fc62
Reviewed-by: Miłosz Kosobucki <milosz@kosobucki.pl>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Use case-insensitive endsWith() instead of lowering a QString and then
comparing case-sensitively.
As a drive-by, replace ascii string literal with char16_t one.
Change-Id: Id4d8e5b197baba7aa3ae4c2ae57414c1242b3827
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.
Change-Id: I5d7d32c52ad19d37c0e1191e822304349944d7e6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.
Change-Id: If059f2ac66967168fe269cd62aaee9cfeb10f17e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Pairs are easy to use, but they have no semantics attached: Two
QPair<int, int> compare equal, e.g., even though one is used as a
coordinate and the other as, say, a fraction. It also carries no
information for the reader of the code, as exemplified by the urge to
comment on the content of the pairs in both functions that use them.
So, write a minimal struct with equality and qHash() instead. The
comments are now no longer needed.
Change-Id: I51f6ff049a5f8fa61c51856376ac2fcbfb8dd506
Reviewed-by: David Faure <david.faure@kdab.com>
To define a shortcut a Qt::ArrowType enum value was getting
mixed with a keyboard modifier. An actual mistake spotted
by blocking mixed-enum operations!
Change-Id: I4df56ee411599937c243288e8518b5c1df446397
Pick-To: 5.15
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Condition is a compile-time one.
Change-Id: I6e60f12cc51e96b2528c375017357c0631e2fc0b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The code assumed that files in $HOME should be moved into $HOME/.Trash,
which is not what the spec says. The "home trash" is defined to be
$XDG_DATA_HOME/Trash, and we can expect $XDG_DATA_HOME to exist. If it
doesn't, then we can safely fail, as the environment is not compliant
with the Desktop Base Directory Specification [1] anyway.
[1] http://www.freedesktop.org/Standards/basedir-spec
This will make the tests fail on such non-compliant environments, such
as server versions of the distribution. That's acceptable.
[ChangeLog][QtCore][QFile] moveToTrash now creates the trash folder on
Linux as $XDG_DATA_HOME/Trash, as required by the freedesktop.org spec.
Change-Id: I7ef73c0c268ef5ea4df141bb7831b93a65ad213a
Fixes: QTBUG-83933
Pick-to: 5.15
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Faure <david.faure@kdab.com>
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.
Change-Id: Ife8e09b4a54060ef52c9aac43e400736ea398c29
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>