Commit Graph

29048 Commits

Author SHA1 Message Date
Maurice Kalinowski
6aa3ba0a0b winrt: add vcruntime.lib to standard libs to link
This is required for projects compiled with CONFIG-=qt, which is not
supported so far, but is required for the new configure system.

Change-Id: I85d7de9105ff68c73e8a433a3c757864a619cce8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-08 09:48:33 +00:00
Oswald Buddenhagen
ae190c24a0 fix enable/disable of -xkb-common-x11
Change-Id: I2d0b7a8ed2f30422cb1af2cac8dca0e718509021
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-08 09:48:29 +00:00
Kai Koehne
149023c02d Remove unused legal.qdoc file
This is most likely a left over from Qt 4.

Change-Id: I5a13d31e815cf2047bcc064e9418c061ee82e58b
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-08-08 06:15:28 +00:00
Marc Mutz
964290126e tests/auto/corelib/codecs: clean up
- port Q_FOREACH to C++11 range-for
- port uses of inefficient QLists to QVector

Fixes errors pointed out by my tree's static checks.

Change-Id: Ica50f44d862f635df06cb8f09ce506b9d30fdfc5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-06 14:49:21 +00:00
Marc Mutz
e38064f698 tst_utf8: use QScopedPointer, not QSharedPointer
There's no sharing, and the use of QSharedPointer(T*)
triggers my tree's static analyzer.

Easiest fix is to port to QScopedPointer, which is the
correct smart pointer to begin with.

Change-Id: I105c1a334c3d6712a475600c8394b0bebc420677
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-06 14:49:16 +00:00
Marc Mutz
c0b6e16ffa tests/auto/corelib/global: clean up
- port Q_FOREACH to C++11 range-for
  (except in the Q_FOREACH tests :)
- port uses of inefficient QLists to QVector
- include QTest, not QtTest

Fixes some errors pointed out by my tree's static checks.

Change-Id: Ibb21a280537af74dda5679ec7c75d59477b6de55
Reviewed-by: David Faure <david.faure@kdab.com>
2016-08-06 14:49:09 +00:00
Marc Mutz
96317570ef tst_QPainterPath: clean up
- port uses of dynamic containers with static content to constexpr
  C arrays

Fixes errors pointed out by my tree's static checks.

Change-Id: I5e1cafa6e428500afae0d653ce48a7fb465c19ed
Reviewed-by: David Faure <david.faure@kdab.com>
2016-08-05 19:33:05 +00:00
Marc Mutz
009f1f2812 QString: fix regression comparing null QString with null const char *
Commit 4a40c717f3 optimized
QString::compare_helper(QChar*, int, char*, int), but got
the case wrong where the rhs is null, but the lhs is empty,
not null (which is the case even with a null QString, as
QString().constData() != nullptr). The correct result in
this case is 0, since in Qt empty and null strings compare
equal.

Fix by checking the length of lhs, not its pointer.

Task-number: QTBUG-55154
Change-Id: I3ec2cd25d9bdca90cf3f5568a875b1e52c779979
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-05 18:52:16 +00:00
Christian Kandeler
4b63ab9a93 QJsonValue::toVariant(): Differentiate between null and invalid
Both were mapped to QVariant() before. Instead, use a null pointer
QVariant for a null JSON value.

[ChangeLog][QtCore][QJsonValue] QJsonValue(Null).toVariant() now returns
a QVariant of type QMetaType::Nullptr instead of an invalid QVariant.

Task-number: QTBUG-43077
Change-Id: Ife611f418583dbff542210bc8c5cd65201212a6e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-05 14:53:33 +00:00
Friedemann Kleint
2cd2cba086 QtPlatformSupport: Add QAbstractFileIconEngine
Move the code from QtWidgets/QFileIconEngine into a new class with
virtuals in QtPlatformSupport so that platforms can reuse it.

Prototypically use the class in the Windows and macOS QPA plugins.

Remove QPlatformTheme::fileIconPixmap() and change the type
of the hint QPlatformTheme::IconPixmapSizes from QList<int>
to QList<QSize> so that it fits better with the icon code.

Change-Id: I580e936f3507218757565ca099272cd575b3a779
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-05 08:06:21 +00:00
Anton Kudryavtsev
955b2bdfc0 QString: de-duplicate code of variants of lastIndexOf()
Re-use methods of QStringRef.

