Commit Graph

24009 Commits

Author SHA1 Message Date
Liang Qi
7ee80242de Merge remote-tracking branch 'origin/5.9.0' into 5.9
Change-Id: I2d7a3f3a80e6287e135e55b650f74f9a540332bc
2017-05-31 08:11:37 +02:00
Tero Alamäki
27f0d8db91 Fix qpa/kms test with Vibrante 4.1.6.0 on INTEGRITY for Drive CX
Change-Id: I44ae001dc9f96ea8819a56a87be9322326dbbb4b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-31 05:13:05 +00:00
Thiago Macieira
fa3940cc4b QStorageInfo: Pass MNT_NOWAIT to getmntinfo
This forces the API not to wait for synchronous I/O from the filesystems
and get the information, but instead just use the cached information
directly. It's a good idea if we have an unresponsive FS, like NFS with
an unreachable server.

Task-number: QTBUG-61096
Change-Id: Iddeeffb6f4ad4a2894a2fffd14c32f6e90664a63
Reviewed-by: Tobias C. Berner
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-05-30 17:29:21 +00:00
Stephan Binner
dbeb748de3 Convert features.printdialog to QT_[REQUIRE_]CONFIG
Change-Id: Ifb016ae2a0986b436f788b34513c81ea91f3804a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-30 17:21:26 +00:00
Stephan Binner
f209215c0d Convert features.printpreviewwidget to QT_[REQUIRE_]CONFIG
Change-Id: I7e38179acd93bf8c7c48c79ff5e304d893460758
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-30 17:21:17 +00:00
Stephan Binner
e0b39313b0 Convert features.printpreviewdialog to QT_[REQUIRE_]CONFIG
Change-Id: If38d70b1e098c0cc680b913b2c4087681ad2a41e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-30 17:21:12 +00:00
Stephan Binner
18e5d10426 Convert features.cups to QT_[REQUIRE_]CONFIG
Change-Id: I189134b41c4f6e4ac42b5e47ae79338c744b581d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-30 17:21:07 +00:00
Jüri Valdmann
8632614947 QSslCertificate: don't init() if SSL is not supported
QSslCertificate used SSL without checking if SSL is available.

This patch adds such checks to the constructors.

Change-Id: Iea298aded5966641327e22e41ad4665a3d0ec5d3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-05-30 17:12:59 +00:00
Olivier Goffart
c70c1d54f4 QStackedLayout: Fix UB (invalid cast) in qt_wasDeleted()
Fixup of commit b4995eb749.
We can't call QWidgetPrivate::get(w) on a deleted QWidget, because of
the call to the member function QWidget::d_func. We can however call
QObjectPrivate::get since we still are in the QObject destructor.

tst_qstackedlayout now pass without ubsan Warnings.

Change-Id: I4e839a97ddbd1cf21435a8fca76523b98a1f7d9b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-05-30 16:57:30 +00:00
Joerg Bornemann
c3030d7163 moc: remove _MSC_EXTENSIONS #define
Because we obviously don't support Microsoft's extensions in C++. This
is required because some MS headers have code that isn't proper C++,
like iso646.h:
 #if !defined(__cplusplus) || defined(_MSC_EXTENSIONS)
  #define and    &&

Do not pass /Za to MSVC to generate moc_predefs.h, because this option
is incompatible with compiler options like /fp:fast that may be
user-specified.

This reverts commit e1a70ce4 and re-fixes the issue similarly to commit
d72ac3f3.

Task-number: QTBUG-58391
Change-Id: I5c0143283afed09f98200806c87259c039c00ae1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-05-30 15:34:26 +00:00
Mitch Curtis
c25ad981a3 QWidgetWindow: don't give focus to windows that are being destroyed
In the referenced bug report, dismissing a QFileDialog while the
Qt Virtual Keyboard was in use would result in a crash.

Dismissing a file dialog created with
e.g. QFileDialog::getOpenFileName() causes it to eventually be
destroyed. When this happens, it starts deleting its children. Each
child widget's destructor calls clearFocus(). In clearFocus(), there is
a block of code that emits QWindow::focusChanged(), passing the result
of focusObject() called on that widget's window.
QWidgetWindow::focusObject() could end up using itself as a fallback
focus object if it had no other focus objects (e.g. children) to use
instead, even though it was in the process of being destroyed; as were
all of its children. The Qt Virtual Keyboard plugin would then try to
use the focus object, even though it was in an invalid state.

To fix this problem, we return early from QWidgetWindow::focusObject()
if the window is in the process of being destroyed.

Task-number: QTBUG-57193
Change-Id: I137cf9415812ce2e0419c0afe8076ce150f248cb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-05-30 10:49:36 +00:00
Kimmo Ollila
88f30250eb Add USB HID device feature to INTEGRITY
This change adds USB mouse handling support for INTEGRITY

Change-Id: I8a2a51c8c3578898e90dd5bbb01f6aed6c64e2a4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io>
Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Tero Alamaki <tero.alamaki@qt.io>
2017-05-30 10:38:12 +00:00
Allan Sandfeld Jensen
2a0d96daa8 Do not use FT_LOAD_TARGET_LCD when full hinting is requested
In FreeType 2.8.0 FT_LOAD_TARGET_LCD is now a variant of
FT_LOAD_TARGET_LIGHT instead of of FT_LOAD_TARGET_NORMAL. This means
requesting it will get us light hinting.

See https://sourceforge.net/projects/freetype/files/freetype2/2.8

We should just avoid using it all together since we request the LCD
mode separately anyway with FT_RENDER_MODE later.

Change-Id: I9ea2e39a6e9ba25ba11604a194e552fe4240a127
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-05-29 14:09:47 +00:00
Stephan Binner
ad8b4ba014 Convert features.splashscreen to QT_REQUIRE_CONFIG
Change-Id: Ie46b7c6fb52773dea25c552a77c96d800f471738
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-29 10:46:53 +00:00
Stephan Binner
61384e910d Convert features.lcdnumber to QT_[REQUIRE_]CONFIG
Change-Id: Ie99d2ce0a836c27fb882c04ff465e6cdd483d360
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-29 10:46:52 +00:00
Stephan Binner
3945cf1f9a Convert features.movie to QT_[REQUIRE_]CONFIG
Change-Id: I838c7305d4649f953c5bb972f1aa51dbb078afe2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-29 10:46:50 +00:00
Àlex Fiestas
9ec0280714 Make sure QWindow screen is set before calling QPlatformWindow::create
QWindow uses device independent geometry while QXcb and QPlatform
classes do not.

When QXcbWindow::create is called we have no guarantee that the correct
screen has been set in QWindow so the code
attempts to check if "currentScreen" matches "actualscreen". To perform
that operation though we need to convert
the units from "Device independent" to "native pixels" that we do by
calling QPlatformWindow::windowGeometry which
calls QHighDpiScaling::toNativePixels which requires the correct screen
to be already set.

So basically we have a cyclic dependency, to get the correct screen we
require the correct screen to be already set.

To fix this we can:
1-Remove the dependency (Look for the actual screen using device
independent pixels)
This will imply adding code in QXcb to use
QPlatformScreen::deviceIndependentGeometry to lookup the screen up

2-Make sure the Screen is set before calling QXcbWindow::create

This patch implements the first approach that allows us to keep the
changes within the QXcb backend which seems to be the only one affected.

