Commit Graph

36362 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
Thiago Macieira
43e85057c4 QUrl: speed up FullyDecoded decoding of data with SIMD
If the data stored in QUrl has no percent-encoded sequences and the user
requested FullyDecoded mode (the default), then we can speed up the
check for percent-encoded sequences with SIMD. This commit adds support
for both SSE2 and AVX2.

Change-Id: Ib48364abee9f464c96c6fffd152e200baa9fbd8d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-06-11 15:06:57 +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
Giuseppe D'Angelo
6c566e506b Code tidy: replace a for loop with an algorithm
Change-Id: Ie988101eb3165b92c5f4a140e4c301b9a46263bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-08 11:36:07 +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
Allan Sandfeld Jensen
95e6ab3329 Optimize fetchTransformed and removed specialized versions
Optimize the general transformed fetcher and use it to replace several
specialized copies of it that are now slower than the general one.

Change-Id: Ife79ec99227f0df4f127303c7a340b2f7d174dff
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-06-07 10:37:43 +00: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
Giuseppe D'Angelo
fda95aa0dd QDialog::done(): improve the docs
Explain that finished() will also be emitted.

Change-Id: Ic6b55fee8b3af59d989e074e52da7a4398a3052a
Reviewed-by: hjk <hjk@qt.io>
2018-06-07 09:59:44 +00:00
Giuseppe D'Angelo
73c3185edb Docs: remove a repetition
The same sentence was written immediately before.

Change-Id: I1de439e43adf24e9afac3ca045372059a2e3ab8f
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-06-07 09:59:29 +00:00
Thiago Macieira
88eda007a3 Revert "qsimd: remove support for systems without 64-bit atomics"
This reverts commit 6e1190053d.
We had to bring back qatomic_msvc.h for MSVC 2015, which does
not provide 64-bit atomics on 32-bit platforms.

Task-number: QTBUG-68719
Change-Id: Iea902cf0b01191717e0a640944771fcede7b5ff8
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-06-07 09:08:36 +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
Jan Grulich
792298e42d Keep native file dialog updated with current options
When doing calls on native file dialog, we might end up calling an
implementation which will cause crash in case we don't have all options
loaded in the native file dialog. Imagine scenario when you want to save
a file, it sets acceptMode() to QFileDialogOptions::AcceptSave, which is
set to our flatpak file dialog, but not passed through to the native one
loaded inside. Then method calls like selectFile() might crash, like
in case of Gtk3 dialog, because its implementation asks for acceptMode,
but it's not set yet and thus we end up with crash.

Change-Id: I7a4239cb8b46ff6b08e2cfc1dd6abb9d9600aef8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-06 18:05:18 +00:00
Thiago Macieira
85a771b89d QCborStreamReader: update to the new TinyCBOR zero-copy string API
Change-Id: Iab119b62106d40fb8499fffd1510abe5d8f2722a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-06 17:48:02 +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
Giuseppe D'Angelo
adf50269e7 De-inline QCoreApplication::send(Spontaneous)Event
There's no clear reason for these functions to be inline;
this prepares a tracepoint hook.

Change-Id: I3a6110a9333db4850c1d97038d5bfae8ab25d5d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-06 17:43:10 +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
Andre de la Rocha
b72a9cbaaf Fix PDF rendering of strokes with cosmetic pens
The PDF backend was ignoring the cosmetic attribute for certain pens,
resulting in strokes rendered incorrectly.

Task-number: QTBUG-68537
Change-Id: Ib9fd5a510716056c8afe67733f51fc682bbb7354
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-06-06 16:54:20 +00:00
Simon Hausmann
bf1f17364f Add note about calling invokable functions from QML when returning QObjects
Link to the data ownership section of the QML documentation to elaborate
on the special rules that apply for invokable functions that return
QObjects.

Change-Id: I41ea9089468c9505807cf1fde22be759b397a6d3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-06-06 16:41:51 +00:00
Andre Hartmann
a14a943f9a Examples: Cleanup and modernize Plug&Paint
* Use C++11 member init
* Use auto where appropriate
* Replace foreach with range-for
* Replace last Qt4-style connects
* Sort includes to common style
* Fix some Clang warnings

Task-number: QTBUG-60635
Change-Id: I61c98b34b954e416dd175b56ca589125217083de
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-06 11:55:44 +00:00
Liang Qi
62abbe34b8 Fix build for Android with android-clang in r17
Task-number: QTBUG-67464
Change-Id: Ib971a5da82b31bce9ac1c9ac623ad7d5302cfaec
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-06-06 11:36:33 +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
Paul Wicking
afdb675ada Doc: Clean up SQL Example: Books - whitespace edition
Remove whitespace for consistency.

