Commit Graph

8203 Commits

Author SHA1 Message Date
Tony Sarajärvi
d2d87e6a9f Extend blacklisting of QSemaphore tests to macOS 10.13
Task-number: QTBUG-58745
Change-Id: Iad16beef04a7b52786b5415944d582d33b1120c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-11 15:07:00 +00:00
Alexander Volkov
649490f359 Add itemAlignment property to QListView
This property allows to change the default behavior in
which list items occupy the entire width of their column.
Setting it to Qt::{AlignLeft,AlignRight,AlignHCenter} will
reduce their widths to the minimum values, thus allowing to
have intermediate free space. Then the user will be able to
begin selections by mouse from this space.

[ChangeLog][QtWidgets][QListView] Added itemAlignment property.

Task-number: QTBUG-56606
Change-Id: Iae55c251379be4e45d0c0d69175ff4388b5785b4
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-08 12:35:15 +00:00
Thiago Macieira
c4ed96513e QCborValue: add support for QVariant and JSON conversions
Plus QStringList.

Change-Id: I39332e0a867442d58082fffd1508dfb9b540af23
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-08 07:46:41 +00:00
Liang Qi
49c9377421 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-06-08 07:46:35 +00:00
Thiago Macieira
92e472302a Long live DOM API for CBOR!
This is very similar to QJsonDocument, but there's no QCborDocument.
QCborValue is that.

[ChangeLog][QtCore] Added QCborValue, QCborArray and QCborMap, classes
that permit DOM-like access to CBOR data. The API is similar to
QJsonValue, QJsonArray and QJsonObject, respectively.

Change-Id: I9741f017961b410c910dfffd14ffca50dd8ef3ba
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-08 07:46:29 +00:00
Liang Qi
096e37910d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	.qmake.conf
	src/corelib/kernel/qeventdispatcher_cf.mm
	src/gui/kernel/qguiapplication_p.h
	src/gui/kernel/qwindowsysteminterface.cpp
	src/gui/kernel/qwindowsysteminterface.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnswindowdelegate.mm
	src/plugins/platforms/ios/qioseventdispatcher.mm
	src/plugins/platforms/windows/qwindowsdrag.h
	src/plugins/platforms/windows/qwindowsinternalmimedata.h
	src/plugins/platforms/windows/qwindowsmime.cpp
	src/plugins/platforms/winrt/qwinrtscreen.cpp

Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
2018-06-07 19:10:53 +02:00
Johan Klokkhammer Helsing
cf41639f84 tst_QWidget: Don't skip tests that are passing on Wayland
Task-number: QTBUG-66849
Change-Id: I35f5bc557fca5289570a6e907c0fd80f17a3aa0f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-07 10:17:41 +00:00
Andy Shaw
af4435c5f8 QLineEdit: Emit inputRejected() when part of the input is rejected
When pasting text, it is possible that part of the text is still pasted
but part of it is not. For example, if there is a maximum length set then
only the first part of the text is pasted and the rest is dropped. In
this case it should still emit inputRejected() as not all of the input
was accepted. This amends c901cdadc0.

Change-Id: If7906767be27e88ed9914c50bf0427833de5b8fa
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-06 19:47:53 +00:00
Thiago Macieira
91e1356335 QCborStreamReader: use QByteArray directly if possible
QIODevice represents considreable overhead, even with just QBuffer, for
parsing simple things. Benchmarking showed it was spending 25% of the
parsing time inside one QIODevice function or another. So this commit
accomplishes two things:

1) it increases the buffer size from 9 bytes to up to 256, which should
   reduce the number of calls into the QIODevice
2) if the source data is a QByteArray, then use it directly and bypass
   the QIODevice, thus increasing performance considerably

Change-Id: I56b444f9d6274221a3b7fffd150c531c9d28e54b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-06 17:48:00 +00:00
Allan Sandfeld Jensen
b46cb00fc0 Handle negative leading in layout
Adjust line positions to deal with negative leading which isn't included
in height of QTextLine.

Change-Id: Id7918968c0f9d7e65700b9e7a08fc5d761883f22
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-06-06 16:59:31 +00:00
Andy Shaw
ae42461f44 MySQL: Handle TIME types as a string to allow the full range of data
As the full range of TIME is '-838:59:59' to '838:59:59' then we cannot
use QTime as the object to store this data in. Therefore a QString is
used instead for passing the data to and from. This does not impact
existing code using QTime already as it will still convert it from
the QString to a QTime to give the same result as before.

[ChangeLog][QtSql][MySQL] The TIME data type is now treated like a
string-based type in order to respect the full range of the TIME data
type.