Task-number: QTBUG-53813
Change-Id: I6dc955d63e17c3b3421f3a1a9e0d841e508b2e5c
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-05-29 10:40:53 +00:00
Friedemann Kleint
8b1377fde1 QWidgetEffectSourcePrivate::draw(): Call render() when no shared painter exists
Task-number: QTBUG-60231
Change-Id: If07274a01bb9a4b9323865a3e061b3674507fd5b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-05-29 10:23:01 +00:00
Tero Alamäki
b418c76396 Add INTEGRITY framebuffer test to configure
Change-Id: I606da783ef9959448a89a7a616ab197820194977
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-29 09:46:40 +00:00
Tero Alamäki
c49c559abe Get alpha buffer size bigger than zero for INTEGRITY ARMv8 Drive CX
Change-Id: I5bdfe9bb50aafe50542c665d91973e4c0c12e602
Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-05-29 09:46:33 +00:00
Tero Alamäki
ccb3e25d82 Configure eglfs_kms_egldevice for INTEGRITY ARMv8 Drive CX
Change-Id: If41135cdf8287b90690321bef3ad839db6778782
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-05-29 09:46:27 +00:00
Tero Alamäki
5a01b58665 Add Integrity ARMv8 detection
Change-Id: I352c9b16077011aad1175e31ffaadfa44d2403ea
Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-29 09:46:20 +00:00
Tero Alamäki
aea4e3823d Add INTEGRITY mkspec for ARMv8 Drive CX
Change-Id: I038de7a0cc9e6046aec3fc930876d43263702e90
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-05-29 09:46:12 +00:00
David Faure
f6b36eaafe QHeaderView: fix visual/logical index corruption when restoring state
This is a followup to 77a8e90cdd which
didn't handle the case where no columns had been moved.
visualIndices and logicalIndices are empty until initializeIndexMapping()
is called, in which case appending is wrong.

As a result, visualIndex(i) would return -1 for the values over
those added by read(), and an assert would happen at painting time.

The fix is to leave visualIndices and logicalIndices empty if
they are empty already, leaving it to initializeIndexMapping()
to fill them later if necessary (e.g. when moving a column).

Task-number: QTBUG-60837
Change-Id: Ia7e4b9d3122647984acd434dfaa0400df319d065
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-05-26 12:43:31 +00:00
Tor Arne Vestbø
4c346b6e2b macOS: Don't keep WA_MacAlwaysShowToolWindow windows always on top
On macOS if an application is no longer active then it will cause any
tool windows to hide until the application is active again. For
applications that did not want this behavior and thus wanted the tool
window to stay visible, the WA_MacAlwaysShowToolWindow flag is
available.

In order to ensure that this flag is respected, the tool window needs
to have its level changed when the application active status changes.
Once it is no longer active the window needs to be seen as a normal
window, and when it is active then it needs to be set to be a window
that is always on top to get the right behavior.

Due to various bugs in AppKit we need to explicitly order windows
in front during this process, which requires us to then iterate the
windows in back-to-front order. For macOS versions < 10.12 there is
no way to get an ordered list of windows, so we fall back to using
the window creation order.

Task-number: QTBUG-57581
Change-Id: If20b4698616707685f83b1378f87593f8169c8c6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-05-24 07:45:23 +00:00
Andy Shaw
c1b81190e2 Use hasFocus() to check if the QTreeView is considered active or not
When drawing the branches in a QTreeView, it should use hasFocus() to
determine if it is the active widget or not. This is how it checks when
styling the other aspects of the treeview, so the branches should be
done in line with this.

Change-Id: Id721401424ad95e9fc7ffbdc991e53b5f7feac01
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-05-23 14:00:30 +00:00
Leena Miettinen
b2d8e1e5be Doc: Replace "Macintosh" with something suitable or omit it
Change-Id: I3067bd7e6ae2d6d68d5232a56eaf368a0415876c
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-23 13:02:33 +00:00
André Klitzing
3d76b27118 Update bundled sqlite to 3.16.2 as it fix some small regressions
[ChangeLog][Third-Party Code] Sqlite was updated to version 3.16.2.

Change-Id: Ib3e9c3a7021760e3cfa6dbd44f67b9da4abbe367
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-05-23 08:44:21 +00:00
Andy Shaw
3dd089c08b Cocoa: Clean up memory leak when providing the accessibilityActions
Change-Id: Ib69155ceedb7bf35e3a7b5daa309fc2d54e3f254
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-05-23 06:17:25 +00:00
Oliver Wolff
7076438db4 winrt: Move handling of new socket connections into worker
Same as with receiving data, the "newConnection callback" might be
triggered late and cause a crash if it accesses data of a destroyed
object. By moving the handling of this callback to a worker without
much logic we can prevent these late callbacks from doing any harm.
The signals are no longer connected and thus do not trigger any
problems.

Change-Id: Ic61584f12a46506abe12d7b21403d0c0970c0aae
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-05-23 06:17:05 +00:00
Mitch Curtis
1fb85458fc Doc: fix grammar in QScopedPointer's detailed description
Change-Id: I3ce9650d62f3b53683c6b6f210c1413e94ae006c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-23 06:14:24 +00:00
Marc Mutz
6d44fa53e1 QItemSelection: fix a quadratic loop
QList::erase(it) is a linear operation. Calling it in a loop
constitutes quadratic behavior.

Fix by using the erase-remove idiom.

Write a generic function object QtFunctionObjects::IsNotValid, instead
of a lambda, because I am building up a collection of such function
objects in my tree, to be submitted any time now™, so this will reduce
the churn once that gets merged. Wrap it in the unnamed namespace to
avoid ODR violations in case this pattern repeats.

Replace an existing erase-remove idiom's isNotValid lambda function
with the new function object.

Change-Id: I4f0af04e7b201eb168e79beeda332eee3c6f33c3
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-05-22 18:16:38 +00:00
Eskil Abrahamsen Blomfeldt
33c59be551 doc: Add warning about QTextLayout::beginLayout() and clearLayout()
If you keep around QTextLines referring to the previous contents of
the layout, you can experience crashes when using these after the
layout has been cleared. Since QTextLine is a value type, this is
not very obvious in the API, so we should at least give a warning
in the docs.

Task-number: QTBUG-60804
Change-Id: I81b2b640eec5f62b0af1e878aadd9fa23654ec18
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-05-22 05:40:09 +00:00
Timur Pocheptsov
c21cee827f QSslSocket (OpenSSL) make supportsSsl return false, if v >= 1.1
Our OpenSSL backend allows missing symbols and in general protected
from possible related failures. Unfortunately, for OpenSSL 1.1 this
means not only missing symbols (removed functions), but new incompatible
opaque data-structures and our 1.0 code trying to use them and probably
accessing some data-members via macros - we end up in UB and crashes.
SSLeay, which returns a version number, was removed in 1.1. A failure
to resolve this symbol we consider as a version mismatch and we make
'supportsSsl' to return false.

Task-number: QTCREATORBUG-18137
Change-Id: I5cd270f9c61a729105149779ee7277816f9467d7
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-05-21 09:46:16 +00:00
Liang Qi
d6248ed80e Merge "Merge remote-tracking branch 'origin/5.9.0' into 5.9" into refs/staging/5.9 2017-05-19 20:27:29 +00:00
Błażej Szczygieł
53335315ff HiDPI: Scale mouse position on enter event
Task-number: QTBUG-60892
Change-Id: If800ecaadc5b19c10a954658ece484f30b7f313f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-05-19 18:06:33 +00:00
Oliver Wolff
3137410594 Revert "Enable "combined-angle-lib" for ANGLE builds"
Combining libEGL and libGLESv2 into QtANGLE cannot be the default
any longer, as the change was binary incompatible. We just had to
return to previous behavior temporarily to be able to fix
qtlocation.

This reverts commit 97ab65076e30d8cd0cbe6bdbdb51d1dc2c0ff7e7.

Task-number: QTBUG-60795
Change-Id: I3095cb5f9da30e2d873d9a186cfbc5aee3fb10b2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-05-19 17:40:12 +00:00
Liang Qi
550e16b814 Merge remote-tracking branch 'origin/5.9.0' into 5.9
Change-Id: Ia8ac1960387c0f78c32f9d0385bb0aa9a8209af1
2017-05-19 08:57:59 +02:00
Friedemann Kleint
9301d48543 QGuiApplication: Initialize and clear static variables
Running:

tst_qapplication focusMouseClick touchEventPropagation

produced:

FAIL!  : tst_QApplication::touchEventPropagation() 'window.seenMouseEvent' returned FALSE. ()