Change-Id: I0f79ee6767653c694ac6a342263c046a5f5f3baa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-08-04 15:46:12 +00:00
Friedemann Kleint
46ea82188e Add XDG file icon support for UNIX themes
Add helper class XdgFileIconHelper using the icon theme engine
to implement QPlatformTheme::fileIconPixmap().

[ChangeLog][QtPlatformSupport] KDE/Gnome themes now implement
QPlatformTheme::fileIconPixmap(), showing file icons.

Change-Id: I32a948ece08305053ebadb3ace6cbc6fbd339946
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-04 14:31:20 +00:00
Friedemann Kleint
40bb2d29b9 Add QPlatformTheme::fileIcon()
Add a way to return an icon instead of a pixmap of a specific size for a
file for usage by QFileIconProvider, etc.
Fall back to fileIconPixmap() if fileIcon() returns a null icon.

This allows for supporting XDG theme icons and Qt Quick applications
accessing file icons.

Change-Id: I9ffbd6602e1a6a490c0046d950636447c5127474
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-04 14:31:15 +00:00
Marc Mutz
2079081dcf QPolygon: prepare boundingRect() to be extracted as an algorithm
That basically involves reformatting the loop to use iterators.

Change-Id: Ie8e80e7f32b386eae50ab4520c62219e18d2a1bd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-08-04 10:46:11 +00:00
Marc Mutz
ecec9edd5a QPolygon: add a smoke-test for boundingRect()
Nothing fancy, just a safety-net for a following refactoring.

Change-Id: I5be87c86cd61e24bf96881d2485dd7560ea6184a
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-08-04 10:46:06 +00:00
Timur Pocheptsov
2d1f137173 Revert "Implement protocol upgrade for HTTP/2 enabled requests"
This reverts commit 12d71f4ea2.
This change is breaking a build + incomplete as my test revealed.
Will have to re-try later.

Change-Id: I7ea089093a832aa5822caaaac56e62f5fda4df17
Reviewed-by: Liang Qi <liang.qi@qt.io>
2016-08-04 10:21:24 +00:00
Marc Mutz
4a40c717f3 Optimize QString::compare_helper(QChar*, int, char*, int, cs)
... by using the recently-added QUtf8::convertToUnicode()
and a QVarLengthArray instead of QString::fromUtf8().

Like elsewhere in QString, use a QVarLengthArray<ushort>
instead of the more natural <QChar> to avoid instantiating
another QVLA.

Assume that length2 is usually set to a non-negative value.
Not because that's necessarily the frequent case, but
because a negative length2 leads to an expensive strlen,
that usually dwarfs the additional branch cost.

Check for data2 == nullptr early to avoid having to check
it later twice.

Change-Id: I04bda44ed857451efdf04c3283b5726480dd8c0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-04 09:28:41 +00:00
Jędrzej Nowacki
31520c4fc0 Add missing include in qeventloop_p.h
The code depends on qApp to be visible in the scope

Change-Id: Ibeb54c90f5a65f441e9eb90b848952b955c71f0d
Reviewed-by: Jesus Fernandez <jesus.fernandez@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-04 08:47:52 +00:00
Jędrzej Nowacki
33ec04d299 Cleanup QDBusVirtualObjectPrivate
The class doesn't exist and should not be forward declared nor declared
as private of QDBusVirtualObject

Change-Id: Icf3ca2b2be5ae0a8111785af485a0b6601002a25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-04 08:47:40 +00:00
Allan Sandfeld Jensen
a9a61d7e0b Fix grayscale painting regression in 64-bit raster engine
A new define for better vectorized compositioning had a mistake that
caused some sources to be converted to grayscale when composited.

Added two 10 bit per channel formats to the lancelot test to catch
regressions in the future.

Change-Id: I1c468e6b93d68185e517fc0d44c6c927f9f7135f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-08-03 15:35:28 +00:00
Kai Koehne
8ce18a52f2 Remove hiding of .main div in offline pages
The section got introduced in commit 93d35c07d0, but was apparently
ignored by browsers due to a non-blank space (0xc2 0xa0).
In commit b3959b515f the space was replaced, causing browsers
to hide the content.