Task-number: QTBUG-57028
Change-Id: Ieb7105bff3043b845f76bc873d088e6bac1e4f10
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-06 11:14:03 +00:00
Allan Sandfeld Jensen
8c33b79823 Fix HDR format in QOpenGLFramebufferObject::toImage()
If the fbo had samples > 0 set, it would use a temporary fbo with
a default configuration losing the HDR precision.

Change-Id: I7e9966165b3100f148c4ad24738f3ee71273f29a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-06-06 10:48:36 +00:00
Eirik Aavitsland
d9d77e8680 Fix QTransform::transposed() result having wrong transformation type
The implementation of QTransform::transposed() had a wrong assumption
about the type of the result.

Task-number: QTBUG-68630
Change-Id: Ia5ce794efe773d74fb5fdaff3da8cae2b452e7e5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-06 08:59:20 +00:00
Johan Klokkhammer Helsing
eb655b7a1a Skip tst_QWindow::modalDialogClosingOneOfTwoModal without activation
The test doesn't make much sense on platforms that don't support window
activation.

Task-number: QTBUG-66849
Change-Id: I875314d026d666173ec345d0864ad41d66179783
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-06-06 06:30:35 +00:00
Johan Klokkhammer Helsing
b625a01a38 Don't skip tst_QWindow::isExposed on Wayland
The test is actually passing, so just enable it.

Task-number: QTBUG-66849
Change-Id: Ie1566b9e5e19f5ab6d919624aa14662a1d4483ec
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-06-06 06:30:21 +00:00
Johan Klokkhammer Helsing
18bca90441 tst_QWindow: Don't skip tests on Wayland without explanation
Link to a bug report so we can track the failures and figure out how to fix
it in Qt Wayland or if we should skip the tests in a proper way. I.e. with
platform capabilities or similar.

Task-number: QTBUG-66849
Change-Id: I7a16333c7d2284eb9da6efd4515891438e9976b3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-06-06 06:28:52 +00:00
Milla Pohjanheimo
2b8287b666 Add binary compatibility files for 5.11 for QtBase
Binary compatibility files for bic test added