since QGuiApplicationPrivate::mouse_buttons was not cleared
when destroying and re-instantiating QGuiApplication.

Add more initialization and clear screen list on exit.

Change-Id: I0d814852c362d4a86f1ff5d6a94ab00d32ed30b9
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-05-19 06:16:00 +00:00
Gabriel de Dietrich
9954187adb QCocoaMenuBar: Keep smart reference to platform window
Change-Id: Ib3a5b071f1cc66992969a85a092f8111e57dea44
Task-number: QTBUG-60786
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7da9fa2890)
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2017-05-18 21:18:47 +00:00
Thiago Macieira
9406bef6b3 Revert "Add qt_safe_ftok wrapper for ftok"
This reverts commit ac0184d608. That
commit added the use of qHash in qt_safe_ftok, which made ftok even more
unsafe than previously. Since the algorithm in qHash can change across
Qt versions, we need a stable algorithm instead.

[ChangeLog][Important Behavior Changes] Reverted a change that caused Qt
5.6 through 5.8 not to connect to QSystemSemaphore and QSharedMemory
created by running applications using Qt earlier than
5.6. Unfortunately, this means that Qt 5.9 will not connect to 5.6-5.8.

Task-number: QTBUG-60771
Change-Id: Ibc3472e1c11d46358357fffd14bf51aeb48ef2c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-18 21:17:52 +00:00
Thiago Macieira
087b4fc6cd Remove unnecessary FunctionPointer::ChangeClass
Those were added by accident.

Change-Id: I067fcfe299b34ab6a771fffd14bf28f2d3c096f0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-05-18 02:48:27 +00:00
Oliver Wolff
b53858e609 Enable "combined-angle-lib" for ANGLE builds
As qtlocation's mapboxgl plugin links to QtANGLE if dynamic opengl is
used, we have to keep the combined library being the default until
qtlocation is fixed.
As soon as the qtlocation fix has landed in 5.9.0 this change should be
reverted.

Task-number: QTBUG-60795
Change-Id: I0781695e085a28a8971a6245a352413c0f779025
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-05-17 13:42:53 +00:00
Lars Knoll
51f095e655 Revert "Merge the QDBusMetaType's custom information to QDBusConnectionManager"
This reverts commit daeb334039.

The commit was causing race conditions, and random failures in CI.

Task-number: QTBUG-60792
Change-Id: I6e49b733965632a1a268f0e88809794098465ec0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-17 13:42:47 +00:00
Allan Sandfeld Jensen
07fd674740 Fix painterpath rect intersections with points on the rect
QPainterPath could in certain cases where sub-path points were on the
border of a rect fail to calculate intersects() correctly.

The patch adds handling of such cases by looking if end points cross in
or out of the rect. Other cases are already caught.

Task-number: QTBUG-31551
Change-Id: I6284da8ff8646d4636702923a76362302dde5767
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-05-17 11:56:46 +00:00
Tor Arne Vestbø
b545a6359b macOS: Don't create NSWindow for embedded views
An embedded view does not have a QCocoaWindow parent, but that doesn't
mean it's a top level.

Improved debug logging to make issues related to this code easier to
spot in the future.

Change-Id: I15b5acdd8d7112600618465a3b65b64fddc306f7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-05-16 17:16:02 +00:00
Filipe Azevedo
b30ce06992 iOS: Fix the shortcuts bar not correctly hidden
To avoid a compiler warning due to a wrong Apple api, a wrong
workaround was introduced. This caused the hide of the shortcuts as
expects but the visual space reserved for shortcuts was still visible
as at top with a height of ~55pixels.
While this is not important because the default virtual keyboard
is always shown, it become a problem when one want to introduce his own
virtual keyboard (UIResponder.inputView) with no shortcuts bar.
This fix really hide the shortcuts bar.

Task-number: QTBUG-60812
Change-Id: I0da44dfc3fda15af3351543c0a05aac973b899b9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-05-16 14:36:09 +00:00
Shawn Rutledge
d0a1135f00 QDirIterator docs: add a cool recursive file-finding snippet
This is one of the main use cases for QDirIterator, but it wasn't
obvious enough that it's possible.

Change-Id: Idae11cfe75dd0e16f1a960bba2470b1695d11241
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-05-16 06:00:47 +00:00
Gabriel de Dietrich
7da9fa2890 QCocoaMenuBar: Keep smart reference to platform window
Change-Id: Ib3a5b071f1cc66992969a85a092f8111e57dea44
Task-number: QTBUG-60786
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-05-16 01:06:18 +00:00
Friedemann Kleint
329a029c36 Windows QPA: Do not raise/lower windows with Qt::WindowStaysOnTop/BottomHint
Prospectively helps to fix Qt::WindowStaysOnTopHint not working reliably
on Windows by preventing HWND_TOPMOST being cleared in raise().

Task-number: QTBUG-50271
Change-Id: I88f916a1cf8a2082236360b9eab874ad22b85762
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-05-15 20:31:28 +00:00
Oswald Buddenhagen
791df9821d fix random build error with -no-feature-commandlineparser
when the dbus tools are bootstrapped (which is the case in x-builds and
when above feature is disabled), they are built asynchronously to the
corelib module. but as qdbusxml2cpp's project file needs to check the
need for bootstrapping, it needs corelib's configuration. so pull it in
explicitly.

Change-Id: I559c7590a3eba8d3f8a03c44fe3a6d56f1c56db0
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-05-12 11:40:16 +00:00
Kai Koehne
c608520766 Doc: Remove platform support table for bearer management
The table is woefully outdated. Instead of shipping stale documentation
I think it's better to just reference the generic API for this.

Change-Id: I619113ab5140ccf65b774e69e836b27001bb0a18
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-05-12 09:44:54 +00:00
Oliver Wolff
3f1548ae82 Restore behavior of using libEGL and libGLESv2 as default for angle
As Qt applications using OpenGL are linked against these libs, merging
them into QtANGLE by default (780105f906)
was a binary incompatible change. This change restores the default
behavior to the one before given change.

If the user wants the libraries to be merged, he can pass
combined-angle-lib to configure.

Task-number: QTBUG-60373
Change-Id: Iedbd3f2ce9284fdde924cfae8d915d6d5fef00db
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-05-11 08:35:54 +00:00
Thiago Macieira
67f466505e Fix some QtDBus crashes during application destruction
It's possible that some code executes after QDBusConnectionManager is
destroyed and still tries to access QtDBus. Protect against such
crashes.

Change-Id: I87e17314d8b24ae983b1fffd1453c13fbd3cf48e
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-11 08:35:33 +00:00
Thiago Macieira
daeb334039 Merge the QDBusMetaType's custom information to QDBusConnectionManager
This allows us to get rid of two Q_GLOBAL_STATIC in QtDBus, which means
fewer opportunities for screwing up the order of destruction. And since
QDBusConnectionManager now ensures that the types are initialized, we
don't need to re-initialize them everywhere.

The Q_GLOBAL_STATIC for QDBusConnectionManager ensures the proper
thread-safe locking, so we don't need to lock for every type that we're
trying to register. This should make things faster.

But as a side-effect, trying to register a D-Bus metatype will cause the
QDBusConnectionManager thread to start too.

Change-Id: Ifea6e497f11a461db432ffff1449a4e535234485
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-11 08:35:24 +00:00
Jake Petroules
cf969f0be3 Add undeclared CoreFoundation and Foundation deps to coretext.pri
This fixes shared library builds of Qt on iOS and tvOS.

Change-Id: I29d4c7e779e51b1adc19ca9dc18bc46a45a60093
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-05-11 05:57:08 +00:00
Filippo Cucchetto
be0a221ae4 Fix missing handling of columns when merging selection ranges
This commit fixes two bugs:
1) Two ranges should not be merged if they are of different columns.
The old code would have merged (0,0) with (1, 1). Tranforming a selection
of just two indexes in a rectangle of four indexes.
2) The QItemSelectionRange appended had wrong column and worked only for
indexes of the first column. For example if 'tl' was (0, 1) than br was (0, 1)
so the QItemSelectionRange would have be ((0,1), (0, 1-1)) so ((0,1), (0,0)).
This QItemSelectionRange is invalid because topLeft columns is greater than
bottomRight column. The fix take in consideration the bottomRight column.

