Commit Graph

32072 Commits

Author SHA1 Message Date
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
Thiago Macieira
ab44ac021d Clean up mkspecs from old, unsupported and untested mkspecs
They have not been tested with Qt 5, not even once to make sure
that the mkspec passes the sanity check.

This removes for OSes:
  HP-UX (running on PA-RISC -- Itanium still supported)
  SGI IRIX
  SCO Unix
  Tru64 Unix
  Unixware

And compilers:
  IBM xlC (Visual Age C++)
  HP aCC compiler (PA-RISC and Itanium)
  PGCC, cxx and kcc on Linux

There were a couple more OSes detected in the configure script that were
lacking even the mkspec. Those have also been removed.

Of those, only hpuxi-acc and aix-xlc have been tested in the last 9
years, though only with Qt 4 and never tried with C++11 support. IRIX
was last tested over 10 years ago and PA-RISC is definitely not
supported due to its lack of atomic operations.

Support for HP-UXi and AIX is now only possible with GCC (assuming GCC
supports those). Support files for Oracle's Sun Studio compiler are left
behind, but its state is unknown.

Change-Id: I7814054a102a407d876ffffd14b69c796b97c972
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-27 22:34:34 +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
Timur Pocheptsov
b6968f508c Revert "Blacklist tst_QSslSocket::protocolServerSide on OS X 10.11"
This reverts commit 96c27f0dfa.
We now use a custom keychain that should fix the original
problem with the test.

Change-Id: I52e4105f34a46ad7080750d9a62480ebe3a56e68
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-27 12:25:51 +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
Timur Pocheptsov
5218a80bd1 Revert "tst_qsslsocket::protocolServeSide - fix for macOS 10.11"
The fix is outdated - the tests it was fixing - pass on 10.11.

Change-Id: I8b42c1d3d2f1279382b15c20587dcc93cf1b6b40
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-26 13:18:20 +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
Sami Nurmenniemi
e5a1c7fff7 Fix tst_QLineEdit for offscreen and minimal platforms
Unselecting with offscreen and minimal platforms behave similarly as in
Windows and QNX. If left or right key is used for unselecting, cursor
position is changed.

Change-Id: I022cd2fec80ad1875fec983e1e3536a105e18bb2
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
2017-04-26 12:42:08 +00:00
Topi Reinio
99017d78ee qdoc: Do not exclude *_p.cpp files from source files to parse
Some of the public APIs are still documented in private (_p.cpp)
source files. Let qdoc parse them.

Change-Id: I29ad87c21d663504f2b947d8b9ed76609c7946f3
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-04-26 12:25:26 +00:00
Sami Nurmenniemi
a1e94bcfbb Fix tests that assume system files are owned by root for qemu
If QEMU is provided sysroot with QEMU_LD_PREFIX, it opens files from there. If their
owner is the current user, testing their access rights based on assumption that they
are root fails. Skip the tests in that case similarly as is already done when the
tests are run as root.

This fixes following tests:
- tst_QTemporaryDir::nonWritableCurrentDir
- tst_QNetworkReply::getErrors(file-permissions)
- tst_qstandardpaths::testCustomRuntimeDirectory

Task-number: QTBUG-59966
Change-Id: I972ce37b4b5a7747cdd732a8e4a737ef09cbc6a5
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-26 09:12:12 +00:00
Sami Nurmenniemi
9b52cfd64c Fix tst_QWindow modal dialog tests for offscreen and minimal platforms
Changed testing of focus of modal dialogs to match behavior on offscreen
and minimal platforms.

Change-Id: Ife3ea41b4b78df2e64c8d8e740332914b1e5a67c
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
2017-04-26 09:11:53 +00:00
Sami Nurmenniemi
ba21e42463 Fix tst_QWidget for platform "offscreen"
Some features are not implemented by "offscreen" platform. Skip tests
failing because of that. Some failing cases are also already skipped or
blacklisted on "xcb" platform.

Change-Id: I17269169379c270bd7d6f2ddda03ad9b114a71ce
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
2017-04-26 09:11:41 +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
Tony Sarajärvi
2d1a115f9f Blacklist tst_MacGui autotest in macOS 10.11
Task-number: QTBUG-60385
Change-Id: I6e692ff55d26b9070343d612e2f872091d5c343d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-24 22:09:12 +00:00
Tor Arne Vestbø
d61502a448 Undefine QT_RESTRICTED_CAST_FROM_ASCII for headersclean build step
The module might add QT_RESTRICTED_CAST_FROM_ASCII to DEFINES to
be able to use string literals under the assumption they are UTF8
without warnings from QT_ASCII_CAST_WARN, but this conflicts with
QT_NO_CAST_FROM_ASCII which is added for the headersclean build
step.

Change-Id: Ic1d7b5415350477d751a6c15219d4f8feb816a3c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-24 19:36:18 +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
Tony Sarajärvi
148188fef3 Rename macos blacklisting to osx
Change-Id: I7e370ad8e1e2cb87188e149c96681e4c18abaa4f
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-04-24 07:24:08 +00:00
Tony Sarajärvi
485b6c99db Blacklist tst_qsemaphore on macOS 10.12
Task-number: QTBUG-58745
Change-Id: I085a2ac60cc24c287140788a88512657238a2c4b
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-04-24 07:24:01 +00:00
Kai Pastor
03c1c750d6 Don't add Qt5::<ModuleName>Private in CMake < 3.0
This change restores usability of Qt with older versions of CMake which
do not provide a language feature used in the implementation of the new
Qt5::<ModuleName>Private targets.

Task-number: QTBUG-60229
Change-Id: I6a6a1b09be3edca200692250bb8f0d7f6a1b8f7a
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2017-04-23 19:31:19 +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