Commit Graph

36292 Commits

Author SHA1 Message Date
James McDonnell
c23f23a739 Add support for _q_platform_qnxWindowType QWindow property
This dynamic property can be used to specify an explicit QNX window
type for a QNX platform window.  The _q_platform_ prefix makes it
possible to place the property on QWidget objects instead.  Existing
functionality ensures that any QWidget property whose name begins with
_q_platform_ is copied to the underlying QWindow object prior to
creation of the platform window.

Add _q_platform_ aliases for the dynamic qnxInitialWindowGroup and
qnxWindowId properties so that these properties can be also be
specified on QWidget objects.

Change-Id: Ia37a965dd25de333307b2bb5ae81446db271af1f
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Dan Cape <dcape@qnx.com>
2018-06-05 19:35:47 +00:00
Timur Pocheptsov
59df474e13 QSslSocket - bail out early if TLS initialization fails
No need to start with 'connectToHost' from 'connectToHostEncrytped'
- we will fail to start client encryption later anyway. This can happen
if we, for example, fail to resolve some symbols or libraries are missing.

Task-number: QTBUG-65142
Change-Id: I0614d5cdf875aaf5b992d8ab6024bcaf3f84b915
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-05 13:48:16 +00:00
Tor Arne Vestbø
301970018c macOS: Make sure QNSPanel also gets a debug description
Change-Id: I5de08c3493b02a8e98ba3c4fe3922f5f9fd6e2c2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-06-05 13:44:22 +00:00
Tor Arne Vestbø
2071d26a34 macOS: Deliver screen changes synchronously
Change-Id: Iea8fcb69b6c05c4f81fedb4ec423aed89d9d2d3c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-06-05 13:44:21 +00:00
Kari Oikarinen
eb5c9a1f2a testlib: Mark unused member variable for future removal
inLoop is only set, never read and it is private. Since the class is public, it
can't be removed yet, but add a comment so that it will be removed when
possible.

Change-Id: I5e212194cb65626fce2b4c7b68801a73dbe3f500
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-06-05 06:00:32 +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
Thiago Macieira
9998654eac Examples: use CBOR in the network-chat broadcast message
Instead of sending one @-separated message, send one CBOR message. The
message structure is, using the CBOR Data Definition Language:

  broadcast = [
    username: tstr,
    port: 0..65535
  ]

Change-Id: Ic38ec929fc3f4bb795dafffd150ac2614d18c6bf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-06-02 03:11:33 +00:00
Thiago Macieira
bfcb8c6dca Examples: change the main network-chat protocol to CBOR
This complements the previous commit, which changed the broadcast
datagram to CBOR. This commit changes the TCP protocol too. The protocol
is an infinite array of commands, each of which is a map from an integer
(the DataType enum) to either a string or null.

The entire state machine for the connection is rewritten, relying on
QCborStreamReader's ability to deal with incomplete data.

Change-Id: Ic38ec929fc3f4bb795dafffd150ac674c32fac87
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-02 03:11:30 +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
Martin Smith
e3e0a6d6d6 doc: Document Qt namespace in multiple modules
qdoc didn't handle this. This update fixes most of what was wrong,
but tuning the details of the namespace reference pages might follw.
We have namespace Qt as an exaqmple. Most of the elements in the Qt
namespace are in QtCore, but a few functions are declared in QtGui.
Before this update, qdoc used the hack of using #ifdef to remove the
declarations from qtextdocument.h in QtGui and .cpp and then added
them back into qtnamespace.h and .cpp in QtCore.

Now that hack is no longer necessary. The functions in the Qt namespace
that are declared in QtGui are documented there, but the documentation
is linked to from the namespace reference page, which remains in QtCore.
That is, only one \namespace command is used to document the Qt namespace,
and it appears in qnamespace.qdoc where it always did, but the documentation
for the Qt namespace functions declared in QtGui is now appears in
qtextdocument.cpp where it belongs.

Change-Id: Ic5888875c3b8310a3dba244475e2a6c3bc0c1808
Task-number: QTBUG-67267
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-01 16:38:01 +00:00
Thiago Macieira
e1b40675ba Fix warning about tautological comparison in 32-bit mode
qwaitcondition_unix.cpp:209:14: error: comparison of constant 9223372036854775807 with expression of type 'unsigned long' is always false

Task-number: QTBUG-68568
Change-Id: Icc2c231dc2c44abdb087fffd1533c70ae68060dd
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-01 09:12:47 +00:00
Allan Sandfeld Jensen
dc2476c75e Fix clang develop build
A mismatch of enums after a rename.

Change-Id: Ib28e4607f20583afcb9210fdef7f52d95c63e3dd
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-05-31 21:35:01 +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
Edward Welbourne
2d3bbd7f17 glextensions.h: simplify #if-ery to avoid conflict
The prior #if-ery was needlessly confusing; and most of it was
redundant anyway.

Change-Id: I82da1b38c08b93b9dc2220dd7b15ecb7dcc002af
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-31 15:51:55 +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
Tor Arne Vestbø
c538a333db macOS: Make layer-backed mode the default
QWindows are still backed by NSViews, but these views render to a
CoreAnimation layer instead of directly to the top level NSWindow.

This is the direction Apple is going (and is the only available
option on iOS/tvOS), so we want to move away from the existing
code path as soon as possible.