Task-number: QTBUG-58871
Change-Id: I591ef0bcc63926f24a7b1ced002af9b7737a4b6e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2017-05-09 13:46:51 +00:00
Tor Arne Vestbø
ce3a77eed5 macOS: Add a few more platform window checks in QNSView
And unify all of them to use regular pointer check syntax, to stay
consistent with other uses of non-smart pointers.

Change-Id: Ic55d7a16f2010120aaa8eac5b2df8189490671a2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-05-08 19:08:35 +00:00
David Faure
74d79fcf1a QMimeDatabase: update freedesktop.org.xml to shared-mime-info 1.8
... and update the unittest accordingly.

Compared to the 1.8 release there is one change in freedesktop.org.xml,
the magic for application/x-java-keystore was changed from host32 to
big32, as done upstream, see https://bugs.freedesktop.org/show_bug.cgi?id=99328

Task-number: QTBUG-60608
Change-Id: I47de71c9396cfc3eabc884d5679c73a3e4850a17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-08 18:04:24 +00:00
Allan Sandfeld Jensen
ab059940aa Revert gamma-corrected handling of transparent destination buffer
Due to the text blend routines being used by ARGB32 and due to another
bug on invalid premultiplied buffers, we need to keep using the naive
blend on non-opaque pixels for now.

Task-number: QTBUG-60562
Task-number: QTBUG-60571
Change-Id: Idfbb2c2e24dd840189c4fbed4e167f03bbc6ca8d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-05-08 18:04:12 +00:00
Friedemann Kleint
b97a703613 Windows QPA: Call InvalidateRect() for GL windows when Aero is off
Some AMD cards have been reported to not update otherwise.

Task-number: QTBUG-60527
Change-Id: I84d57a57eb2b76fb31255ae42b79b96ab7b257c9
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-05-08 15:14:58 +00:00
Stephan Binner
f12e4903c7 Warn if files are not found because of features.filesystemiterator
Change-Id: Ife3197aa1c56ba3ab6e7f530fbcbcf761f223b16
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-08 14:10:21 +00:00
Thiago Macieira
225a35a2ab Use QNetworkReply::ProtocolFailure in HTTP/2 failures
ProtocolInvalidOperationError are meant for actual replies from the
server indicating that the operation is not valid (HTTP 400 Bad
Request).

Change-Id: I9ad33fff8b634979bdbafffd14bbc57e4b21d6bf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-05-08 09:39:16 +00:00
Glen Mabey
cab9bc8fba Eliminate ambiguous casts involving qfloat16
The operator double() and operator long double() members of qfloat16
are causing cast ambiguities.  This removes them, leaving only
operator float() which seems to be adequate.

Also, additional arithmetic operator tests were added which without
this removal fail to compile.

Change-Id: Id52a101b318fd754969b3de13c1e528d0aac2387
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-07 16:44:55 +00:00
James McDonnell
fb00b4199e OpenGL function lookup for QNX
Qt no longer supports using OpenGL ES2 via static linkage.

Task-number: QTBUG-60457
Change-Id: I754ff1c084ecdfdf7bea0bd691c8f0fc47a2fcb0
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-05-07 16:44:32 +00:00
Marc Mutz
b92267cd4c Remove some more register keywords
They're deprecated since C++11 and removed in C++17.

Change-Id: Ia2acd9312707bfee96838743645a04ae1780e5dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-06 16:59:18 +00:00
Frederik Schwarzer
0b1ec78c2d Fix description starting with a fullstop
Change-Id: Ie8ed872547aa16a2bca2b3886d8c58bffb92b279
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-05-05 15:02:09 +00:00
Erik Verbruggen
3727474421 Prevent 2 unnecessary QString allocations for QString::number(0u)
QLocaleData::unsLongLongToString uses qulltoa, which will allocate a
zero-length QArrayData. Then with padding a single 0 was put in a
QString, which gets prepended to the result. By taking care of this
special case, we can now also fast-path the common case where base=10
and no flags nor precision was provided.

Change-Id: Ia893b0ea4c77634c24e7cef5aafb06d0ef44c507
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-05 12:28:45 +00:00
Giuseppe D'Angelo
dbd55cdaf3 QHash/QMultiHash: fix operator==
The existing QHash::operator== does not work when the same
keys appear in different order between the two hashes being compared.
However, relying on iteration order on a QHash is (as usual) a bad
idea and one should never do it.

Task-number: QTBUG-60395
Change-Id: Ifb39a6779230e26bbd6fdba82ccc0247b9cdc6ed
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-05 12:18:25 +00:00
Thiago Macieira
05f22d6eb2 QtCore: include mocs
Compilation and link times in CPU seconds with GCC 7, using precompiled
headers (not including moc, rcc, uic, etc. steps or headersclean):

                Before  After
Debug -O0       198,1   180,3
Debug -Og       240,7   229,2
Release -O3     267,1   249,2
Release LTO     239,4   229,8

QtCore required a little manual adjusting because some files are
bootstrapped into moc itself and into qmake.

Change-Id: I84e363d735b443cb9beefffd14b8b57c10e7da36
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-05-05 03:03:30 +00:00
Thiago Macieira
f45c6c1804 QInternal::unregisterCallback: don't crash on unregistering during exit
Task-number: QTBUG-60558
Change-Id: Ica9894dc9b5e48278fd4fffd14bb34c6d98d2555
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-05-05 03:03:20 +00:00
Thiago Macieira
fb89364e3a AreArgumentsCompatible: Replace a derived struct with template alias
There's no need to derive. This fixes the build with MSVC 2017 under
/permissive-. I don't know what was wrong (ICC, Clang and GCC don't
complain), but it must be related to "Lookup members in dependent base"
in [1].

[1] https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance

Change-Id: I9ad33fff8b634979bdbafffd14bb8016f5dc98b3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-05-05 03:03:07 +00:00
Oleg Yadrov
e2e874415e QClipboard: make dataChanged() signal work on Android
This part has not been implemented before.

Also replace deprecated android.text.ClipboardManager with modern
android.content.ClipboardManager.

Task-number: QTBUG-58548
Change-Id: I190208042af8a6c87ed391c6c72f3f51e58dfad3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-05-04 19:43:33 +00:00
Oswald Buddenhagen
464a43d43c Merge 5.9 into 5.9.0
Change-Id: Id3fc911f024cba292a5c426b36aa94ff9f3c0ef7
2017-05-04 14:03:11 +02:00
Kai Koehne
4ad030de71 Doc: Do not abbreviate directory in documentation
Change-Id: I26e8c5caca31e842adc7a09151b6de2cc17698ed
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-05-04 11:23:00 +00:00
Venugopal Shivashankar
877ef0594d Doc: Add information about styling QTableView::indicator
Task-number: QTBUG-60245
Change-Id: I068d74d3d1d3ffb872ac6fec830367d67b65049d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-05-04 09:06:18 +00:00
Gabriel de Dietrich
35f927e719 QMenu: Ensure popup() gets the right screen geometry
Many QMenu related functions end up calling sizeHint() which
does call updateActionRects(). Since we try not to update the
action rects if no action has changed, we must be careful to
call it the first time with the right screen geometry. Other-
wise, multi-display setups may get the action rects based on
the wrong display.

In QMenu::popup(), this can be solved by using the position
passed as argument. Incidentally, we were already computing
the right display geometry in the same function, only a bit
later. The updated position around an eventual push button
menu should not change the screen onto which the menu popup
will be displayed.

Tested with the multiscreen-menus manual test.

Change-Id: Id7fc24be6908b4a9d24b8b9c8b8006efe45d69be
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-05-04 06:43:52 +00:00
Oswald Buddenhagen
98c1d516b7 alloca: detect whether alloca.h exists
We can't depend on QT_HAS_INCLUDE for such an important functionality in
QtQml, so detect at configure time.

