Commit Graph

27756 Commits

Author SHA1 Message Date
David Faure
c82ab86cea New proxy model: QConcatenateTablesProxyModel
It takes multiple source models and concatenates their rows into a single model.

With full unit tests.

[ChangeLog][QtCore] New class QConcatenateTablesProxyModel, to
concatenate the rows from multiple source models.

Change-Id: Iaf4f325473adef106f423677fdc5ee0e35e87d35
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2018-09-09 10:13:06 +00:00
Qt Forward Merge Bot
be27bf02f4 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I36cda712b4cf960de70e497aef52fbc491099f1c
2018-09-09 01:00:10 +02:00
Juan Jose Casafranca
5474f28c42 Graph loader can load prototypes stored in the graph
Change-Id: Ib0bbfe5b0257bf355e83cc5287fa52b1e0cc3ed6
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-09-08 17:11:06 +00:00
Tor Arne Vestbø
be60b541ad Make QOpenGLContext::makeCurrent use early exit for all its flow
The case of the platform context failing makeCurrent is the exception.

Change-Id: I606e6fb379f84e886bff9e27355dda9b31ff9ebe
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-08 14:04:51 +00:00
Mikhail Svetkin
59fc64cfc5 QOffsetStringArray/msvc: fix compilation warnings C4100
C4100 - identifier' : unreferenced formal parameter
It happens when we call StaticStringBuilder::concatenate(StaticString<N>, StaticString<0>).
StaticString<0> is ignored.

Change-Id: Ic687bc865aa5d5e7425cbddbd614bde7dbb801df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-07 08:29:22 +00:00
Tor Arne Vestbø
3baa9aa3cd macOS: Clear NSOpenGLContex's drawable when using offscreen surfaces
Otherwise the user might accidentally render to the previously active
window, if not explicitly using an FBO.

This will have an performance impact if doing makeCurrent on a real
window and an offscreen window back and forth with the same context,
but that's not really a common or recommended use of QOffscreenSurface,
as you can create FBOs with a normal window current as well. The use
case of QOffscreenSurface is when a real window is not available.

Change-Id: If93d04f82564523e15d5970429afea34c5cd31fe
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-07 07:25:37 +00:00
Qt Forward Merge Bot
f21330b749 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I799e2ca2fefa140c8b73b73aa959c6ed8da6eae6
2018-09-07 01:00:48 +02:00
Qt Forward Merge Bot
295cd87c6d Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
2018-09-07 01:00:21 +02:00
Friedemann Kleint
35ebdeb83e QTreeView: Fix expanding of spanning items
When using HeaderView::ResizeToContents and
QTreeWidgetItem::setFirstColumnSpanned(), it happens that the position
of the branch icon is no longer in the first column and thus trying to
expand the item results in a selection change. Check for spanning when
determining the position.

Task-number: QTBUG-41793
Change-Id: I14353127436fb0ebaafb0d50a31b920b8da67333
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 20:28:40 +00:00
Laszlo Agocs
2105f80169 cocoa: Fix build with MoltenVK
Change-Id: If92afa2d30d55e1dd2968f582350ba2cf16fe27b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-06 17:10:06 +00:00
Mikhail Svetkin
e8dacba47a QOffsetStringArray: fix compilation error with MSVC15/17
MSVC 2015/2017 has a bug with constexpr.
It is internal compiler error when we are using QtPrivate::IndexSequence
with more than 1024 items.

Example:

template<int ... I>
void foo(QtPrivate::IndexSequence<I...>) { }

void bar() {
    foo(QtPrivate::makeIndexSequence<1024>()); // works
    foo(QtPrivate::makeIndexSequence<1025>()); // error: C1202: recursive type or function dependency context too complex
}

Workaround:

template<typename>
struct Foo;

template<int ... I>
struct Foo<QtPrivate::IndexSequence<I...>>{
    static constexpr void call() { }
};

void bar() {
    Foo<QtPrivate::makeIndexSequence<1025>>::call(); // works
}

Change-Id: Iedbf5291ac4a9f51f8b5f6b76b83baba920c092d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-06 13:20:28 +00:00
Friedemann Kleint
deab54f84f Fix crash when setting Qt::WA_StaticContents on a transient child
Bail out of QWidgetBackingStore::updateLists() when a
top level transient child is encountered, preventing from
adding children of other top level windows to its list.

