Commit Graph

35900 Commits

Author SHA1 Message Date
Edward Welbourne
3ac029f674 Make generated selftest output match for in-source builds
When generate_expected_output.py is run for an in-source build, the
raw output contains no paths to the sources for the script to whittle
down, as it does for shadow builds, to just the path from qtbase down.
So kludge together some extra regexes that can fix that up and tweak
some relevant code to provide them with the data they need.

Change-Id: I656d7126087bd9ad20b2af6835fba314d90a171d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-17 16:22:49 +00:00
Andy Shaw
0b70f5ada9 QDoubleValidator: Allow intermediate values as close as possible to one considered invalid
The documentation states that if you have a range of
0.00-2.00 with the number of decimals set to 2 then
any number up to 9.99 would be considered intermediate.
This is because the number of digits still matches both before
and after the decimal point. If it is 10.0 or 9.999 then
it is still considered invalid.

In the case of 9.999 being invalid in this case, the documentation
is corrected as this was incorrectly indicated as Intermediate,
as the code indicates it as Invalid.

Change-Id: I07b433e856f355916a1240deafdf4ef58e680639
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-04-17 15:36:34 +00:00
Tor Arne Vestbø
49b4433adf Provide QPlatformWindow::hasPendingUpdateRequest() helper function
So that platform plugins don't need to dive into QWindowPrivate.

Change-Id: Ia2d94b3e9236e4a68857e6afe7af063f1b0d0aeb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-17 12:55:06 +00:00
Tor Arne Vestbø
8e2a970566 macOS: Add logging when delivering update requests
Change-Id: I2144e39c69fe79c0a31d5fb708abe4b20169d27a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-17 12:55:04 +00:00
Tor Arne Vestbø
ab9b026d27 iOS: Don't assume our UIWindow is a QUIWindow
Change-Id: I6494e4a476273b131aedcf409abdb1ffffa5b62e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-17 12:55:02 +00:00
Błażej Szczygieł
5b09346cf4 Widgets: Use accelerated scroll when scrolled widget is overlapped
Get region of overlapped widgets and scroll only non-overlapped parts
of image. Next, schedule an update for overlapped widgets region.

This patch improves scrolling performance when scrolled widget has
overlapped widgets.

Common use cases:
- faster scrolling when using "StyleHint::SH_ScrollBar_Transient",
- faster scrolling of zoomed image with semi-transparent thumbnail.

Accelerated scrolling with overlapped widgets is not available when
scale factor is non-integer.

Task-number: QTBUG-64504
Change-Id: I8337d3bc756e50f7d31cdc7979ccf86dc5c3695f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-04-17 06:32:52 +00:00
Christian Ehrlicher
98ad498a46 QSplashScreen: honor alignment when message contains html
When the message contained html, the alignment was not honored and the
text was drawn topLeft instead. Use a similar algorithm like it is done
in qt_format_text to move the text to the correct aligned position.

Task-number: QTBUG-43081
Change-Id: I570efd0f3f339b26b102ac52983887197d7d63e2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-15 20:36:28 +00:00
Anton Kudryavtsev
53f52edb2a GraphicsView: use range-based for instead of foreach
Change-Id: I8e1b50bcbffdb492dc10662150b51b0eed1e228e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-15 18:26:38 +00:00
Anton Kudryavtsev
302a1bc7b7 ItemViews: use range-based for instead of foreach
Change-Id: I250b3e3db4d44a622a20ca42baac819a17efdd94
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-15 18:26:26 +00:00
BogDan Vatra
c6af7cf666 Android: Cleanup the threading handling
Make sure all the call that are coming from Android UI thread are
delegate to Qt thread.

Change-Id: Ice1a25d01d107d7221b88c65b96dc1459c7f77f0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-04-15 18:01:27 +00:00
BogDan Vatra
afeba6978f Make sure we finish composing before we do any operations on text
We must finish composing before we move cursor or we do operation
on text like cut, copy, paste and select all