alloca() is not a POSIX function (it apparently first appeared in
Version 32V AT&T UNIX), so the actual header that defines it varies from
system to system. Clearly, if alloca.h exists, that's the one, so we try
it first. On most other systems that don't define it, it's in stdlib.h.
The only exception is Windows, where it's actually defined in malloc.h.

Task-number: QTBUG-59700
Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Icd0e0d4b27cb4e5eb892fffd14b4b2b389a4684e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-03 12:19:57 +00:00
Alex Trotsenko
979c8b746b QCFSocketNotifier: fix registering a source in the run loop
Even if a callback type is not automatically re-enabled, callbacks are
implicitly enabled when the source has been added to the run loop.
In this case, calling CFSocketEnableCallBacks() could produce an extra
notification if there is a pending event in the queue.

The bug is quite unstable and completely depends on the internal OS
delays. So, it can't be tested inside Qt.

Task-number: QTBUG-59930
Change-Id: I751b8b8cf99cb86b80055f2214a42a638f01abe4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-05-03 08:31:38 +00:00
BogDan Vatra
0fefed996c Fix different look when running the application second time
The problem was introduced in Qt 5.7.

Task-number: QTBUG-60297
Change-Id: I46265b24e104e08fe5b8026e5441514a438582c9
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2017-05-03 09:43:12 +00:00
Nico Vertriest
2714531aad Doc: correct minor link issues
qobject.cpp:4288: warning: Can't link to 'Q_ENUM_NS'
qobject.cpp:4314: warning: Can't link to 'Q_FLAG_NS'

Change-Id: I0fa5a1d4f9b4868a1a98ce6d3b5f6bb9b34c5dd2
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-05-03 08:30:25 +00:00
Marc Mutz
47cf309190 [doc] QSet: fix return type of insert()
It's an iterator, not a const_iterator. Let QDoc figure out the correct one.

Change-Id: I7ddd1568adbf811b801c170794465ba14ceed05e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-05-03 07:22:41 +00:00
Palo Kisa
46aecbd72b QIconLoaderEngine: Fix actualSize() for no-entry
Return an empty size if no suitable entry found to avoid mismatch with
the returned pixmap()'s size (the QIconEngine::actualSize() returns the
originally requested size).

Change-Id: Ia278719a54392b62c5f9fc0529476baba5cd7df0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-05-03 06:56:07 +00:00
Alex Trotsenko
124b9a6ff8 Improve suppression of spurious socket notifications under Windows
There were still two cases where spurious notifications would be
possible:

    - user calls hasPendingDatagrams()/pendingDatagramSize() on UDP
      socket somewhere outside the slot connected to readyRead()
      signal (::WSARecvFrom posts FD_READ notification, even if
      a notification for incoming datagram already exists in the
      message queue);
    - a socket was registered to receive several types of event and
      WM_QT_ACTIVATENOTIFIERS message is located between the
      different events for this socket in the queue.

Provided patch ensures that the message queue is synchronized with
the Qt event processing mechanism and adds a way to detect spurious
notifications inside the window procedure.

Task-number: QTBUG-58214
Change-Id: I49609dace601f300de09875ff1653617efabd72f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Peter Seiderer <ps.report@gmx.net>
2017-05-03 06:46:18 +00:00
Stephan Binner
2f92bd7cd7 Fix warning for -no-feature-graphicsview
Change-Id: I3229fccd2f837b8b8b4da2a149d4584cb4a54dab
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-05-03 05:15:08 +00:00
Eric Lemanissier
8e83d61501 Adapt to the C++ SIC introduced by P0012: noexcept specialization
complements commit c5e687895d
added missing noexcept (void)StoredMemberFunctionCall specialization
to disambiguate template selection.
Without these specializations, StoredFunctorPointerCall was a better
match, which led to compilation failure

Task-number: QTBUG-58142
Change-Id: Ibd41057d9a497f057a895d73277902e90300ed7a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-05-03 02:39:56 +00:00
Gabriel de Dietrich
46543bb462 QMenu: Refactor column layout logic
Change-Id: I30f1c87092447abf1c94e69c0124eeeee43666e2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-05-03 02:21:35 +00:00
Tor Arne Vestbø
60865878e4 macOS: Add autorelease-pool when recreating NSWindow
Significantly reduces the number of objects left to rot in the root pool,
which is only drained on application shutdown.

Change-Id: Iad7520ab083715416d95413a63474b9153f22fb5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-05-02 19:02:07 +00:00
Tor Arne Vestbø
705c716543 macOS: Add auto-release pools for Q*ApplicationPrivate::init()
So that any objects autoreleased during application initialization are
released. Otherwise they will end up in the root level pool and only
be released when the application exits and the application goes out
of scope.

Change-Id: If02d24fd70098f9b4b1b0ea3218e0a15e438b9db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-05-02 19:01:59 +00:00
Allan Sandfeld Jensen
62fc49fb91 Handle implicit close in QDashedStrokeProcessor
Otherwise dashed polygons will not be closed when stroked like they
are documented to be.

Task-number: QTBUG-60397
Change-Id: I58e9e3a06af157f9a2789ccab640c9da75867962
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-05-02 14:49:20 +00:00
Friedemann Kleint
d9e55e40a9 QFileDialogPrivate: Move inline to declaration
Fixes MSVC warning:

src/widgets/dialogs/qfiledialog_p.h(412): warning C4273: 'QFileDialogPrivate::selectedMimeTypeFilter_sys': inconsistent dll linkage

while building tst_qfiledialog2.

Amends change 34f82b8abc.

Change-Id: I7306535000af73ee3a027b14a2d5cfce4f889e85
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-05-02 14:47:15 +00:00
Kai Koehne
b5883a16cb QWindowsInputContext: Fix indentation
Fix indentation of code (introduced in 14efcaa3)

Change-Id: Iee9bc7c66dbde4088168497e9428940554612e84
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-05-02 13:58:40 +00:00
Olivier JG
2f94b7a991 Windows QPA: Find window before invoking native filters
When handling WM_NCCALCSIZE in a global filter, the associated platform
window needs to be assigned to platformWindowPtr so that its frame
margins can be updated on return.
See also 3035400f36, which introduced the
platformWindowPtr out parameter for this purpose.

[ChangeLog][Platform Specific Changes][Windows] Fixed frameMargins for
WM_NCCALCSIZE when handled inside with QAbstractNativeEventFilter.

Change-Id: I7827b81d30a5c80dad591206a88712169dea0108
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-05-02 12:54:38 +00:00
Allan Sandfeld Jensen
d160809015 Cleanup rgb32 text-blending code path
Cleans up the rgb32 text-blending functions, so they now follow the
new pattern used in the new generic text-blending functions. This
also means they can now handle gamma-corrected blending on top of
transparent destination pixels instead of falling back to naive
blending.

Task-number: QTBUG-60469
Change-Id: I154ba513ff99c0cefab8fa12f4ed43fcd6563a6a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-05-02 12:52:35 +00:00
Andy Shaw
7eae7e8103 macOS: Fix return value of PM_TabBarBaseHeight to original value
When the tabbar styling was improved in change
175f33ed85 it changed
PM_TabBarBaseHeight to 21 which is incorrect as this value represents
the spacing between the tab pages and the tabbar. In macOS style
there is no space so this should be set to 0.

Task-number: QTBUG-60307
Change-Id: I2ce39ff2fc924d2d83843fab78b311153b4ee08f
Reviewed-by: Oleg Yadrov <oleg.yadrov@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-05-02 10:23:01 +00:00
Alex Trotsenko
91c1b5490e QWindowsPipeReader: fix possible invalid invocation of ReadFileEx()
If the user calls QLocalSocket::setReadBufferSize() with a value less
than the current size of the pipe buffer, startAsyncRead() would call
ReadFileEx() with invalid parameters:

  ReadFileEx(handle, nullptr, some_big_value, ...);

