Commit Graph

9006 Commits

Author SHA1 Message Date
Qt Forward Merge Bot
3d2832790a Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: If1baf48f0f396fb223672d14f0e1847ac42ca1a6
2018-09-10 01:00:42 +02:00
Christian Ehrlicher
85917c4b72 Autotests/QItemView: re-enable tst_QItemView::indexAt()
tst_QItemView::indexAt() was disabled since Qt 5.0 (and maybe earlier)
maybe due to it's long runtime (15s on my machine).
Speed it up by checking only some special positions inside the visual
rect (borders, center) as it will likely not fail on other positions but
succeed for the ones which get tested.

Task-number: QTBUG-22470
Change-Id: I5c7135757049176f9daca4afc1b7f40c75b9ecd9
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-09 12:04:15 +00:00
Christian Ehrlicher
ef40cad3a9 QTableView: Fix PageUp not getting to top when first row is hidden
When the first row(s) of a QTableView is hidden, PageUp could not reach
the first visible row because logicalRow(0) is taken without checking
if the row is visible.

Task-number: QTBUG-70215
Change-Id: Ic7820352b8988accb685ea7d16908d3fa8bf2847
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-09 12:03:55 +00:00
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
f21330b749 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I799e2ca2fefa140c8b73b73aa959c6ed8da6eae6
2018-09-07 01:00:48 +02:00
Tor Arne Vestbø
5ed48895b6 tst_qglthreads::swapInThread(): Acquire context before resizing widget
Otherwise the QGLWidget's context may be owned by and used by the swap
thread when the resize happens on the main thread.

Change-Id: Id415747572e6b988924618b1df0efdee5fcb1805
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-06 12:42:06 +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
Olga Radko
c88305b68d QSortFilterProxyModel: add test for inserting via a QComboBox
This new test double-checks the bugfix for QSortFilterProxyModel::insertRows
in commit 70ba75519d. Previously, when using QComboBox on top of
QSortFilterProxyModel and calling QComboBox::addItem with row==rowCount(),
an empty item was inserted in one place, and then another item was modified
(instead of the inserted empty one). This test checks that the above bugfix
indeed fixes the behavior of QComboBox::addItem when used in this manner.

Task-number: QTBUG-69158
Change-Id: Id01345e0525694a57250c656222d626e2267aa8e
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 05:56:18 +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
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
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
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
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
Thiago Macieira
7bd79b3cff Plugins: Save some architectural requirement flags
...not just the debug flag. The information is saved outside of the CBOR
map for two reasons:

 1) removing the hack that depended on how QCborStreamWriter and
 TinyCBOR internally work, allowing for the extra parameter to be
 written directly. We wouldn't be able to use that hack anyway and would
 have needed a further, uglier hack to encode a byte whose value we
 don't know.

 2) outside the map, this information can be parsed more quickly and
 then we can discard any plugins we shouldn't actually load.

Since we're doing this for a flag, I decided to move the Qt version
there too for reason #2.

Change-Id: I61ecce6b1324410bbab4fffd153d4e5fc696d19e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-09-01 15:19:46 +00:00
Thiago Macieira
d9766ddc3d Plugins: store the metadata in CBOR instead of binary JSON
In preparation for Qt 6 deprecating the binary JSON format. Also reduces
the size of the metadata a little: for the xcb platform plugin, it went
down from 264 bytes to 138; for the jpeg image plugin, it went from 320
to 135.

I've had to change the signature so older versions of Qt won't try to
parse the CBOR data as Binary JSON. Unfortunately, before QJsonDocument
could get a chance to reject it, qJsonFromRawLibraryMetaData() needed to
allocate memory and that causes crashes with Qt < 5.11.2.

Change-Id: Ieb48f7c0dd0e4e0fb35efffd153bee34e16ce347
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-01 15:19:39 +00:00
Tor Arne Vestbø
917c2de203 Disable tst_macnativeevents
It's almost completely blacklisted anyways, and the parts that are
not are flakey.

Change-Id: I4601d751a2963c94c62ec439dd78b874034069a0
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-08-31 12:35:45 +00:00
Tor Arne Vestbø
b02fe1bfe7 Remove codepaths and checks for unsupported Apple platforms
We no longer support macOS 10.11, iOS/tvOS 10, or watchOS 3.

Change-Id: Ide03d8fac06185ef4162ba75ee54a0adf6916905
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-31 12:35:45 +00:00
Friedemann Kleint
f9431f5632 Fix tst_QSizePolicy::constExpr() to compile with MSVC 15.8.1
For ControlType != QSizePolicy::DefaultType, qCountTrailingZeroBits()
is used which, MSVC 15.8.1 does not consider constexpr due to built-ins.
Exclude the check by #ifdef.