Change-Id: Ibb09f2c3e526e237b77689a1c2d253aecd563237
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
2018-04-15 18:01:16 +00:00
BogDan Vatra
5e8b16f0e4 Release left button before showing the popup context menu
If we release the left button after the popup context menu
is visible, the left button will hide the menu immediately.

Change-Id: Ie6edf85beb683fd83247e90e7edb4faa5aff6d35
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-04-15 18:00:51 +00:00
BogDan Vatra
8379186009 Android: rewrite edit context menu
- get rid of the old tool bar with edit controls which was also dropped
by Google after they realized that is not intuitive at all.
 - we now introduce a nice context menu as we see in modern Android
devices. This menu works on all Android devices starting with API 16.

[ChangeLog][Android] Say hello to Android edit context menu

Change-Id: I00d0d83fe8876335c72d7b183db4c1b53746d6b7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-04-15 18:00:34 +00:00
Anton Kudryavtsev
ba2221bd73 Widgets: use range-based for instead of foreach
Change-Id: Id9ec2db6cfa661ff9b3b6ace9ffaa071a2d57f94
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-15 15:12:50 +00:00
Qt Forward Merge Bot
4aa6f54fec Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8c353b4c53e90434453c76691eac39a894d23b49
2018-04-15 01:00:18 +02:00
Gatis Paeglis
d5ac11891d xcb: prevent crash with pixmap cursors on XRender-less X servers
We were using xcb_render_* APIs without checking if the server even
supports this extension. Attempting to use an extension which is
not present will always result in a crash. This patch adds the required
guards and refactors how we detect presence of XRender extension.

Also instead of falling back to some odd-looking bitmapped version
just leave the current cursor unchanged. That is how we did it in
Qt4 AFAICT.

Task-number: QTBUG-66935
Change-Id: I4f27f1d65a77563ec34f3e0e94492c9236d7f9a6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-14 17:03:10 +00:00
Gatis Paeglis
7286d9d8dd xcb: fix bitmap cursor loading performance regression
... introduced by 422838685c.
Instead of completely droping caching for bitmap cursors we can do
the same what is done in libXcursor - have a fixed size cache, with
oldest entries eventually being replaced with new bitmaps. This
fixes the original issue, where the hash was growing indefinitely
until running out of file descriptors and won't have the performance
penalty as in 422838685c.

Task-number: QTBUG-66897
Change-Id: I14f80b46f97fd0e2c920e17a31ffbc0441cd9d22
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-14 17:03:01 +00:00
Gatis Paeglis
cba414a26b xcb: cleanup the code for detecting when to create/destroy SHM segment
- removed the check for "m_segmentSize > 0" as according to the code it
will never be <= 0.

- wrap the entire logic in connection()->hasShm() { .. } as that is when
the logic becomes relevant. This makes the code more readable.

Change-Id: I572420df8e29cc46593f8a13c250f8c05c6a9108
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-14 17:02:53 +00:00
Kari Oikarinen
0dd3e02aac tests/auto/widgets/util: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I795e564b051bbabd1fc2d2fca8171da6072f99eb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-13 12:32:52 +00:00
Lars Knoll
07f1c96658 Improve performance of QResource::load()
Avoid creating a QDateTime in the resource that will almost
never get used. Constructing the date time is expensive as we
convert the time stamp to local time.

Task-number: QTBUG-65713
Change-Id: I3638e108a8fbd237cd93e98aa2adc0ca2127822c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
2018-04-13 12:17:33 +00:00
Oliver Wolff
a8906e3510 winrt: QWinRTEGLContext: add isValid functionality
QPlatformOpenGLContext::isValid always returns true
but it is possible that creation of the context fails
in QWinRTEGLContext. This case should be reflected in
isValid because other places (like QOpenGLContext::isValid())
rely on it and not having proper information about the
validity of the context might lead to crashes.