Change-Id: I3d153e3ec34f8038dc001c1c896aeceb666a8979
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-05-02 05:21:29 +00:00
Gabriel de Dietrich
68df0576dd QMacStyle: Increase accuracy of PM_TitleBarHeight
In some cases, we'd want such value to come from the
platform theme, but we'd need new API for this.

Change-Id: Ic7053fa17ac8b2f207db031095c4e4aefae000c2
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-05-02 02:59:25 +00:00
Marc Mutz
0208cac94f QItemSelectionRange: don't compare pointers with op<
... use std::less<> to avoid undefined behavior.

Change-Id: Ib6736f86359c4a16fd90ca63b57a8517c6137ead
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-04-30 17:23:15 +00:00
Edward Welbourne
a4192166c8 Add two missing hyphens
Change-Id: Ic320c96208fe7f8340c7eb9e9d068813d769056a
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-30 09:51:16 +00:00
Tasuku Suzuki
ea15b170ef Fix warning for -no-feature-lineedit
Change-Id: Ia56d5d7266a379f911e4db61e60b8b39af5b6342
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-30 07:49:38 +00:00
Tasuku Suzuki
de76ccb967 Fix warnings with -no-feature-menu
Change-Id: I1e62e3772dbd5f17d9ad69025b23e3726386c2bd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-30 07:49:32 +00:00
Tasuku Suzuki
da1079e51c Fix build without features.cupsjobwidget
Change-Id: I1b49a9f63a6a071457a3b9305dc87abe5f3b5b19
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-30 07:49:06 +00:00
Thiago Macieira
3c4c02b3f1 Include moc of qnamespace.h in qobject.cpp
Change-Id: I84e363d735b443cb9beefffd14b8bd4b39b00840
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-29 02:44:37 +00:00
Jesus Fernandez
dc8933e0aa Initialize vao variable
If vaoHelper is not valid the vao variable was being initializated with
a random value.

Change-Id: I44962841baeb1a1cff3124d6126e19c791feaea3
Coverity-Id: 171484
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-28 20:03:06 +00:00
Aaron Linville
5995238f29 Doc: Fix references to QIconEngineV2 and QIconEnginePluginV2
Fix a few lingering doc references to the old classes.

Task-number: QTBUG-59815
Change-Id: Ia6b406485260c943b018422aaeb8e22ca4406e81
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-04-28 20:02:48 +00:00
Gatis Paeglis
fad814088c do not wrap QAbstractEventDispatcher::flush with QT_DEPRECATED_SINCE
... as this would require us to remove usage of QAbstractEventDispatcher::flush
from Qt source code as well. We can not do this already in Qt 5.9 as there are
few event dispatchers in Qt that actually do override the ::flush (with non empty
bodies). Removing this code could result in behavior changes (not very likely) for
some user code. This method will be removed in Qt6.

Instead mark it with a well known "### Qt{Version}" comment.

This patch amends 41eefd7. The warning was:

qcoreapplication.cpp: In static member function ‘static void QCoreApplication::flush()’:
qcoreapplication.cpp:733:48: warning: ‘virtual void QAbstractEventDispatcher::flush()’ is deprecated [-Wdeprecated-declarations]
         self->d_func()->eventDispatcher->flush();

Change-Id: I48a1c68b84ff93268956205e1205e6d4b5d48664
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-28 17:23:18 +00:00
Thiago Macieira
63b94c5772 Export QPlatformThemeFactory, for use in qtdiag
Change-Id: I0e1a09998253489388abfffd14b5ee5392b0ce52
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-04-28 12:37:14 +00:00
Tasuku Suzuki
179fe5981f Fix build without features.networkproxy
Change-Id: Ie0868b2d2ec30513e870861514b252a79dff4998
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-28 12:33:17 +00:00
Gatis Paeglis
5106d496f3 wrap QCoreApplication::flush with QT_DEPRECATED_SINCE
... in cpp file as well.

This patch amends 41eefd7.

Change-Id: Id6a4dfd3a93a600fe3bb84bb74379451ad167aa8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-28 08:40:48 +00:00
Tasuku Suzuki
9b8a7de794 Fix build without features.style-stylesheet
Change-Id: Ib7cf5db6c9a49e7f359410bc0ec3d1ceadcde5cf
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-28 08:10:49 +00:00
Allan Sandfeld Jensen
82c06fb0f5 Fix return of empty paths with multiple points on intersections
The intersection algorithm for intersection with rects, might return
one edge of the rect even if that edge does not intersect with the path.
To deal with that we collapse paths with empty bounding rects to the empty path.

Task-number: QTBUG-60024
Change-Id: I3e305983c66548e772d7d7ce3de99d715edbdd1b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-04-28 07:58:25 +00:00
Thiago Macieira
851b39a6d6 Update detection of $DESKTOP_SESSION
I don't know how widespread this use is, but apparently sddm seems to
set DESKTOP_SESSION to be the .desktop file that it used to launch the
session (minus the .desktop extension). In that case, we should read the
DesktopName entry from the file to get the actual desktop type.

And since the desktop detection from QGenericUnixServices should
suffice, we don't need to repeat the same code in QGenericUnixThemes.

Change-Id: I0e1a09998253489388abfffd14b5eeefbd7fe740
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-04-27 22:35:06 +00:00
Tasuku Suzuki
a9e0879ee1 Fix build without features.shortcut
Change-Id: I87a7ba1a77b0671559616a3ea4722bcc233af32d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-27 15:38:31 +00:00
Thiago Macieira
c1e19a2ecb QSysInfo: Make use of the QT_WARNING_DISABLE_DEPRECATED macro
We have it for a reason.

Change-Id: I84e363d735b443cb9beefffd14b8f355aeb8a31c
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-27 15:27:25 +00:00
Oliver Wolff
11e37a0e8c winrt: Use list initialization for KeyInfo's members
Change-Id: Idd05d1e1332efd9afc9816a48437fee377730735
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-04-27 07:00:17 +00:00
Oliver Wolff
eb77a24faa winrt: Fix text value for key release events
The text member was never filled and thus was not set in onKeyUp.

Change-Id: I0d0094745c385e0942635da643d863868b010c2a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-04-27 07:00:16 +00:00
Oliver Wolff
4bfb464570 winrt: Remove wrong parameter from handleExtendedKeyEvent call
The event's count parameter is used to determine the number of keys
involved in the key event, not the repeat count of the key press.

The desktop windows implementation does not pass the "count" parameter,
so we omit it as well.

The tryShortcutOverride parameter is only used on macOS and thus can be
omitted as well.

Change-Id: Id7554e43cc73ec616f68444e82a38418e622e20a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-04-27 07:00:15 +00:00
Dyami Caliri
32f8cbae90 QOpenGLWidget: Fix UB (invalid cast) in ~QOpenGLWidgetPrivate
The QOpenGLWidgetPrivate destructor calls reset(), which accesses
the Q-pointer. Calling Q_Q(Class) while still inside the private
class's destructor is wrong due to the cast in q_func() which is
undefined behavior at that stage.

Here is the UB report:
qopenglwidget.cpp:548:5: runtime error: downcast of address 0x000016d0e200 which does not point to an object of type 'QOpenGLWidget'
0x000016d0e200: note: object is of type 'QObject'
 00 00 00 00  10 30 32 0f 00 00 00 00  40 e2 d0 16 00 00 00 00  80 7b 42 0f 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'QObject'

0     QOpenGLWidgetPrivate::reset    qopenglwidget.cpp    656    0x607e667
1     QOpenGLWidgetPrivate::~QOpenGLWidgetPrivate    qopenglwidget.cpp    570    0x60982ab
2     QOpenGLWidgetPrivate::~QOpenGLWidgetPrivate    qopenglwidget.cpp    569    0x6098516
3     QScopedPointerDeleter<QObjectData>::cleanup    qscopedpointer.h    54    0xcbf7058
4     QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer    qscopedpointer.h    101    0xcbde858
5     QObject::~QObject    qobject.cpp    1042    0xcb94792
6     QWidget::~QWidget    qwidget.cpp    1701    0x5e173f7
7     QOpenGLWidget::~QOpenGLWidget    qopenglwidget.cpp    946    0x608d72b
8     ImagePreviewComponent::~ImagePreviewComponent    imagepreviewcomponent.h    16    0x58237b6
9     ImagePreviewComponent::~ImagePreviewComponent    imagepreviewcomponent.h    16    0x58238c6