Task-number: QTBUG-69983
Change-Id: Ifc3dc3d94a804246bee1705fc8f3ac9b04ee4d32
Reviewed-by: Alexander Shevchenko <sav_ix@ukr.net>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-30 06:23:51 +00:00
BogDan Vatra
19b12ac9c2 Update QMetaObjectBuilder::MetaObjectFlag enum
Synced QMetaObjectBuilder::MetaObjectFlag with the MetaObjectFlags enum
from qmetaobject_p.h. Also added a few comments for Qt 6.

Change-Id: Ieccd5cf8d512a6bf7256b2f4db88d45662774536
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-08-30 05:12:01 +00:00
BogDan Vatra
c2165f891c Allow registering constructor for a set of dynamic types
This feature is needed to register complex types (e.g. Q_GADGETS) at
runtime, using a single constructor method and added type parameter.
Without having the type id available to the Constructor it is impossible
to specialize behavior, thus requiring separate constructors for each
type. Generating these separate constructors at compile time is easy,
but not at runtime.

[ChangeLog][QMetaType] QMetaType can now register constructor for a set
of dynamic types.

Change-Id: I6071271d0e157864594dd07b4bc3a0abbeb15a44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-30 05:11:38 +00:00
Christian Ehrlicher
81e298a51d QWidget: fix setTabOrder for compound widgets
When adjusting the tab order for compound widgets, it can happen that
the order is already correct. The check for this case forgot one case
which lead to a garbled focus chain.

Task-number: QTBUG-68393
Task-number: QTBUG-69619
Task-number: QTBUG-10907
Change-Id: Ic3242746bdcf3a4db6ea8daa1498381500ca116d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-30 04:25:22 +00:00
Ryan Chu
09f59271e6 Postpone testing docker images and files until running 'make check'
To avoid bothering the user who just wants to build all the test cases
in qtbase. It is better to move the docker related testing to the check
target. Then, it won't break the build procedure and force users to
finish test server provisioning in advance.

Change-Id: I2c4212297342c3eec7bcbebff9f991b7346d9503
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e798e8a03b)
2018-08-30 04:06:51 +00:00
Ryan Chu
e798e8a03b Postpone testing docker images and files until running 'make check'
To avoid bothering the user who just wants to build all the test cases
in qtbase. It is better to move the docker related testing to the check
target. Then, it won't break the build procedure and force users to
finish test server provisioning in advance.

Change-Id: I2c4212297342c3eec7bcbebff9f991b7346d9503
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-29 14:29:11 +00:00
Tor Arne Vestbø
825e1a0506 Add missing dependencies for tst_macnativeevents
Change-Id: I5578b78a90588117339562b65884b7bc46770647
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-08-29 02:47:47 +00:00
Tor Arne Vestbø
ed92be5007 Add missing dependencies for tst_qmacautoreleasepool
Change-Id: Idf94d419526f02e89608b1d105a0858bceabbba1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-08-29 02:47:45 +00:00
Oswald Buddenhagen
a25ee4c1ce darwin: fix tst_qsettings deps
the test uses CoreFoundation api directly, so it must link it
explicitly.

amends 6c8f32388b.

Change-Id: I76b7d8ab41d6a66138eb45bd0f067cfee8e96cb8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-29 02:47:41 +00:00
Oswald Buddenhagen
fa6bab9c58 darwin: fix tst_qimage deps
the test uses CoreGraphics api directly, so it must link it explicitly.

amends b0abe20d4.

Change-Id: I734bfbedff56df731c1e528670f686565b63f3b5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-29 02:47:39 +00:00
Qt Forward Merge Bot
e1c2183374 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Ifb032dc19053481e1b0ede5c5c72540110d62567
2018-08-29 01:00:40 +02:00
Joni Jäntti
546eb7b947 Blacklist tst_Gestures on Ubuntu 18.04
These autotests are not currently working with the Ubuntu 18.04
platform being introduced to the CI.

Task-number: QTBUG-70227
Task-number: QTBUG-70226
Task-number: QTBUG-70224
Task-number: QTBUG-70223
Task-number: QTBUG-70209
Change-Id: Ibe7cafd37763d7d305d8c3d9ec17bc6339db744a
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-08-28 16:30:28 +00:00
Andy Shaw
28702cb239 Initialize the QSqlQuery to be invalid when creating a sql model
When QSqlQueryModel or QSqlTableModel is created it will create a
QSqlQuery which defaults to using the default QSqlDatabase connection.

If this connection belongs to another thread then it will throw a
warning as this is not safe to use. Since the QSqlQuery is always
recreated when a query is set, the instance which is a member of
the class can effectively be invalid until a new one is set.

Task-number: QTBUG-69213
Change-Id: I68a5dd59fe62788f531d59a0680da11b118ee383
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-28 16:10:30 +00:00
Mikhail Svetkin
6b4e603c62 corelib/tools: Fix auto detection of QOffsetStringArray::m_offset type
The previous implementation wrongly calculated the necessary data type
to hold the offset indexes. It looked at the amount of elements,
but instead we should look at value for the last element in the offset
array