Task-number: QTBUG-67568
Change-Id: If989ca47cdf7b27c44961beee5d97a4647184b0a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-04-13 12:16:54 +00:00
Jan Grulich
369e7572ba Add support for opening files in OpenURI flatpak portal
Adds support for opening files in applications outside sandbox. To prove
we have access to given file, we have to pass it as file descriptor. The
user then gets a dialog with list of application which can be used to
open given file.

Change-Id: Ifb4cf3dece15d0792b8eb1b90a240da2d3f3c89e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-13 07:19:17 +00:00
Akihito Izawa
26355be54d QStyleHints: emit correct signal when calling setMouseQuickSelectionThreshold
Change-Id: Ieb76ecc406c25ca11a108775ebd46a8e597401b5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2018-04-13 06:33:35 +00:00
Kari Oikarinen
66cc08961f tst_QWidget: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I1696ccbdf0523ece694f2dac52c015443c8b19fb
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-13 05:43:45 +00:00
Eirik Aavitsland
ca58764da1 PDF engine: handle abnormally long string cases
The output routine used a fixed size scratch buffer, with no attempt
to handle overrun. Add a simple fallback code path for such (extremely
rare) cases.

Task-number: QTBUG-66788
Change-Id: I52531b829baeaa48a8fb5a637a020ee9f89d270a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-12 21:22:41 +00:00
Eirik Aavitsland
7f782e1fc4 Fix crash if QPixmap::defaultDepth() is called when no QGuiApplication
This static method can be called before QGuiApplication is created. At
that point there is yet no primary screen, so the implementation
needs to guard against dereferencing a nullptr.

Task-number: QTBUG-67309
Change-Id: I6b7b9e97b1c3c79bf2f9c6d6247c3b10f39f7a55
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-12 21:22:20 +00:00
Lars Knoll
8aa51e6627 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-04-12 20:44:04 +00:00
Lars Knoll
4f158ccee5 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I9f802cb9b4d9ccba77ca39428a5cb1afd2d01642
2018-04-12 22:00:35 +02:00
Alex Trotsenko
e8733ffc51 QWindowsPipeReader: fix waiting on inactive pipe
To read data from a named pipe, QWindowsPipeReader uses the ReadFileEx()
function which runs asynchronously. When reading is completed and the
thread is in an alertable wait state, the notified() callback is called
by the system, reporting a completion status of that operation. Then the
callback queues a readyRead signal and starts a new sequence. The latter
is skipped if the pipe is broken or the read buffer is full.

Thus, if an application does not run the event loop, the next call to
QWindowsPipeReader::waitForReadyRead() should emit the queued signal
and report true to the caller even if no new read operation was started.

Change-Id: I37102dbb1c00191d93365bfc2e94e743d9f3962a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-12 18:08:29 +00:00
Gabriel de Dietrich
38a16b8be0 QMacStyle doesn't depend on Carbon anymore
We also remove the old documentation file that is now
mostly outdated.

Change-Id: I32c9c6b0984be5e41653a92b0b9287a89f73ee38
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-12 16:39:34 +00:00
Oswald Buddenhagen
9c4c136bc9 rework syncqt interaction regarding cross-tree paths
instead of relying on more or less accidental qmake behaviors regarding
the base dir for relative paths (esp. if a file does not exist yet),
make everything explicit. to that effect, clearly define the base tree
(source or build) for every syncqt-generated variable, and write only
in-tree relative paths to the variables. on the receiving end, resolve
the paths as soon as headers.pri was read.

Task-number: QTBUG-67111
Change-Id: I32ae5760fb62ebc650fdb69e46aac786a8141564
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2018-04-12 15:42:59 +00:00
Oswald Buddenhagen
1a71fe0306 qmake: fix QMAKE_BUNDLE_DATA for (some) generated files
the source file must not be written with an absolute path to the
makefile, as this won't match the name of the target which generates it,
thus leading to an unsatisfied dependency.

this is the proper fix for QTBUG-60413 and a bunch of others.