Task-number: QTBUG-70085
Change-Id: Ibd748ab959af9bfe7fe0622494936b0c109ab25a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-06 12:54:54 +00:00
Tor Arne Vestbø
d115196010 macOS: Use single call site for timer processing in event dispatcher
Makes it easier to add shared logic later on.

The call to maybeCancelWaitForMoreEvents() has been left out as it was
not called from all call sites.

Change-Id: Ibcb10ab4d788de80850b0e5a4286b4d49091cddb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-06 12:42:17 +00:00
Tor Arne Vestbø
367adc10de macOS: Rename QCocoaGLContext::setActiveWindow to setDrawable
Change-Id: I0be5125b434418c005f45f05c54b22f0418b46e4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-06 12:30:13 +00:00
Christian Ehrlicher
6c088af0f9 QHeaderView: honor qss padding attribute
QStyleSheetStyle did not check if a border (which includes the padding)
is given and therefore the padding attribute given by css was ignored.
Only when another attribute was additionally set, the padding was used.

Task-number: QTBUG-59501
Change-Id: If3e691a23266ef6d0fb942a43053b29d65e40047
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-06 12:19:03 +00:00
Christian Ehrlicher
20be62da8c QHeaderView: remove dead code
The special handling when a font for a headerview is set became useless
after a4e6117c53 since it is now included
in branch four lines above.

Change-Id: I73bec48913ebca5f278128a124b58d1b6172e334
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-09-06 12:19:00 +00:00
Christian Ehrlicher
fbd21e1024 QHeaderView: Take padding/margin into account when eliding text
When QHeaderView has an elide mode set, the available width passed to
QFontMetrics::elidedText() was not adjusted when padding or margin was
set. This lead to a too long text displayed in the header.
Now QStyle::subElementRect(SE_HeaderLabel) is used to get the correct
rect.

Task-number: QTBUG-23203
Change-Id: I12fc646092470272bb91b3ffb7c7a51e239c7a35
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 12:18:56 +00:00
Kai Koehne
3bac18da8e Document SLJIT part of pcre2
src/sljit features the BSD-2-Clause license, not the BSD-3-Clause one.

[ChangeLog][Third-Party Components] Added documentation for the SLJIT
part of pcre2, which is available under the BSD-2-Clause license.

Change-Id: Ie1e981ef6eab2c8d2960919b66ac85b29450f919
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-06 12:09:31 +00:00
Friedemann Kleint
550d2a0a15 uic: Fix pixmap functions for QIcon
Task-number: QTBUG-8563
Change-Id: I69b16ac2327fee6dd6f26845bdda60ad4dde56fa
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-09-06 11:58:40 +00:00
Luca Beldi
dc73a691bf Fix QSIM::itemData returning role 255
Before this fix, QStandardItemModel::itemData returns
a map containing role 255 which is used internally to store the flags.
This role is an undocumented implementation detail so it should
not be returned to the user.

[ChangeLog][QtGui][QStandardItemModel] itemData does not return role 255

Change-Id: Ibead3cba84cfe92b3c664bc8ce87508cbcbdc9bd
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 11:51:28 +00:00
Luca Beldi
37a1c6dc4c Reimplement QStringListModel::setItemData
Before this patch QStringListModel::setItemData emitted dataChanged
twice if the roles map contained both DisplayRole and EditRole.
This fixes the duplication.

Increased efficiency of QStringListModel::itemData

Task-number: QTBUG-67511
Change-Id: Ibaea17530f15627a3cb8003e5284e54001731ded
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 09:27:09 +00:00
Luca Beldi
fcdb459c06 Implement QListModel::moveRows
Implemented the virtual method moveRows to allow row movement.

[ChangeLog][QtWidgets][QListWidget] Implemented moveRows in model

Task-number: QTBUG-69807
Change-Id: I212b560b8778306a0315d9d5e4710efcc7dbbe44
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 09:26:58 +00:00
Luca Beldi
551e11c286 Implement clearItemData in common models
A virtual method clearItemData was added to QAIM for Qt6.
This patch implements that method to all Qt concrete models for which
it makes sense.

Task-number: QTBUG-69616
Change-Id: If980fcfc36f723128bc56ec4587c5c3a338dbbcc
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 09:26:51 +00:00
Laszlo Agocs
85f127cb04 Revise an incorrect QVulkanWindow doc note
Applying the transformation in question has no effect on the winding
order. Rewrite that section.

While all the examples are correct, clarify the rules for the geometry
they use since the winding order varies. Fix up the triangle example code
to use front=CCW for clarity (even though it does not matter much since
culling is off there).