Task-number: QTBUG-55115
Change-Id: I491f8721da5f2a964e450d4a0bee785a937ac7e4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2016-08-03 15:33:49 +00:00
Timur Pocheptsov
12d71f4ea2 Implement protocol upgrade for HTTP/2 enabled requests
Without ALPN/NPN (== without OpenSSL) we can negotiate HTTP/2
using the protocol upgrade procedure as described by RFC7540.
Since there is no TLS handshake, after our http channel was connected
we first send an 'augmented' HTTP/1.1 request - its header
contains additional 'HTTP2-Settings' and 'Upgrade' (to 'h2c') fields.
If we receive reponse 101 (switch protocol) we re-create a protocol
handler and switch to HTTP/2.

Task-number: QTBUG-50955
Change-Id: I36e9985e06ba76edaf7fdb22bb43770f8d593c61
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-08-03 15:31:20 +00:00
Jędrzej Nowacki
d7132c6c6d Add std::nullptr_t as builtin type in QMetaType
Change-Id: If6c484bc89a2610c6a9e3e7bd54ef85ef40a783f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-08-03 11:49:28 +00:00
Alex Blasche
958bc5793f Add QtAndroidPrivate::context()
This simplifies the retrieval of the correct Context object.

Task-number: QTBUG-55102
Change-Id: I303bc5393a7900ceb4bde36e711938f3f49075c1
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-08-03 11:49:27 +00:00
Konstantin Shegunov
5dd907bf63 Save QFont's style name if present
Font style names are quite irregular and the simplistic matching
implemented in QFontDatabase::styleString(const QFont &) is unable to
properly resolve the style name when font is recreated from a string.
This causes the fonts before and after serialization to be considered
different, even though they are not. The from/toString methods were
made to write and respect the exact font style.

[ChangeLog][QtGui][Important Behavior Changes] QFont::toString() and
QFont::key() were modified to save the font's style name if one is
set, invalidating any stored font identifiers. QFont::fromString()
was also adjusted to accommodate the change.

Task-number: QTBUG-54936
Change-Id: Ibc7c54119acdd8f0950d6049cc89f859bf981504
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-03 11:47:58 +00:00
Alex Trotsenko
5a133a404e Polish SCTP examples
- Introduce a common header file for client and server;
- Update license headers;
- Fix minor issues.

Change-Id: I3fc42fd5ba32141c702fc6679a27bf0b6a16fd26
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-08-03 11:46:21 +00:00
Alex Trotsenko
733c4de36e Fix some syntax issues in SCTP implementation
Change-Id: I718fd060e313d544a5470fa20183db04ef89b1ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-08-03 06:21:47 +00:00
Giuseppe D'Angelo
c0637c0298 QObject::connect: allow to disable narrowing of the connection arguments
One of the good features of the new connection style is that
implicit conversion is performed for the connection arguments.

However, this is also a bad feature when it comes to the old
C remnants in the C++ language: for instance, doubles implicitly
convert to ints, possibly losing precision (and GCC/Clang do not
even warn about those under -Wall, only MSVC does) or even
triggering undefined behavior.

For this reason, when using braced initialization, C++11
disables narrowing conversions or floating/integral conversions.
Use this feature when checking the arguments of a PMF-style
signal/slot connection. Technically this makes the program
ill-formed, however GCC still accepts it (but at least
warns under -Wall).

Hence, add a way to disable these implicit conversions.
This is a opt-in and guarded by a macro, as it's a source
incompatible change.

[ChangeLog][QtCore][QObject] The
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT macro has been added.
When using the new connection syntax (PMF-based) this macro
makes it illegal to narrow the arguments carried by the signal,
and/or to perform floating point to integral implicit
conversions on them. When the macro is defined,
depending on your compiler a QObject::connect() statement
triggering such conversions will now fail to compile.

Change-Id: Ie17eb3e66ce0cd780138e60d8bb7da815a4ada83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-02 23:03:15 +00:00
Allan Sandfeld Jensen
65f5a7558a Cleanup canonical font name lookup
Changes the lookup of the canonical "english" font name, so that also
corresponding style-name and preferred names can be found.

This patch does not use that extra information, and should not change
any behavior.