amends historical f173e217cd.

Change-Id: I28140351c4b4759de35e60daf63bc54b82d104ec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2018-04-12 15:42:49 +00:00
Timur Pocheptsov
9917eb2ec6 HTTP/2 - reset uploadByteDevice if necessary
1. If a request was redirected or some error was encountered, we
   try to reset the uploading byte-device.
2. Disconnecting from the byte-device is not enough, since we have a
   queued connection, _q_uploadDataReadyRead() gets called even if
   byte-device was deleted and thus sender() can return null -
   we have to check this condition.
3. Update auto-test with a case where our server immediately
   replies with a redirect status code.

Task-number: QTBUG-67469
Task-number: QTBUG-66913
Change-Id: I9b364cf3dee1717940ddbe50cba37c3398cc9c95
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-12 14:02:20 +00:00
Sergio Martins
144ee494b7 dockwidgets: Resize the rubber-band when our drop target is resized
Bug can be seen on the .gif attached to QTBUG-67611, the floating group
window resizes, but the rubber band still has the old size.

Change-Id: I7232a39574ea06fe036c75c21e7496c0f32f4632
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-04-12 13:55:12 +00:00
Allan Sandfeld Jensen
2cc9776652 Cut down on drawPixmap and drawImage combinations
There are too many combinations and the data is not very useful when
it is impossible to get an overview. This cuts a few rare formats out
and reduces the sizes tested to one small for overhead benchmarking
and one large for bandwidth benchmarking.

Change-Id: If0fe33e0e02b8cba771094a79072036f2cd4cf48
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-04-12 12:58:40 +00:00
Kari Oikarinen
a88063008d Blacklist tst_QItemDelegate::comboBox on openSUSE
This failed (occasionally) in finding the editor widget, so wait for the window
to be shown properly. Also enter the event loop with QTRY_VERIFY and not for a
fixed time of 1 s.

This however just moved the point of failure. Now the test fails since the
clearing and setting of focus does not dismiss the editor widget sometimes, so
still blacklist it.

Task-number: QTBUG-67282
Task-number: QTBUG-66216
Change-Id: Iec598609fce23a25d7b955082d0973685d612715
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-12 12:48:12 +00:00
Kari Oikarinen
b096982899 Don't mark tst_QFiledialog as insignificant_test
Change-Id: Id3fef4e66bd8f96c8f87dd94bbca216cc65f8489
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2018-04-12 12:21:55 +00:00
André Klitzing
4acaa0caf2 Update bundled sqlite to 3.23.1
[ChangeLog][Third-Party Code] Sqlite was updated to version 3.23.1

Change-Id: I27edf023fdcad30fb2171b04fa374910dd4d9122
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-04-12 12:21:43 +00:00
Kai Koehne
7cb7b35e0a Doc: Fix typo in The Property System section
Change-Id: Ie31c56369baf26f5592c95dacea60ae58fdbccfe
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-04-12 12:21:32 +00:00
Morten Johan Sørvig
0300886c13 Cocoa: Add QNSView Metal Layer support
Make sure the layer is updated on window resize and
screen change.

Add a support test and print a warning if we try to
create a Metal layer without Metal system support.
This test should ideally be done earlier, before
configuring the QWindow to use Metal.

Link against the Metal framework: The minimum deployment
target is already 10.11 so this does not add additional
deployment requirements.

Change-Id: I0a38e824d0b6042bb52520dfaf0958ce21bb40b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-04-12 12:14:18 +00:00
Edward Welbourne
5c63e6fd75 Clean up some trivia in tst_QTimeZone
Fix a mistaken #ifdef that should have been #if; and only call
QTimeZone::availableTimeZoneIds() once in transitionEachZone_data(),
while switching to use of a ranged-for.

Change-Id: Id27aae9ef450f21350283099c892ca7173884b94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-12 11:48:06 +00:00
Kari Oikarinen
350a64196f tests/auto/dbus: Avoid unconditional qWait()s
Use QTRY_COMPARE instead of a wait followed by QCOMPARE. Unless the condition
doesn't change and the wait provides the opportunity for things to go wrong.