Change-Id: Icb968c76cc9fa918a5608d3c66b4fccd5668175e
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2018-09-06 09:17:53 +00:00
Andre Hartmann
689a1e186b QString: Fix snippet explaining "non-spaced numbered place markers"
The snippet tries to explain the advantage of

 str.arg("Hello", QString::number(20), QString::number(50));

over

 str.arg("Hello").arg(20).arg(50);

which only makes sense, if str contains the same formating sequence,
namely "%1%3%2". That also matches the belonging comment.

Amends 8481500f63

Task-number: QTBUG-44044
Change-Id: Ic2595107bc599c6d244ebf88184a5cc5569ed4f1
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-06 09:07:01 +00:00
Qt Forward Merge Bot
e5d0289413 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I2f6e1c0f649c5098723b776c774a8a689bb60582
2018-09-06 01:00:33 +02:00
Mikhail Svetkin
40cd0f35ef Remove QConditional in favor of std::conditional/std::is_unsigned
Change-Id: I5e0b9f640eb49aa7f5afdd4f3f15e027659e78ea
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-05 14:11:15 +00:00
Erik Verbruggen
028727c20c ASAN: Disable SSE4.1 code in qstricmp because of heap-buffer-overflow
Although it is safe to slightly overread a string (provided it doesn't
cross page boundaries), ASAN is extremely picky about this kind of
behavior. So, do not run with this vectorized code when ASAN is
enabled.

Task-number: QTBUG-70269
Change-Id: I2b59b524d608afec8985227285feab55158d7247
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-05 13:14:47 +00:00
Andre de la Rocha
20ac20bcea Windows QPA: Fix missing accessibility info with WebEngineView
It seems when a WebEngineView is parented by a window its accessible
interface will not know its parent, which prevented the root of an
UI Automation fragment from being found, causing missing accessibility
info. This change adds a workaround to avoid this issue.

Task-number: QTBUG-70199
Change-Id: Ia7cfc9f410c4f0ef3b5f9d1700748a9a3e29b7c2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2018-09-04 19:48:01 +00:00
Ulf Hermann
dd944136a2 QObject: Document order of events on destruction
Weak pointers are zeroed before destroyed() is emitted. This makes sense
because the signal is called "destroyed()", not "aboutToBeDestroyed()",
and the code has been like this for a long time.

Change-Id: Ic852fe354405e328d1922a75931e7eb7bf651b26
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-04 07:05:00 +00:00
Venugopal Shivashankar
ff2a71e310 Doc: Move the literal code blocks to a separate file
It's easier to override the code blocks this way.

Change-Id: I98d40626a94fdb70a95c50332c2da141e9277070
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-09-03 12:31:07 +00:00
Rolf Eike Beer
a3ee0b94da QWindowsStyle: respect rectangle when drawing PE_IndicatorViewItemCheck
This is a follow-up on commit 6553921dd5,
which fixed the drawing of the surrounding rectangle when used in item
views. This one now fixes the drawing of the check mark itself, for both
item views and standalone items.

Change-Id: I14f359e9d2ef33652cc68494b7d114e61110e5e0
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-09-03 10:51:14 +00:00
Andy Shaw
69a2bc7a2a Doc: Explicitly state that QSqlTableModel only handles EditRole
Fixes: 5.12.0
Task-number: QTBUG-70234
Change-Id: I65c6aa60048182c5408dca2aa20098af363b10ec
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-09-03 10:24:09 +00:00
Samuel Gaist
fe463dd422 QSFPM: cleanup QRegularExpression includes
Add feature guard around the include in the header and remove the one
from the implementation file.

Change-Id: I8dc133cce786ead6059cc66b40a0ffb6c420096f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-09-03 09:42:58 +00:00
Albert Astals Cid
8b6100d512 QStringList: add contains(QStringView) overload
Change-Id: I953e4ef3167011d0348ea482890e29478bd6f761
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-03 08:55:52 +00:00
Albert Astals Cid
64fe66e7be Add QString::compare(QStringView, CaseSensitivity)
There was a QStringView::compare(QString, CaseSensitivity) but it's
good that the symmetric also exists

Change-Id: Ic789f11d41eb8cfa393cb51c19bd1f89bb87d912
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-03 08:55:45 +00:00
Edward Welbourne
5cc5b43d0f Remove some misplaced sizeof() scalings on array sizes for new[]
Noticed during review of clang-tidy warnings.  I have searched the
source tree (using grep) and only this one file contains examples of
this mistake.