The default can be reversed by setting QT_MAC_WANTS_LAYER=0, or the
_q_mac_wantsLayer property on QWindow.

[ChangeLog][macOS] Layer-backed mode is now the default for QWindow.

Change-Id: Ibb9cc7541b179cad215d0daee14aeb1b54be614c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-05-31 15:50:33 +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
Mikhail Svetkin
c9d593d431 macOS: minor refactoring in mouse handlers for nsview/systemtrayicon
Use new helper functions for mouse events

Change-Id: I01e83a228deb16cbdb1d7c8c628a92d48055ee2b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-31 15:49:50 +00:00
Edward Welbourne
78ac98a590 Remove LGPL_EXCEPTION.txt
It became obsolete when we switched to LGPL3, as discussed on the
developer mailing list in April 2017.

Change-Id: I8445a0e6febba8b31a95fbc140343c2013776b48
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-31 15:46:36 +00:00
Friedemann Kleint
3d841556bf Windows QPA: Fix release button event type after moving windows
Check whether the mouse is inside the window and report
MouseButtonRelease or QEvent::NonClientAreaMouseButtonRelease,
respectively. The inside case is triggered by programmatically
starting a size move via QPlatformWindow::startSystemResize()
(QSizeGrip) and was overlooked in
7c3ecf85a7.

Complements 4589440891,
7c3ecf85a7.

Change-Id: I8f714dc768a163878c2b4a075470bcee2dfbd802
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2018-05-31 14:41:06 +00:00
Thiago Macieira
b9935239db QCborStreamReader: rewrite read{String,ByteArray}()
This rewrites _readString_helper() in terms of _readByteArray_helper()
(the helper version doesn't do type-checking) and rewrites
_readByteArray_helper() in terms of readStringChunk().

Change-Id: Iab119b62106d40fb8499fffd1510aa404d9f3611
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-30 19:49:01 +00:00
Liang Qi
a4d7535f19 Fix missing override warning for android
This amends 8447f5f006.

Change-Id: Idd25c13735539682f6034724df4c79fcf10a1810
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-30 15:01:00 +00:00
Tor Arne Vestbø
b6fcc86101 macOS: Minor metal support nits/cleanups
Change-Id: I840426ebf35b0fec64e92386fc3e1cabd91ced25
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-30 14:38:53 +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
Thiago Macieira
84b39d6ad5 QCborStreamReader: remove the documentation on the validation API
It's not present in this version.

Change-Id: I6a540578e810472bb455fffd1532ac4d49d4b994
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-05-29 11:23:33 +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
Christian Ehrlicher
be45ada035 QToolTip: replace deprecated QDesktopWidget::screenGeometry()
QDesktopWidget::screenGeometry() was deprecated in 5.11 and replaced
by QScreen::geometry()

Change-Id: I23f5b6a4ed6b76cf558cd8d3ad49bc8029c16f61
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-28 17:22:50 +00:00
Nico Vertriest
42e4a6531d Doc: Update Echoplugin Example
- screenshot
- connect syntax

Task-number: QTBUG-60635
Change-Id: I18c3e1fef5c623565bbf6cf33bf88e9d8135d8be
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-28 12:38:07 +00:00
Thiago Macieira
2457b1381b Example: add a simple CBOR dumper tool
This is useful as well when trying to figure out what a CBOR file
contains or how it may fail to parse.

Change-Id: Ic38ec929fc3f4bb795dafffd150ad7c0bd8e9887
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-05-28 11:36:54 +00:00
Nico Vertriest
35e31149c2 Doc: Update Fetchmore example
- minor edit
- updated screenshot

Task-number: QTBUG-60635
Change-Id: I988ad28723131127eee0a93671b0562d8f446139
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-05-28 10:19:06 +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
Thiago Macieira
0619055430 Import TinyCBOR
This does not match any upstream version, but rather the "dev" branch at
https://github.com/thiagomacieira/tinycbor/. I've found myself
completely out of time to finish developing the TinyCBOR buffer
integration and zero-copy support.

Change-Id: I9741f017961b410c910dfffd150133cbf6fbe678
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-27 22:41:38 +00:00
Joerg Bornemann
5968a445e1 QProcess/Win: Use ConnectNamedPipe asynchronously and check return value
According to the documentation of ConnectNamedPipe we must pass an
OVERLAPPED object, because the passed handle was opened with
FILE_FLAG_OVERLAPPED.

Pass an OVERLAPPED object, and create a manual reset event that is
waited on if ConnectNamedPipe "fails" with ERROR_IO_PENDING.

Check the return type, and report any failure via qErrnoWarning.

Change-Id: Iedd702cecc2f0008eee6ed4f19d9370912190595
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-26 19:42:34 +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
Liang Qi
8050f1c287 Fix build for Android with android-clang
kernel/qnetworkinterface_linux.cpp:204:17: error: comparison of integers of different signs: '__u32' (aka 'unsigned int') and 'qsizetype' (aka 'int') [-Werror,-Wsign-compare]
            if (NLMSG_OK(hdr, len))
                ^~~~~~~~~~~~~~~~~~

This amends 09cb23f342.

Change-Id: Ib966a60b7a7117d63ed758cba7b556abd90eca0c
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-25 14:52:47 +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