Change-Id: Ie540ea0084c72a6a0ae7c47831ecbcc0dd7030b9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-05 06:00:28 +00:00
Timur Pocheptsov
a217188fe0 tst_Http2 auto-test: stop sending DATA frames if test failed
Unlike QNAM, our toy http2 server sends payload as one big chunk as soon as
it fits in the receive window's size. Internally, 'frame writer' splits this
payload into many DATA frames of the appropriate size (imposed either by the
default value or the one from the client's SETTINGS frame). If some test fails,
we can end up with a server waiting for the writer to send all the DATA frames
though it is not needed anymore - there is nobody to receive them after a failure.
This patch moves such a loop into the test server instead and stops the loop early
if needed.

Change-Id: Iea2dcd718d8f83386fd16004807f6447bf999435
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-04 13:38:04 +00:00
Samuel Gaist
04b180f7f2 Improve std::tuple handling in tests
Currently when doing comparison with std::tuple the fallback toString
method is called which returns a Q_NULLPTR thus not allowing proper
diagnostic of the values that triggered an error. This patch
adds support for std::tuple to improve the tests output readability.

[ChangeLog][QtTest][QCOMPARE] Now outputs contents of std::tuple on
failure.

Change-Id: I046a55e2ce44c3f7728d51e4745120d38aa5e007
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-03 20:26:38 +00:00
Andy Shaw
c901cdadc0 QLineEdit: Add an inputRejected() signal for when a key is not allowed
[ChangeLog][QtWidgets][QLineEdit] Added inputRejected() signal for when
a key press is not accepted by the QLineEdit. For instance, when an
invalid key is pressed for a validator set.

Task-number: QTBUG-57448
Change-Id: I39182a78b07b37c6da01905b8da4c57930e3454b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-01 21:34:03 +00:00
Edward Welbourne
6c3603f2ad Eliminate an un-needed #include
Nothing in this test references date-times.

Change-Id: I4005cda550d54abe46370963b1e91fab9829298d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-31 15:52:20 +00:00
Tor Arne Vestbø
c4a21708ed Provide presets for QGradient
Similar to Qt::GlobalColor, the presets allow the user to create
brushes based on predefined gradients, quickly getting pretty pixels
on screen.

The presets are based on the linear gradients from WebGradients, a
free collection of gradients, hosted at https://webgradients.com/.
The few radial and blended gradient presets have been excluded.

Change-Id: I1ce8f2210a6045c9edb8829ab3eddcc313549127
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-31 15:50:50 +00:00
Edward Welbourne
af928dd160 tst_qstandardpaths: #if-out a function only used within #if-ery
Avoids an unused function warning.

Change-Id: Id221595920e9a34eb83b66fe123d664f60fcae05
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-05-31 15:50:17 +00:00
Allan Sandfeld Jensen
d517d5428c Use qFuzzyCompare instead of qFuzzyIsNull in QPointF ==
qFuzzyIsNull has a fixed range, where qFuzzyCompare can tell if numbers
are different in a more relative range. Without it QPointFs that are
heavily scaled will be interpreted as identical, when they are quite
different at their own scale.

Task-number: QTBUG-60359
Task-number: QTBUG-62161
Change-Id: Ic4ba90e9e994aedff5548d690f053eb309b0a60b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-30 08:28:11 +00:00
Andy Shaw
b92db8a4ad Show the display role inside the editor for the relation in a QComboBox
When a QComboBox is used as the editor for a relation inside a view then
it could end up showing the contents of the EditRole. This would be the
field which is used to represent the entry as opposed to the DisplayRole
which is what the user would expect to see is.

Therefore, setEditorData() is overridden to ensure that it is showing
the right data to the user. When the model gets updated, it will take the
corresponding EditRole value as before to ensure it is updated correctly.

Task-number: QTBUG-59632
Change-Id: Ibbccc3e9477de1cdefb654051b97dd111df36382
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-05-29 22:08:28 +00:00
Joerg Bornemann
9f27bfb31a Make sure we can build with -no-feature-draganddrop
We move QInternalMimeData to a separate file, because this class is
used, even if draganddrop is disabled. From now on, include
qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData.

Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-05-29 18:31:35 +00:00
Mikhail Svetkin
6b98d97670 macOS: Fix QFileSystemWatcher to watch paths with the same prefix
It happens because our filesystemwatcher thinks it is subdirectory and not
two different paths

Task-number: QTBUG-60676
Change-Id: Ic753e9481cb26303a030044e0a5ab4d703bc529f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-05-29 06:32:46 +00:00
Qt Forward Merge Bot
875731368a Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8d8b03ea46c537b091b72dc7b68aa6aa3a627ba6
2018-05-29 01:00:09 +02:00
Christian Ehrlicher
2843c58e5f Tests: replace deprecated QDesktopWidget::screenGeometry()
QDesktopWidget::screenGeometry() and similar was deprecated in 5.11
and replaced by QScreen::geometry()

Change-Id: Ic630d022bc6461af78f49684c8ac9d1836d738bc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-28 17:22:59 +00:00
Oliver Wolff
a298fa3786 winrt: Skip/blacklist failing opengl tests
Task-number: QTBUG-68297
Change-Id: I1396b658b49baf5a8d4b97e35c22ddc25727b68a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-28 08:36:55 +00:00
Oliver Wolff
0acd59153c winrt: fix tst_QFocusEvent
Change-Id: Ib2e82554c09a88a20fd789213a3040d6c6e42383
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-28 08:36:52 +00:00
Oliver Wolff
35d8c23a1f winrt: Make tst_qfocusevent pass in CI
Task-number: QTBUG-68297
Change-Id: I72d668103b86e26b15c0b818f87a58ae2ffe2d31
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-28 06:50:49 +00:00
Oliver Wolff
cfe019f90a Fix tst_qtextedit for configurations with builtin testdata
Change-Id: Ic692acd8053a02270416deb1be3d58a5f0424526
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-28 06:50:48 +00:00
Oliver Wolff
8d3e7eb259 Fix tst_qcombobox for configurations with builtin testdata
Change-Id: Id3a1166428873618b253989da98ccdbe13afd1a0
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-28 06:50:47 +00:00
Oliver Wolff
ed2754a56d winrt: make graphicsview auto tests pass
Task-number: QTBUG-68297
Change-Id: I627f9be20670d8e00f824ae85139fb1c4088033c
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-28 06:50:46 +00:00
Oliver Wolff
56b3446ca6 winrt: Remove qfiledialog and qmessagebox auto tests for now
Task-number: QTBUG-68297
Change-Id: Ie126d07edfcdcec179c38d03e79079339d29020b
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-28 06:50:45 +00:00
Thiago Macieira
81cc806e26 Long live QCborStreamReader!
This is the counterpart of the previous commit.

[ChangeLog][QtCore] Added QCborStreamReader and QCborStreamWriter,
classes for low-level reading and writing of CBOR streams.

Change-Id: Ia0aac2f09e9245339951ffff13c72e4bffdf4a56
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-05-27 22:41:49 +00:00
Thiago Macieira
e3cb38b06a Long live QCborStreamWriter!
CBOR is the Concise Binary Object Representation, a very compact form of
binary data encoding that is compatible with JSON. It was created by the
IETF Constrained RESTful Environments (CoRE) WG[1] and has since been
used in many new RFCs by that group, especially COSE[2], and is meant to
be used alongside CoAP[3].

This API is a very simple, thin wrapper around TinyCBOR[4].

See RFC 7049 <http://tools.ietf.org/html/rfc7049>.

[1] https://datatracker.ietf.org/wg/core/charter/
[2] https://tools.ietf.org/html/rfc8152
[3] https://tools.ietf.org/html/rfc7252
[4] https://github.com/intel/tinycbor

Change-Id: Ia0aac2f09e9245339951ffff13c651cfeab77d3b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-05-27 22:41:41 +00:00
Igor Mironchik
03ab94b0e7 Deregister QTextCodec on destruction
QTextCodec automatically deregisters on destruction now.

[ChangeLog][QtCore][QTextCodec] QTextCodec automatically
deregisters on destruction now.

Task-number: QTBUG-56203
Change-Id: Ic9a66c512642c9913aa27ea5167b9f7341e7f0fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-26 18:50:24 +00:00
Christian Ehrlicher
e15fc26e9f QSortFilterProxyModel: don't assert when old model gets destroyed
When a new model was set with setSourceModel() and the mapping was
built up, the destruction of the old model caused a reset in the
QSortFilterProxyModel which lead to an empty view or an assertion.
Now we properly disconnect the old model again and also clean up the old
mapping/persistent indexes when a new source model is set.

Task-number: QTBUG-44962
Task-number: QTBUG-67948
Task-number: QTBUG-68427
Change-Id: I2e0612899c210bde3ac0cfa59aefd78269deee5b
Reviewed-by: David Faure <david.faure@kdab.com>
2018-05-26 11:24:53 +00:00
Oliver Wolff
d4349f1acd tst_qapplication: Fix test for configs without process support
Change-Id: If591183cd246b852821fcf8e354f5247aa7ba373
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-25 11:02:24 +00:00
Oliver Wolff
f86a894527 winrt: Make widgets/util auto tests pass
Task-number: QTBUG-68297
Change-Id: I12d2a431f927b29c4df2b3a6ddd3e5978916e136
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-25 11:02:23 +00:00
Oliver Wolff
de0a210eb0 tst_qapplication: Fix auto test for configs with builtin_testdata
Change-Id: Ie5b4dad19387c18e0d11d44b9b1a735269ec5e04
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-25 11:02:22 +00:00
Oliver Wolff
2d37360e01 winrt: Make widgets/styles auto tests pass
Change-Id: I5224d1cb4bb9ccc82d6c36ccacbd8af7a9bec0ad
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-25 11:02:21 +00:00
Oliver Wolff
3599ea99c9 winrt: skip accessibility test
Task-number: QTBUG-68297
Change-Id: Idfe86a21842982a775c9774f3e431789a7dc07a8
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-05-25 11:02:19 +00:00
Liang Qi
f82e508516 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	mkspecs/features/qt_common.prf
	src/corelib/tools/qstring.cpp
	src/plugins/platforms/windows/qwindowsmousehandler.cpp
	src/widgets/widgets/qmainwindowlayout_p.h

Change-Id: I5df613008f6336f69b257d08e49a133d033a9d65
2018-05-24 16:29:14 +02:00
Friedemann Kleint
f74d4fb1da tst_qpicture: Remove dependency on widgets
Use the screen resolution obtained from QScreen instead
of QDesktopWidget.

Change-Id: If27bcf1c94a783c4c617d5364846b95a625bb93d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-24 10:35:43 +00:00
Nathan Collins
2d1e1f569b Apply Qt::ControlModifier to all spin box interactions
A step modifier already existed when scrolling with the
Qt::ControlModifier held. This patch applies this functionality to
other methods of stepping a spin box.

Holding the modifier increases the step rate when:
- scrolling;
- pressing the up/down keys;
- pressing the spin box up/down buttons.

[ChangeLog][QtWidgets][QAbstractSpinBox] The Qt::ControlModifier
increases the number of steps a QAbstractSpinBox takes for the
following interactions: scrolling, up/down keyboard keys and the spin
box buttons. Previously, Qt::ControlModifier only affected scrolling.

Task-number: QTBUG-67380
Change-Id: Icc8754d5c007da0771bfaef113603a2f334dd494
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-05-24 09:44:16 +00:00
Nathan Collins
4180e6be88 Fix build with --no-feature-wheelevent
tst_QListView::horizontalScrollingByVerticalWheelEvents failed to
compile with this qmake argument.

Change-Id: I35dd4ad4c9ee92c06c94b21dd7325aee00fc98d4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-05-23 19:26:09 +00:00
Allan Sandfeld Jensen
bd74b624d5 Improve bounding rect of QStaticText with Qt::PlainText
The bounding rect was not including positive leading of the last line. This
patch solves it by changing using QTextLine's setLeadingIncluded, and adds
handling of negative leading to keep rendering unchanged in that case.

Change-Id: I4d18b81892184bb85cd7949a5dc3fb9cfa270a26
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-05-23 09:52:30 +00:00