Change-Id: If13932ac657afb9d1358ac82ab911a05e96cfbcd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-27 01:38:48 +00:00
Gabriel de Dietrich
445191bba8 QMenu: Display the menu title on the torn-off menu's title bar
Change-Id: If16e262a6c8b39dff517cc105cf55686d4c22582
Task-number: QTBUG-11693
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-26 22:27:53 +00:00
Shawn Rutledge
6107f63f93 QXcbConnection::xi2ReportTabletEvent: use fixed1616ToReal
This should not change the result since fixed1616ToReal also divides
by 65536.  It's just to make it consistent with the other places that
we use fixed1616ToReal.

Change-Id: I96b3a07d1cbc98d7bdbe7a3b6035b196e34a5abc
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-04-26 18:57:57 +00:00
Thiago Macieira
8e6a17f687 Fix unused private fields in dbusmenu and dbustray
qdbusplatformmenu_p.h:131:9: error: private field 'm_reserved' is not used [-Werror,-Wunused-private-field]
qdbusplatformmenu_p.h:192:10: error: private field 'm_isSeparator' is not used [-Werror,-Wunused-private-field]
etc.

Change-Id: I84e363d735b443cb9beefffd14b8bc4253081145
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-26 13:11:39 +00:00
Thiago Macieira
6ac33c4841 Fix warnings about unused private fields we can't remove
These are in public classes, so we can't remove them until we get to
Qt 6.

qtimer.h:231:20: warning: private field 'del' is not used [-Wunused-private-field]

Change-Id: I84e363d735b443cb9beefffd14b8b5fb720c9e41
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-26 13:07:01 +00:00
Thiago Macieira
bd52bff35d Fix Clang build: it does not have __attribute__((optimize(x)))
Change-Id: I84e363d735b443cb9beefffd14b8b5f3885b84d6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-04-26 13:06:46 +00:00
Thiago Macieira
ac9103fd85 Fix ICC build with Q_FALLTHROUGH
ICC 17 does not yet implement C++17 [[fallthrough]] nor does it support
GCC's __attribute__((fallthrough))

Change-Id: I84e363d735b443cb9beefffd14b8aba60a7e3f81
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-04-26 12:53:36 +00:00
Timur Pocheptsov
2d2dd85766 QSslSocket (SecureTransport) - use anchors only from QSslConfiguration
Calling SecTrustSetAnchorCertificatesOnly(trust, false) we actually extend
what our user provided in QSslConfiguration as CA certificates (caCertificates,
setCaCertificates) - Secure Transport will also use a default set provided
by the system and SSL handshake can surprisingly (for a user) succeed.
And the default content of these caCertificates, if not altered by setCaCertificates
call - are those system CA certificates.

Task-number: QTBUG-60233
Change-Id: I8c1094bb7eec260f5202a47085f9f75e720eda7b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-04-26 12:42:40 +00:00
Tasuku Suzuki
36553f8efe Fix warning for -no-feature-evdev
Change-Id: I95af276a6d21e67a980cce1d8c6e41900ece7f31
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-26 09:09:22 +00:00
Vyacheslav Koscheev
5d61c0882c Android: add logging to QtCore JNI_OnLoad
Change-Id: I15609d14ac39f89bcba72df33d33a25ac23ad516
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-04-26 07:28:46 +00:00
Ulf Hermann
40fdc4f44c Check for qApp before using it in ibus plugin
We might call updatePreeditText from the QCoreApplication dtor by
running an event loop from inside a "post routine" added with
qAddPostRoutine().

Task-number: QTBUG-60000
Change-Id: I04c08fe36bfa63ac345a06e50952d2ec83a78ac0
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-04-25 16:51:32 +00:00
Tasuku Suzuki
b6ae2695af Fix warning for -no-feature-multiprocess
Change-Id: Ifa3382098c8f7c2cb1750b7ac5e583ddd71895e2
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-25 09:51:08 +00:00
Tasuku Suzuki
3828022508 Fix warning for -no-feature-cursor
Change-Id: I58a2bd715ff1767571d076a881872bd5eab2caec
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-25 09:50:30 +00:00
Stephan Binner
21db5ebea9 Fix warnings for -no-feature-animation
Change-Id: I624e68e96d2a673b36d9519d1189fe4a25e1fbd0
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-25 09:50:07 +00:00
Shawn Rutledge
fccc831af6 xcb: include keyboard modifiers with every touch event
Task-number: QTBUG-60389
Change-Id: I9bf77dffc39b82993bc66c7c7c26e3fa9778534e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-04-25 08:37:40 +00:00
Paul Olav Tvete
5170ed8efb Don't use eglGetProcAddress() on Android
Android 4.1 has a limitation on how many slots are available
for eglGetProcAddress().

This reverts commit 7e393280e4
("OpenGLES20 direct function call removed") for the Android platform only.

Task-number: QTBUG-60318
Change-Id: I4a7224583e775143021735c037af07a95abbd6bf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-25 08:29:48 +00:00
BogDan Vatra
c76918b2b2 Use gdbserver command from a safe place
Removed support for old QtCreator versions (pre 3.5)