Change-Id: I3bbcec736e5a184db7251962fd3671a21ab5d238
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-09-03 08:53:46 +00:00
Sergio Martins
179c88a1a9 Rename QTimer::connectTo() to QTimer::callOnTimeout()
Some people suggested the later, so let's have a second look at it
before it's too late.

Although I was in favor of the former I'm now having second thoughts.
connectTo() is meant to only be used in classes which have a clear dominant signal,
but there are rare classes that have two (example: QAbstractButton::toggled, QAbstractButton::clicked).
QAbstractButton::connectTo() would be ambiguous if we ever wanted to add these shorthand connects
to QtWidgets

Change-Id: I198ad3326d31dcf89b9c47a299124572ee7b11b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-03 08:43:39 +00:00
Allan Sandfeld Jensen
5d0ee89132 Fix reading 16bpc grayscale PNGs
They were incorrectly attempted to be read as Indexed8, instead use
the RGBA64 formats to read them with full accuracy.

Task-number: QTBUG-45858
Change-Id: I14fc3cb0d59fa2fc0e68fd870f3b32352c34161f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-09-03 08:24:10 +00:00
BogDan Vatra
e0213d1939 Android: Fix crash
Android doesn't like nor use RTLD_NODELETE

Tasnk-number: QTBUG-64654
Change-Id: I2d884bbf22a681cca592942eba84ba97327ba974
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-09-03 08:21:47 +00:00
Rolf Eike Beer
b3f9b2f148 remove internal use of SE_ViewItemCheckIndicator
This is marked to be removed in Qt6, so switch to
SE_ItemViewItemCheckIndicator internally and define the old value as
copy of the new one instead of the other way round.

Change-Id: I9e9804a7ff0e9b2ae1e24698d45b2cbd44423420
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-03 07:15:22 +00:00
Alex Blasche
c82d043de1 Bump copyright year of code generated by dbus tools
Change-Id: Ic5e2ecf672ea86e8ef70a9fa73c0535262d2e928
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-03 05:23:40 +00:00
Qt Forward Merge Bot
441ac7084c Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I8303ca41d0ca9ce1fdb27259db4f9f8448c74bcb
2018-09-03 01:00:10 +02:00
Friedemann Kleint
e646ab2ab5 Windows code: Fix to prefer ranged-for, as clang-tidy advises
Change-Id: Id9bb21855ae832cdbbc456326226ec72b634672e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 16:05:39 +00:00
Jan Grulich
101cb8e5d9 Make flatpak portal support to be used also by Snap applications
Snap now uses xdg-desktop-portal for portal support. Add check for apps
running in Snap and make them use portals by default. We also should be
using different name for the platform theme used by sandboxed apps.

Change-Id: Ibaa35b7549b3d94775d7edb937f729a300d071b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 14:15:38 +00:00
Friedemann Kleint
7c0884f2a2 Windows code: Fix clang-tidy warnings about else after jumps
Replace by switch() where appropriate, remove else and unindent code
or simplify the return value.

Change-Id: Ie988b9068a9579ae5a899b3765e43aad480b564e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 12:41:07 +00:00
Friedemann Kleint
30756f4626 qelapsedtimer_win.cpp: Fix clang-tidy warning about else after return
Remove else in nelper nanosecondsToTicks()

Change-Id: I6c5291deaeb6651f702a9c118cabcb5a7edd179e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 12:39:36 +00:00
Friedemann Kleint
9a15ac356c Windows code: Fix clang-tidy warnings about (private) class definitions
Add override, disable copies where appropriate and use = default
for trivial functions.

Change-Id: Ia5bc7419b1aa053c5503ea7dfaf11cb6dfafd2e2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-02 12:39:12 +00:00
Qt Forward Merge Bot
ae868dfbdc Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I33e0abc771a2a772d3334172d50e7b0efe896590
2018-09-02 01:00:15 +02:00
Andre de la Rocha
4c4a5f8c86 Windows: Check Pointer messages in MessageDebugEntry
Some Pointer Input messages are defined only for Windows 10 and new
versions of the Windows SDK and could break compilation with older
SDKs. Currently, they are not used anywhere outside of the
MessageDebugEntry debug function. Checking if they are defined before
using.

Change-Id: I5fc7bb8e52ab8aca66bb21084289ab8938938063
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-09-01 22:51:07 +00:00