Task-number: QTBUG-68652
Change-Id: I1ca1f449db2352cb96c88535936f2c44392693cf
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-06 09:47:21 +00:00
Paul Wicking
fcbfa534fa Doc: Clean up SQL example: Books (part 2)
Improve readability, enforce consistent code formatting.

Task-number: QTBUG-68652
Change-Id: I7bbe0b2baa6273e0133df84d7c3cc2aa6a0b6ff2
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-06 09:47:11 +00:00
Paul Wicking
ce7cbcc3b6 Doc: Clean up and modernize SQL example: Books
* Replace Qt4-style connects.
* Reformat code to adhere to 80 column width.
* Touch comments to make location and style consistent.
* Rename a label in the UI form.

Task-number: QTBUG-68652
Change-Id: Icc592f7b5a013d1806bc36c45057b35472b6efbb
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-06 09:46:49 +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
Andy Shaw
6108d8f515 ibase: Silence warning about incompatible function types
Task-number: QTBUG-68330
Change-Id: I1bb272ec647f9fb5f67f67f04600e51409ebd40a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-06-06 07:18:36 +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
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
Topi Reinio
314b7184aa Doc: Use index.html as the home page reference
QDoc links to the homepage in the navigation bar; use
index.html for linking instead of "Qt $QT_VER" to prevent
incorrect links to section titles that clash with that
string.

Task-number: QTBUG-62484
Change-Id: I53ced31b7ce35d69579a8c70cbc475e306fd3b18
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-06-05 15:48:46 +00:00
Nico Vertriest
7b74b4fbec Doc: Update connect syntax Plugandpaint Example
Task-number: QTBUG-60635
Change-Id: I354a0886b22c63be57bd927308163abd3246be77
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-05 15:02:05 +00:00
Sergiy Korobov
7b79798275 Fix QWindowsWindow::requestActivateWindow()
QWindowsWindow::requestActivateWindow() does not work correct if
QWindowsWindowFunctions::AlwaysActivateWindow is passed as a parameter
to QWindowsWindowFunctions::setWindowActivationBehavior().
When the calling process is not the active process, only the taskbar
entry is flashed. It is not correct. The window should be always
activated, even when the calling process is not the active process.

Task-number: QTBUG-37435
Task-number: QTBUG-14062
Change-Id: I7a321d7bac744a7776278210b1b5a2fd4288aa43
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-06-05 14:41:21 +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
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
Gabriel de Dietrich
23ae05cf68 QMacStyle: Fix clipped arrow in QToolButton
A quick and reasonable fix is to make sure the arrow fits in
SC_ToolButtonMenu returns. In the future, we should keep the
arrow's actual size and offset the icon accordingly.

Change-Id: I218fa7726efbe4576a72889c41685de87ac14ac1
Task-number: QTBUG-68517
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-06-04 16:44:25 +00:00
Gabriel de Dietrich
0866fe2079 QMacStyle: Fix QComboBox left contents margin
Change-Id: I89a5e0c271bdaced8440e123c63c5435fa725856
Task-number: QTBUG-68518
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-06-04 16:44:16 +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
Joni Poikelin
092630cbf9 Fix building with -no-feature-dirmodel -no-feature-filesystemmodel
Change-Id: I7ab90043b2bf6ee41412480f72eb701230cecb38
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-06-04 09:19:02 +00:00
Mårten Nordheim
b1bd2021d2 Doc: Remove outdated info and linkify value
No reason to duplicate the info there in a paranthesis.

Change-Id: Ie01be382d36bbc8e7f2eff4cc7ae0df207869c25
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-06-04 07:08:17 +00:00
Andre Hartmann
41ae28e1b7 QAbstractSpinBox: Add more documentation cross links
stepUp() and stepDown() already linked to stepBy(), so add the
reverse too.

keyPressEvent() talks about stepBy() too, so add it to the cross
reference.

Change-Id: I22c841821331eaed9607cfb2807dcf0e2886d952
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-06-04 07:04:59 +00:00
Samuel Gaist
abe3373489 Doc: Add information about QThread own methods thread affinity
This patch improves the documentation regarding the thread affinity of
QThread's own methods. It's not always clear for people new to threading
that a QThread object lives in the old thread were it was instantiated
and that calling the methods of said objects will also happen there.

Change-Id: I3599851ebc97a33602ca6499da254a08aec59b2b
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2018-06-03 20:26:47 +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