Task-number: QTBUG-63992
Change-Id: I13474a45f1f4df9d77a418729a5748235ae0dd1a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-12 05:49:07 +00:00
Gabriel de Dietrich
375dd7ad34 QMacStyle: CE_TabBarTabShape is now HITheme-free
This should be the last bit of QMacStyle depending
on HIToolBox APIs.

Small and mini sizes support coming later. Same
for the focus ring.

Change-Id: If625fccb87ebd0607b96a8c5040888df5a2a1032
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-12 03:49:12 +00:00
Gabriel de Dietrich
c3d2862ed3 QMacStyle: SE_TreeViewDisclosureItem is now HITheme-free
Change-Id: I34f1325adc661edde7bba7d7374bc8cfb80900ae
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-12 00:22:54 +00:00
Gabriel de Dietrich
7c86719566 QMacStyle: PE_FrameTabWidget in now HITheme-free
Change-Id: If14e67bdae41099bb87fe2d7c4f65926d325766b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-12 00:22:48 +00:00
Gabriel de Dietrich
4b9e6b65c9 QMacStyle: Remove cached focus ring drawing
We go for direct drawing for now. Some of the logic was
a bit sketchy, and we need to measure how useful is caching
and eventually compatible with the focus frame animation.

Change-Id: Id30a68f77a4129197536e8ca251906ee8a730925
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-12 00:20:48 +00:00
Gabriel de Dietrich
91fa300cbe QMacStyle: CC_ComboBox is now HITheme-free
For the time being, no more stretched QComboBox. They
were already looking bad before and nobody complained,
so it's a non-issue. In the future, we might use square
combo boxes in the same way as we do for push buttons
but for non-editable QComboBox only.

Removes what is now dead code, including some leftovers.

tst_QMacStyle updated to reflect size changes to accom-
modate the focus ring.

Change-Id: I60fac86b9acb52cc96373bca0b3cad598ec4f1e7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-12 00:20:42 +00:00
Sergio Martins
5de49ab4ed Fix grouped dock widget from shifting down when created
Animated .git attached to the bug report for easy understanding.

Looks like we shouldn't set window flags after a setGeometry() and
before having the window resources. If we do that, then the requested
geometry won't be honoured. No idea if it can be fixable in the QPA
and won't risk doing it there.

Fixes the problem on macOS and Windows.
On Linux it was OK, and still is.

Task-number: QTBUG-67611
Change-Id: I8244b4956a5ac9afcf257bea762c2c3084b563f8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-04-11 19:16:21 +00:00
Sergio Martins
a553e2f6b5 Fix z-order when dragging a dock widget over another
the drop target would create a floating group window, which would
have higher z-order since it just had show() called on it.

raise the window we're dragging when the target is mutated into group
window.

Bug can be seen on the .gif attached to QTBUG-67611.

Change-Id: I5dad058468e24327b14d1e7f76c3ad0287d26ee8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-04-11 19:16:16 +00:00
Daniel Savi
6a4b6971f4 Add more formatting to QTextDocumentWriter when writing ODF files
QTextDocumentWriter only supports a small subset of table formatting
when exporting to ODF-format. This patch adds more formatting
capabilities to the ODF exporter:
- table border support
- table alignment
- table width
- respect column constraints (column widths)
- add a tab before soft line breaks. This will avoid causing the last
line to stretch all over the cell in justified paragraphs.

With this patch, line height settings are now exported, too.

[ChangeLog][QtGui][QDocumentWriter] QDocumentWriter now supports table
borders, table alignment, table width, column widths, line height and
image resolution when exporting QTextDocuments to ODF files.

Task-number: QTBUG-63581
Change-Id: I2d269ef0f842e73af64d48bfef531d5fa3078088
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-11 18:44:31 +00:00