Change-Id: I5ec0e965c09c8a76810144b133af3395e32fddfa
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-25 08:07:49 +00:00
Thiago Macieira
9e2c6899e0 QUrl: fix IDN conversion when the ACE form is invalid
We guarded against the Unicode form being invalid and did not produce an
encoded form. But we did not guard against proper Punycode sequences
that decode to forms that had not passed the proper Nameprep stage. So
check for that and, if it fails, just keep the label in the form we
found it in (it's valid STD3 anyway).

[ChangeLog][QtCore][QUrl] Fixed a bug that caused certain domain names
that look like Internationalized Domain Names to become corrupt in
decoded forms of QUrl, notably toString() and toDisplayString().

Task-number: QTBUG-60364
Change-Id: Iadfecb6f28984634979dfffd14b833142cca8d0d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-25 00:51:43 +00:00
Tor Arne Vestbø
e7222c0a71 Make QT_ASCII_CAST_WARN more informative
Change-Id: I4b9aad9cc2f2605a01635c2760e76fde7023f92f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-24 22:31:36 +00:00
Thiago Macieira
21dd5d314a QUrl: fix IDN whitelist checking when the TLD is in Unicode
The whitelist is kept in ACE form, so if the TLD came in Unicode, we
need to run ToASCII before we can check the whitelist. This is slightly
inefficient because we'll run the same operation later in this domain.

Change-Id: Iadfecb6f28984634979dfffd14b831f37b0f4818
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
2017-04-24 19:29:57 +00:00
Gatis Paeglis
fbb485d4f6 Prevent busy loop in glib event dispatcher
.. when running event loop with QEventLoop::ExcludeUserInputEvents.

In a properly functioning code, g_main_context_iteration is expected
to block until any event source becomes ready to dispatch an event
(or interrupt occurs). Qt provides several custom event sources to
the Glib event loop. The bug (busy loop) was caused by faulty event
source implementation when QEventLoop::ExcludeUserInputEvents is set.
As long as the window system's event queue was not empty, we signaled
to the event dispatcher that there is an event ready to be dispatched.
This results in the dispatcher calling the relevant dispatch function
(which does handle the ExcludeUserInputEvents flag correctly). As we
do not dispatch user events, the window system's event queue never
becomes empty and we enter a busy loop (CPU running at 100%) where we
signal that we have events to dispatch, but we actually do not dispatch
them and g_main_context_iteration never gets to block.

This busy loop can cause blocking GTK functions such as gtk_dialog_run()
never return.

Task-number: QTBUG-59760
Task-number: QTBUG-57101
Change-Id: I545b7951108eeaba019614ae8f5a1168c8b26c27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
2017-04-24 18:11:13 +00:00
Kai Koehne
c2cac34e94 gradle: Complete qt_attribution.json file
Add it to the qtcore documentation, but mark it as a tool (code does
not get shipped with customer application).

Change-Id: I75cc199a2bbd86f9e40a75396144645ea69a7bd1
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-04-24 12:51:47 +00:00
Jesus Fernandez
87f9a44ef0 Fix QSqlRelationDelegate when using quotation marks
Strip the quotes from the field name in QSqlRelationalDelegate
implementation to able to find the field in the dictionary.

Task-number: QTBUG-59137
Change-Id: I2f1dc9ce3b9c91ca6cc3d3b82e61e1456c3b22c7
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-24 12:23:50 +00:00
Morten Johan Sørvig
8bc36c773f Cocoa: Send correct mouse buttons for tablets
Tablet vendors allow user configurable pen buttons
where the user may assign a logical mouse button to
a given physical button.

In the case of Wacom tablets this mapping is not reflected
in the buttonMask API, which returns the state of
the physical buttons.

Use NSEvent buttonNummber instead, which returns the
logical button number, after applying user mappings.
Unifiy button state stacking with the mouse handlers.

Handle a special case where buttonNumber returns 0
for tablet right mouse presses. We get these events
via rightMouse* event handlers and can hardcode the
button number.

Change-Id: I06b9b1aa98c49b84f7e3871e694c22c7ad0169d6
Task-number: QTBUG-57487
Task-number: QTBUG-54160
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-24 09:19:31 +00:00
Olivier Goffart
2eee24702b Fix UB in QSplitter::childEvent
The widget might be in the QObject destructor when the event is received,
so we can't static cast.
There is no need to check for isWindow for ChildRemoved because it would
not otherwise be on our list.

Change-Id: Ifc0a2979f1f6720f1963399276a28ac4a3224fff
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-04-23 10:11:14 +00:00
Olivier Goffart
88b6abcebf Fix UB in QStandardItemModel
The destructor of QStandardItem needs to access the model. So we need to
destroy them before the QStrandardItemModel gets destroyed.
In the destructor of the private, it is already too late because we are
already in the ~QObject

Since the destructor of QStandardItemPrivate is now empty, remove it
completely. There is no need for QStandardItemPrivate to have a virtual
table as there are no class that inherit from it.

Change-Id: Id6639e21f277f1c4e85c3f9bc720b4f29eb16c2c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-23 10:11:01 +00:00
Gatis Paeglis
41eefd7493 Deprecate QCoreApplication::flush()
... as it has outlived its original purpose:

Qt3 implementation on X11:
void QApplication::flush() { flushX(); }
void QApplication::flushX() { if (appDpy) XFlush( appDpy ); }

Qt4 implementation on X11:
Did nothing when QApplication::flush() was called (the flush()
overrides in {unix,glib} event dispatchers with empty bodies).

In Qt5 this function somehow has been repurposed (inconsistently)
to do what QCoreApplication::sendPostedEvents already does:

QAbstractEventDispatcher::flush() = 0;
 => QCocoaEventDispatcher::flush() {}
 => QEventDispatcherCoreFoundation::flush() {}
    => QIOSEventDispatcher (does not override ::flush())
 => QEventDispatcherGlib::flush() {}
    => QPAEventDispatcherGlib (does not override ::flush())
 => QEventDispatcherUNIX::flush() {}
    => QUnixEventDispatcherQPA (when QT_NO_GLIB=true)
       ::flush() { if (qApp) qApp->sendPostedEvents(); })
       ==> QAndroidEventDispatcher (does not override ::flush())
 => QEventDispatcherWin32::flush() {}
    => QOffscreenEventDispatcher::flush() {
         if (qApp) qApp->sendPostedEvents();
         QEventDispatcherWin32::flush();
       }
    => QWindowsGuiEventDispatcher (does not override ::flush())
       => QWindowsDirect2DEventDispatcher (does not override ::flush())
 => QEventDispatcherWinRT::flush() {}
    => QOffscreenEventDispatcher::flush() {
         if (qApp) qApp->sendPostedEvents();
         QEventDispatcherWinRT::flush();
       }
    => QWinRTEventDispatcher (qminimaleglintegration.cpp) (does not override ::flush())
    => QWinRTEventDispatcher (qwinrteventdispatcher.h) (does not override ::flush())

Whatever this function was doing on macOS in Qt3 and Qt4 also has been
dropped in Qt5. It appears that the other event dispatchers in Qt5 that
have overrides for flush() have simply copy-pasted this logic.

Clearly the documentation of QCoreApplication::flush() is outdated and
has nothing to do with the actual implementation in Qt5.

This function is rarely used in Qt5 sources. It should be safe to remove
the calls to QCoreApplication::flush() from Qt source code, as this
function has been doing nothing on most platforms anyways. Repurposing
it even broke handling of posted events (see QTBUG-48717).

[ChangeLog][QtCore][Event loop] QCoreApplication::flush() is now
deprecated. Use QCoreApplication::processEvents() and
QCoreApplication::sendPostedEvents() instead.

Task-number: QTBUG-33489
Task-number: QTBUG-48717
Change-Id: Icc7347ff203024b7153ea74be6bf527dd07ce821
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
2017-04-22 15:18:01 +00:00
Olivier Goffart
d4cdc45426 Fix QMetaMethod::invoke and automatic type registration
This was simply not working for two reasons:
 - The index passed to QMetaObject::metacall was not right (there was an offset
   because of the return type)
 - If the registration succeeded, the arguments were not even initialized.

The tests in tst_moc always called QMetaMethod::parameterType before calling invoke,
which was properly registering the type. So this was not seen in the tests before.

[ChangeLog][QtCore][QMetaMethod] Fixed crash in invoke() with QueuedConnection and
types whose metatype gets automatically registered.

Task-number: QTBUG-60185
Change-Id: I4247628484214fba0a8acc1813ed8f112f59c888
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-22 11:25:49 +00:00
Laszlo Agocs
23287dfb15 Update qopenglext.h
Change-Id: Ifb1d20855f0c0b9459d7ff2e01fbda1f713bff35
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-22 11:05:49 +00:00
Laszlo Agocs
01902c2343 Update qopengles2ext.h
Change-Id: I03b867133a00ef6e662a05d5eac7a733747fb8be
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-22 11:05:43 +00:00
Morten Johan Sørvig
b113107419 QMacStyle: Fix scroller memory leak
Calling initWithFrame repeatedly on the same object
leaks memory since internal structures allocated on
the previous init call will not be released.

However, initWithFrame is the only API that can set
scroller direction, which is does based on the geometry.

Use two scroller objets, one for each of the horizontal
and vertical cases.

Task-number: QTBUG-60004
Change-Id: I5d07b62e6969a1824ab705941ac4d0340139b99c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-04-21 16:52:36 +00:00
Gabriel de Dietrich
5cde07350c QMacStyle: Properly flip vertical sliders
Cocoa is better than us at vertically flipping views,
so we use that API instead of fiddling with the graphics
context transforms. But only so from 10.12 onwards. Go
figure.

This also fixes a one pixel offset with horizontal sliders
handle on non-retina displays.

Change-Id: Ia3da8431ad0499a4b6fb7bf6973ed353d91c2905
Task-number: QTBUG-59666
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-21 16:52:22 +00:00
Tor Arne Vestbø
031e0f4364 macOS: Fix crash when closing windows with raster backingstore
After 5b78fcd03b the raster backingstore tries to use the platform window
to resolve the native DPR, but we might not always have a platform window.

Instead we go though the window, like before, which has fallback paths for
the case of no platform window, and then remove the Qt scaling factor
manually.

Change-Id: I19c8383b0a33f3d97aaf0d0e886ed03e14cb1592
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-04-21 15:12:52 +00:00