Change-Id: I40805f81e6b35dcc98f9459c5cf96f13a8d789f2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-08-02 14:33:37 +00:00
Alex Trotsenko
fcbbd7bc3d Fix grammar issues in SCTP documentation
Change-Id: I11bfb20dc3d4db98dccfd3bc680fb1ffbd522508
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-08-02 10:03:45 +00:00
Liang Qi
d875d5e2fc Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev 2016-08-02 07:54:03 +00:00
Gabriel de Dietrich
a9603ef7d4 Cocoa QPA Menus: Clean-up QCocoaMenuLoader related code
Now that QCocoaMenuLoader is a singleton, we can access
it the natural way. In all cases, it already needed to
be done in an Objective-C file, so it doesn't change
anything from this point of view.

Furthermore, we decide to remove private accessor APIs
in QCocoaApplication and QCocoaApplicationDelegate which
are now redundant.

Change-Id: I4190ed2e2536b778482c513727e279c9318acb7e
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-08-01 18:32:42 +00:00
Edward Welbourne
f6fc34294f Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	configure
5.7 now supports clang on android; but dev re-worked configure

	src/gui/kernel/qevent.h
One side renamed a parameter of a constructor; the other added an
alternate constructor on the next line.  Applied the rename to both
for consistency.

	tests/auto/tools/moc/tst_moc.cpp
Each side added a new test at the end.

	.qmake.conf
Ignored 5.7's change to MODULE_VERSION.

	configure.json
No conflict noticed by git; but changes in 5.7 were needed for the
re-worked configure to accommodate 5.7's stricter handling of C++11.

Change-Id: I9cda53836a32d7bf83828212c7ea00b1de3e09d2
2016-08-01 18:20:00 +02:00
Laszlo Agocs
c4b4eba188 eglfs: Add support for raster content rotation
Running QWidget or other raster window-based apps with
QT_QPA_EGLFS_ROTATION=180 will now flip the screen as expected.

In addition, 90 and -90 are supported too. These will affect the
reported screen geometry as well.

The OpenGL mouse cursor is repositioned and rotated accordingly. For
true OpenGL content the rotation is ignored. Hardware mouse cursors
(DRM) ignore it as well for the time being.

[ChangeLog][Platform Specific Changes] QWidget-based applications
running on the eglfs platform plugin can now request 180 or 90 degrees
rotated output by setting the QT_QPA_EGLFS_ROTATION environment
variable.

Task-number: QTBUG-39959
Change-Id: I3570b515d0233c6c6a0e813899b935ee222eab62
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-08-01 15:29:38 +00:00
Oswald Buddenhagen
97c00e66c8 fix namespaced build
Change-Id: I37b571db193d444ea60d508375fef89add467d1e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-08-01 11:51:34 +00:00
Marc Mutz
daab9e38c3 QBrush: optimize detach()
Previously, detach() would detach on every style change. But there
are only three QBrushData classes, thus many styles use the same.

So instead of checking for style identity, check for style equivalence,
where equivalence is defined in terms of use_same_brushdata().

Change-Id: I7548c6022a45e542ca0d3ea00d837cd4ff93df34
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-08-01 11:43:02 +00:00
Andy Shaw
0ec512e90b Export QTextDocumentPrivate with Q_GUI_EXPORT
QTextDocument is used from several different Qt modules so it needs to be
possible to access its privates from outside of Qt Gui.

Change-Id: I8087f8312e0db46bd457a6119d974caa27660d57
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-08-01 11:03:35 +00:00
Frederik Gladhorn
6f75096afc Add helper function to reset QMouseEvent localPos
In Qt Quick there are many places which copy mouse events repeatedly,
with the only goal of adjusting the local position. Instead it's much
more sensible to re-use the same event.

Change-Id: I2c6f2b73ee3a7a6df489f813cf2f60b48a6e48df
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-01 09:58:23 +00:00
Friedemann Kleint
0eb77c3011 mimetypebrowser example: Add Generic Icon Name
Show QMimeType::genericIconName() to description pane.

Change-Id: I698d07084b6396469686057ea53e2f497fdbe287
Reviewed-by: David Faure <david.faure@kdab.com>
2016-08-01 09:41:10 +00:00
Liang Qi
3cb7302480 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/widgets/itemviews/qabstractitemview.cpp
	src/widgets/itemviews/qabstractitemview_p.h

Change-Id: I54589b1365103cb1749186af92aab03a49c94b64
2016-08-01 10:03:21 +02:00
David Faure
f2995ee078 QWaitCondition: add notify_one/notify_all, i.e. STL naming
This makes the API more consistent with the STL, which helps discovering
the API. Much like QVector has push_back etc.