Change-Id: I84c6985dc3c329df3bbc5a14f9789170877b65bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-28 14:42:46 +00:00
Edward Welbourne
89451f5428 Add some missing language codes to our locale data
We were missing a few languages CLDR knew about; so add them to the
list in enumdata.py (and add trailing commas to lists to make future
additions not need to change the prior last line; python is perfectly
happy with this).

[ChangeLog][QtCore][QLocale] Added support for Western Balochi, Ido,
Lojban, Sicilian and Souther Kurdish.

Change-Id: I0d24cff46a0ae8db48ec1db8762088f877319982
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-08-27 14:38:44 +00:00
Mikhail Svetkin
f0066cae8f corelib/tools: Add QOffsetStringArray API
This function allows to generate an array of offsets of substrings in
a string at compile time. This produces less verbose and easier to maintain
source code.

Change-Id: I5774b8b91906f6191f2b1244a676c07e7eb15b47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-27 10:33:46 +00:00
Shawn Rutledge
112c0632d9 tst_QLocale::formattedDataSize: add Russian
The table and macros weren't extensible enough for non-Latin-based
languages.

Change-Id: I950f06de57aaf6bd0b24e0056e4acee2fb655f3d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-26 18:51:48 +00:00
Qt Forward Merge Bot
2cdbe29ef0 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I9c2a18f5110adf3d8f630718238866aef47bb782
2018-08-26 01:00:16 +02:00
Liang Qi
563c9eb4ee Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12 2018-08-25 04:11:12 +00:00
Qt Forward Merge Bot
1d077120f4 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I5f1567c792992fc00f0256f39b76cfbe017e6a3a
2018-08-24 23:59:46 +02:00
Joni Jantti
4d38f22522 Blacklist tst_Gestures::autoCancelGestures2
This autotest fails on the Ubuntu 18.04 platform.

Task-number: QTBUG-70153
Change-Id: I2a2b0075a046664cdf5733d8629f634b4e33dc6f
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-08-24 17:31:09 +00:00
Edward Welbourne
bd42e2f0ce Blacklist two tests on macOS that a planned CI change shall break
We have #if-ery on Q_OS_DARWIN controlling an expectation of gettign
"GMT+1" and "GMT+2" instead of "CET" and "CEST" in two tests; this
turns out to not be a deficiency of macOS so much as of how we
configure Coin's VMs.  While we fix that, we need to ignore failures
in these tests, so that we can pull the #if-ery out and clear the
blacklist once the VMs are set up properly.

Task-number: QTBUG-70149
Change-Id: If3577200cf980b3329161ab3eea7bd2e9d0124e0
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-08-24 17:30:01 +00:00
Mårten Nordheim
01a359b53c tst_qnetworkcookiejar: fix build for without topleveldomain
The test fails in a few cases due to the simplistic internal
implementation of TLD-checking, but it's still useful to run the tests.

Change-Id: Idafaed13506fbac2e67b1d2ba72da2f0c4e2904c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-24 12:25:40 +00:00
Friedemann Kleint
96c202e981 Refactor tst_QFiledialog::clearLineEdit()
The test had some shortcomings:
- Flakyness due to not waiting for the file dialog list
  to be populated.
- It assumed that the hardcoded directory name
  ____aaaa... always would show first in the list. This may
  not be true on Windows, where names like .designer show above.
- On failure, the test directory would leak.

This manifested in failures like:

FAIL!  : tst_QFiledialog::clearLineEdit() '(fd.directory().absolutePath() != QDir::home().absolutePath())' returned FALSE. ()

To fix this, use QTemporaryDir and introduce predicates that
can be used to check whether the dialog has been populated
and the right file/directory is selected by pressing cursor down.
Use the temporary directory as not to pollute the home directory.

Change-Id: Ic504b91325993dcd6099c99e125e7ed8ff1d7672
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-24 12:00:31 +00:00
Edward Welbourne
8a270dee2b Revert "Fix time-zone tests on macOS >= 10.13, which now knows what CET is"
This reverts commit fd38c97a6c.
Apparently our actual VMs for 10.13 don't get this right, although the
ones used in testing did (prompting the fix this reverts).  We
probably have mis-configured VMs, but this is the quick-fix to get
development moving again.

Task-number: QTBUG-70149
Change-Id: Ib96755d8e21d9b226e22fc985f13f34fa04117b1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-08-24 11:05:38 +00:00
hjk
d9e2bd5388 rcc: Add some tests
- three more tests cases on expected .qrc generation
- a new test comparing data read via resource with
  the same data directly read from the original file

Change-Id: Ic34e68c9fc3fa110110161b57d4129ae44419020
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-24 08:25:42 +00:00
Qt Forward Merge Bot
b73f1cc045 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I1114f90a2ed04a784a66505960b0f2460778726d
2018-08-23 23:01:15 +02:00