Change-Id: I75f6b77ab94233c15e17f66605f4bf13aa03e61c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-07-30 12:10:29 +00:00
Timur Pocheptsov
7876add8b1 QSslDiffieHellmanParameters_dummy - remove Q_UNIMPLEMENTED
As a part of SSL initialization (done by QNAM on the first HTTP get request,
for example), 'dummy'  Diffie/Hellman parameter's mem-functions constantly
and unconditionally print  'Unimplemented code' even without user
actually calling these unimplemented methods. This is not just annoying,
(just realized I saw this 'Unimplemented code' many times today) this also breaks several
our auto-tests (xmlpatterns/qquickimage for example) - the ones that expect output
to be empty.

Task-number: QTBUG-55003
Change-Id: I5e4822e9783de32aa4b00843a9916eafea3689c0
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-29 16:51:53 +00:00
Morten Johan Sørvig
2ff1557937 Cocoa: Don’t beep on return keypress
Limit event propagation to AA_PluginApplication
Applications.

Change-Id: Id56ceea8d2aacae3f2be17f5894791de4eca528e
Task-number: QTBUG-54211
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-07-29 12:28:35 +00:00
Friedemann Kleint
a5c851598c moc: Add warnings when resolving and opening includes fails
Previously, only cryptic warnings:

QFSFileEngine::open: No file name specified

occurred.

Task-number: QTBUG-55014
Change-Id: Ic99614eb58c605ed6e1b86d3d4b8f527c5b9244c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-07-29 12:10:36 +00:00
Laszlo Agocs
dd3a08dd53 Make QOpenGLTextureBlitter public
Change QOpenGLTextureBlitter to be a public API, as it was originally intended.
There are now significant external uses outside qtbase (C++ compositor examples
in QtWayland), and the API is considered proven enough.

[ChangeLog][QtGui] QOpenGLTextureBlitter, a utility class to draw textured quads,
has been made public.

Change-Id: If7a2c94e1494195e2aa375d214932fa7b4c78321
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-07-29 07:21:10 +00:00
Laszlo Agocs
a89875cd69 Fix names of eglfs features
Change-Id: I0f43eea2ebc0dff945801c893302807bb71bc5d3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-07-29 07:21:01 +00:00
Laszlo Agocs
4940194a35 Use pkg-config for RPi EGL detection
The config test for eglfs-brcm would fail otherwise on modern Yocto-based
sysroots, as these have no /opt/vc, but have a proper egl.pc that has the
include path and libs.

Task-number: QTBUG-50838
Change-Id: Ibe8dcfbfe9aabe00fd8c040e6e41a4479ccb39bb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-07-29 07:20:58 +00:00
Laszlo Agocs
c8f29602d6 Add missing configure status reporting for eglfs-brcm
Change-Id: I05031b3170b922db17387e94a18a52879f3362f9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-07-29 07:20:53 +00:00
Denis Kormalev
f24cc53cc2 Fix for race condition in signal activation
There was a race condition between QObject::disconnect() and
QMetaObject::activate() which can occur if there are multiple
BlockingQueued connections to one signal from different threads and
they connect/disconnect their connections often.

What can happen in this case is:
T1 is in activate() method and T2 is in disconnect() method

T1                          T2
locks sender mutex
selects next connection
unlocks sender mutex
                            locks sender mutex
                            sets isSlotObject to false
creates QMetaCallEvent      derefs connection
posts event

Two things can happen here:
1. Connection can still be valid, but it will have isSlotObject==false
and callFunction will be used instead of slotObj
2. Connection can already be invalid

To fix it mutex unlock should be moved after QMetaCallEvent creation.

Also there is another case, when we don't disconnect but delete the
receiver object. In this case it can already be invalid during
postEvent, so we need to move mutex unlock after postEvent.

Change-Id: I8103798324140ee11de5b4e10906562ba878ff8b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-07-29 06:09:22 +00:00
Marc Mutz
10d4969966 examples: use QSignalBlocker
Examples should show idiomatic Qt, and QSignalBlocker is idiomatic
since it's inception in Qt 5.3. Just updating the examples was
forgotten.

This commit makes good for that.

Fix coding-style issues as a drive-by.

Change-Id: If138e87ea2ab7a444599734113f7cc6df11fb42d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-07-28 23:43:32 +00:00