Commit Graph

27675 Commits

Author SHA1 Message Date
Sérgio Martins
6cfdfad7d4 Don't crash while parsing malformed CSS
Task-Id: QTBUG-53919
Change-Id: I31a0e218e4e41ee217f8f87164f115450d69d42c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-10-19 15:38:56 +00:00
Clinton Stimpson
ee22c6505a xcb: fix passing of focus from child to its top level QWindow
With the client message _NET_ACTIVE_WINDOW, not all window managers
will pass focus from a child window to its root window, Detect this
child-to-root case, and use xcb_set_input_focus() instead.

Task-number: QTBUG-39362
Change-Id: Ib32193018e3b725b323f87d7306c9ae9493d78a7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-19 15:24:22 +00:00
Marc Mutz
46078f3374 QOrderedMutexLocker: unlock in reverse order of locking
This is an improvement for the following reasons:

- Should mutex locking allocate any kind of resource,
  unlocking in reverse order will free those resources
  in inverse order, which helps typical allocators.
- If the lock pair is contended, by unlocking in the
  same order as locking, we were allowing the waiting
  thread to wake up to take the first lock just to
  find that the second lock is still held by someone
  else.

The order of unlocking has no influence on the correct-
ness of the algorithm.

Change-Id: Id16b0342aef325c14a7bd8836d3a75db68ef2588
Reviewed-by: David Faure <david.faure@kdab.com>
2016-10-19 13:25:01 +00:00
Albert Astals Cid
8249f490ff Document QClipboard::mimeData can be null
The current wording (reference) seems like it's always a pointer to valid stuff

Change-Id: I2a9f8bde7d2ba672e4e664ff731a3272a6deaaaa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-19 08:58:18 +00:00
Andy Shaw
683c9bc4a8 Windows: Fix regression in QFSFileEnginePrivate::nativeWrite()
Change 0696566b1e caused the block
size to be incorrect for data > 32MB.
Since bytesToWrite changes within the do...while loop, then the block size
can potentially change too each time. So it needs to be recalculated each
time rather than just once.

Task-number: QTBUG-56616
Change-Id: I9880d0985f2d0242c30e67230be7271eb806db95
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-10-19 08:05:32 +00:00
Anton Kudryavtsev
a9835dfe55 QJsonDocument: fix repetition of 'document' in doc
Change-Id: I8909336274b2c72e526d63fe9e21368550de6678
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-19 07:34:56 +00:00
Anton Kudryavtsev
4a4368df56 QAndroidPlatformTheme: wrap char* in QL1S to avoid warnings
Change-Id: Idcc70038051b03366aa447f3a4c48912d3f911d5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-10-18 15:17:03 +00:00
Tor Arne Vestbø
4cb614c7ab Apple OS: Handle QSetting strings with embedded zero-bytes
Saving strings with embedded zero-bytes (\0) as CFStrings would
sometimes fail, and only write the part of the string leading
up to the first zero-byte, instead of all the way to the final
zero-terminator. This bug was revealed by the code-path that
falls back to storing e.g. QTime as strings, via the helper
method QSettingsPrivate::variantToString().

We now use the same approach as on platforms such as Windows
and WinRT, where the string produced by variantToString() is
checked for null-bytes, and if so, stored using a binary
representation instead of as a string. For our case that
means we fall back to CFData when detecting the null-byte.

To separate strings from regular byte arrays, new logic has
been added to variantToString() that wraps the null-byte
strings in @String(). That way we can implement a fast-path
when converting back from CFData, that doesn't go via the
slow and lossy conversion via UTF8, and the resulting QVariant
will be of type QVariant::ByteArray. The reason for using
UTF-8 as the binary representation of the string is that
in the case of storing a QByteArray("@foo") we need to
still be able to convert it back to the same byte array,
which doesn't work if the on-disk format is UTF-16.

Task-number: QTBUG-56124
Change-Id: Iab2f71cf96cf3225de48dc5e71870d74b6dde1e8
Cherry-picked: 764f5bf48c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-18 14:35:08 +00:00
Friedemann Kleint
158231e073 QCommonStyle::standardIcon: Add 64x64 Qt logo pixmap for SP_TitleBarMenuButton
For SP_TitleBarMenuButton, the style defaulted to standardPixmap()
would return a 16x16 XPM encoded pixmap from qcommonstylepixmaps_p.h.
This resulted in a too-small menu icon when displaying QMdiSubWindow
with the default icon set on a High DPI screen with
Qt::AA_DisableHighDpiScaling set.
Add a larger icon from resources.

Change-Id: If88c606a31ee9499f520089365f685ec75e0ddad
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-18 14:08:41 +00:00
Marc Mutz
ed5d04fcfc QOrderedMutexLocker: fix UB (pointer comparison with <) in static relock()
Comparing pointers that do not point into the same array using
operator< is UB. You need to use std::less<>.

The QOrderedMutexLocker ctor already used std::less to compare
pointers, but the static relock() function was not fixed.

Amends 5007352164.

Change-Id: I584d382391dd5a2af75020a4e77f3e42ee5d5708
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-10-18 13:46:11 +00:00
hjk
983d9e0c1a Fix DBus compilation
Don't use C++11 nullptr in 5.6.

Change-Id: I57e9595b2e1cede995eed09878bf02ee30482659
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
2016-10-18 08:04:45 +00:00
Oswald Buddenhagen
4ebe8cefde make also configure tests not see %LIB% and %INCLUDE% under mingw
amends 03ae6ad8e.

Change-Id: I1adfb8d5de59b26e37bd35c5e8e4410d084d8d93
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-17 13:44:43 +00:00
Oswald Buddenhagen
d715667b20 normalize name of plugin default linkage overrides
QTPLUGIN.<foo> is better used with valid variable names, which is not
the case when the plugin type contains slashes (plugin subtypes) or
dashes (just so). normalize these chars to underscores.

Change-Id: Icc93d952b93fef342e2fc93f20e9c5dd010dd734
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-17 13:44:39 +00:00
Oswald Buddenhagen
9a3073a98d don't strip off plugin subtypes
this code is meant to strip off the file name if provided (as the
accessibility plugin in qtdeclarative does), but clearly overshot the
mark by stripping the subtypes (as needed by qtmultimedia, and soon
qtbase as well). use a stricter regexp which matches only names with an
extension, which is a Good Enough (TM) approximation.

Change-Id: I63afe9c7b1b0ebf4da530dcf558e9c84ae3c85ec
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-17 13:44:36 +00:00
hjk
d71bb504a6 Fix QtGui compilation without OpenGL
Change-Id: I2a9f8bde7d2ba672e4e664ff731a3272a6def516
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-16 15:14:13 +00:00
Tor Arne Vestbø
e9110b162c iOS: Report correct physical DPI for iPhone 7 Plus
Task-number: QTBUG-56509
Change-Id: Ibae94262c2a4c917aeca00cb1a1c28e5ae60f0c4
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-14 15:16:52 +00:00
Oswald Buddenhagen
59985b3c29 fix xcodebuilds without -sdk iphonesimulator
the order of the arguments passed to addExclusiveBuilds() determines the
name of the CONFIG flag which actually enables the mode. that is
historically fixed to iphonesimulator_and_iphoneos and we cannot just
change the order.

to get around this, add a new "overload" of the function which allows
specifying the flag independently from the order of the builds, and make
use of it in ios' resolve_config.prf.

amends d2b4a789c.

Change-Id: Ia3fabea0c0c30beae680b57e75bdcdf35ef6503d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-14 14:54:46 +00:00
Michael Brüning
6851cf52af Match MSVC version strings in other languages than English
5971b88ecd introduced a regular expression
to parse the Visual C++ compiler version that failed to match non-English
output (e.g. German), which is produced by default on many systems.

Task-number: QTBUG-56388
Change-Id: Id0408ce31e827e7aa087d8e3dd83024cf09dac23
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-10-14 14:27:12 +00:00
Leena Miettinen
3189313f22 Doc: Fix typo in QtStyledItemDelegate::paint() docs
Task-number: QTBUG-56399
Change-Id: Iaace0ed05098ab6d880b06a40d8e13aa9288c5ec
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-14 13:28:47 +00:00
Friedemann Kleint
b884fc00f4 configure.exe: Detect MSVC version with environment variable CL cleared
The variable may contain the option /nologo, suppressing the output.

Change-Id: I63eedde10aa7264cf56807a0844cadf6293a1d8c
Task-number: QTBUG-56388
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-10-14 13:08:47 +00:00
Albert Astals Cid
adbafab4ef Specify timeout is in milliseconds
Change-Id: I465b343b6fe64c8d1ce17e34be5f864e8556d374
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-14 10:34:01 +00:00
J-P Nurmi
7740f5e98b QMimeXMLProvider: add missing out-of-line destructor
Fixes build with the latest GCC 7.

Change-Id: I4900a256ed1c6cb177d7f94d54e5b07c06ddad08
Task-number: QTBUG-56514
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-10-13 16:54:30 +00:00
Frederik Gladhorn
23c7816f44 Doc: add notes about validator and completer in QComboBox
When setting the editable property to false, we delete the internal
QLineEdit used by QComboBox. Add comments that this results in the loss
of validator and completer.

Task-number: QTBUG-56035
Change-Id: Ife04ac2b9bb3f32fae5328f1ec73b1d5d769d52c
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Nico Vertriest <nico.vertriest@theqtcompany.com>
2016-10-13 15:58:57 +00:00
Alexandru Croitor
cd1d114140 Unset qgl_current_fbo when the default FBO is bound
Previously when a new QOpenGLFramebufferObject was bound, the
QOpenGLContextPrivate::qgl_current_fbo member was also updated to point
to this new object.
But if a user called QOpenGLFramebufferObject::bindDefault(),
qgl_current_fbo was not unset, meaning that if the FBO object would be
deleted at some point, qgl_current_fbo would be a dangling pointer.

This patch makes sure to clear the value of qgl_current_fbo when
bindDefault() is called. It is cleared, and not set to point to another
object because the default platform OpenGL FBO is not backed by a
QOpenGLFramebufferObject.

Task-number: QTBUG-56296
Change-Id: I68b53d8b446660accdf5841df3d168ee2f133a90
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-13 15:38:08 +00:00
Alexandru Croitor
51767affb3 Show warning when setting new default QSurfaceFormat
If a global shared context is created, and afterwards a new default
QSurfaceFormat with a different version or profile is set, it can
lead to issues with context sharing.
The documentation for QSurfaceFormat::setDefaultFormat mentions
this. It would be helpful to actually show a warning in case it
happens.

Change-Id: I71f7ce95496e1ecbfc6a0c7d7bed146ef8dc351e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-13 15:38:05 +00:00
Kai Koehne
d023b300b2 Document that am/pm in QDateTime::toString are locale-specific
Change-Id: I28382b25ac94cbfbad4acff1308ddd8baf5ca693
Task-number: QTBUG-55632
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-13 15:16:23 +00:00
Thiago Macieira
8796c69480 QNetworkSession: make sure that "interface" isn't #defined
Depending on #include order isn't a good idea.

Change-Id: Ief935e1fcc5d40ecb510fffd147c08dffe6cba2d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-13 11:25:41 +00:00
Alexander Volkov
ef416e0faa QIconLoaderEngine: add missing Q_DECL_OVERRIDEs
Change-Id: I7671b05f2e3c218870dca04f3ed52c231dbe4a9d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-10-12 20:54:16 +00:00
Allan Sandfeld Jensen
f3ce959de6 Fix illegal memory access on simple image rotates
Clip the transformed and rounded sourceClip to the source rectangle,
so we don't try to rotate pixels outside the source.

Task-number: QTBUG-56252
Change-Id: Ib9cb80f9856724118867aea37ead0b02a6c71495
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-10-12 18:02:30 +00:00
Alexander Volkov
e732e432ab Remove unused static member QIconLoaderEngineEntry::count
It was introduced in Qt 4 by the commit
13a31fe82845f8b1f4d86919080d3b2a87c4d061 and was unused
even there.

Change-Id: I5f3861918ea1f443f7e13439fafa067f2b28a91a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-10-12 18:00:16 +00:00
BogDan Vatra
cc62c30022 Android: Ministro updates
- bump minimum required Qt version
 - use market://details instead which opens Ministro's page directly

Change-Id: I3d879503625fe29e7b23149402217337fee6a863
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-10-12 11:19:45 +00:00
Christian Strømme
dde86ebb9b Android: Don't update offscreen windows
Offscreen windows should not be handle by the platform plugin.

Task-number: QTBUG-50973
Change-Id: I719a24b9bbcaad460d78fdc4095e86d615357cd2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-12 10:19:25 +00:00
Christian Strømme
f12006e644 Don't resize windows that aren't attached to a platform window
QWindows that aren't created, and therefore don't have a platform window
attached, should not be treated as "normal" windows. The expectation,
in our code, is that these windows won't get their geometry updated by
the platform plugin, and that the geometry is only changed by the owner.
In QQuickWidget's case this was causing the scene to be rendered
incorrectly.

Task-number: QTBUG-50973
Change-Id: Iea62dfb7fa90cbe450a662c5792c7c4f49c991fd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-12 10:19:21 +00:00
Edward Welbourne
f4fff02cbb QXcbShmImage: don't use shmget()'s return unless it succeeds
When shmget() failed, we didn't set m_shm_info.shmid (not even to the
-1 failure id) but did pass it (i.e. uninitialized noise) to shmat(),
among other related functions.  Guard against this; handle failure
gracefully.

Task-number: QTBUG-56419
Change-Id: Ie823c36c2ede03af6cb5d94ce7b4b5cd543c1008
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-12 09:33:05 +00:00
Marc Mutz
de48fd192b QToolBarAreaLayoutInfo: add missing break statements in switch in distance()
A fall-through here is logically non-sensical, because of symmetry (or
lack thereof). Thus, a break must have been intended.

Add it.

While we're at it, also replace the default case label with the
non-functional enum value QInternal::DockCount, so that -Wswitch can
warn us if ever there should be a new DockPosition.

Found independently by both GCC 7 and Coverity.

Coverity-Id: 11145
Coverity-Id: 11146
Coverity-Id: 11147
Change-Id: I6bb31c1517e40f0cb06ceaee5aeb6fa78b84a523
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-12 09:08:38 +00:00
Allan Sandfeld Jensen
00304a3d57 Blacklist tst_MacNativeEvents::testMouseEnter
It is already blacklisted for 10.8 and 10.9, and is now failing on 10.11
blocking integration.

Change-Id: I71b8119ab32ec64096bfc53d5e521714ad4ae11b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-12 08:17:16 +00:00
Marc Mutz
77372e0b66 harfbuzz: compile with GCC 7
GCC 7 warns about implicit fall-throughs now.

Fix by adding the missing comment.

Didn't send a patch to upstream, because upstream harfbuzz-old hasn't
seen a commit in four years, and this code is no longer in harfbuzz-ng.

Change-Id: Ic97efbe01edd37738dcdf43528e82511197d7fb2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-10-12 08:16:56 +00:00
Marc Mutz
0c8b5b9a04 QtOpenGl: compile with GCC 7
GCC 7 warns about implicit fall-throughs now.

Fix by adding the missing comments.

Change-Id: I081d4db07c7f2b30ee6344a166aaec34ac639ee5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-10-12 08:16:52 +00:00
Marc Mutz
eade394e99 QtDBus: compile with GCC 7
GCC 7 warns about implicit fall-throughs now.

Fix by adding the missing comments.

Change-Id: I629fb3aced9296c81496f19f6ff78c7a5a12e991
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-12 08:16:49 +00:00
Marc Mutz
afe5bcdbd1 tst_QWidget: Fix UB (invalid member access) in EnterTestMainDialog::eventFilter()
Found by UBSan:

  tst_qwidget.cpp:10207:29: runtime error: member access within address 0x6060000e8880 which does not point to an object of type 'EnterTestModalDialog'
  0x6060000e8880: note: object is of type 'QWidget'
   eb 00 80 45  10 4b 32 ab 11 2b 00 00  80 df 08 00 60 61 00 00  c0 4c 32 ab 11 2b 00 00  00 00 be be
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QWidget'
    #0 0x6ca13f in EnterTestMainDialog::eventFilter(QObject*, QEvent*) tst_qwidget.cpp:10207
    #1 0x2b11b8bc90c3 in QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*, QEvent*) qcoreapplication.cpp:1081
    #2 0x2b11a3c49b4a in QApplicationPrivate::notify_helper(QObject*, QEvent*) qapplication.cpp:3716
    #3 0x2b11a3c8ec72 in QApplication::notify(QObject*, QEvent*) qapplication.cpp:3704
    #4 0x2b11b8bccd0f in QCoreApplication::notifyInternal2(QObject*, QEvent*) qcoreapplication.cpp:988
    #5 0x2b11aea5c34d in QCoreApplication::sendEvent(QObject*, QEvent*) qcoreapplication.h:231
    #6 0x2b11aea5c34d in QGuiApplicationPrivate::_q_updateFocusObject(QObject*) qguiapplication.cpp:3690
    #7 0x2b11aea61360 in QGuiApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) .moc/moc_qguiapplication.cpp:177
    #8 0x2b11b8d1dc86 in QMetaObject::activate(QObject*, int, int, void**) qobject.cpp:3787
    #9 0x2b11aea784a3 in QWindow::focusObjectChanged(QObject*) .moc/moc_qwindow.cpp:760
    #10 0x2b11a3fb24f2 in QWidget::clearFocus() qwidget.cpp:6705
    #11 0x2b11a3fc87b1 in QWidget::~QWidget() qwidget.cpp:1608
    #12 0x2b11a526688c in QDialog::~QDialog() qdialog.cpp:352
    #13 0x6c43e2 in EnterTestModalDialog::~EnterTestModalDialog() tst_qwidget.cpp:10160
    #14 0x6c43e2 in EnterTestModalDialog::~EnterTestModalDialog() tst_qwidget.cpp:10160
    #15 0x492be3 in EnterTestMainDialog::buttonPressed() tst_qwidget.cpp:10188
    #16 0x492be3 in EnterTestMainDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) .moc/tst_qwidget.moc:2056
    #17 0x2b11b8d1dc86 in QMetaObject::activate(QObject*, int, int, void**) qobject.cpp:3787
    #18 0x2b11a45cb833 in QAbstractButton::clicked(bool) .moc/moc_qabstractbutton.cpp:307
    #19 0x2b11a45cd54b in QAbstractButtonPrivate::emitClicked() qabstractbutton.cpp:411
    #20 0x2b11a45df73a in QAbstractButtonPrivate::click() qabstractbutton.cpp:404
    [...]
    #41 0x6bb2cf in tst_QWidget::taskQTBUG_27643_enterEvents() tst_qwidget.cpp:10249
    [...]

Fix by checking the event type first, and accessing
modal->button only if it's QEvent::Enter.

Change-Id: I2c7df3a1f43ecbfe14741b5861729078a91a32d6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-10-12 08:16:45 +00:00
Marc Mutz
c34c8a564e QComboBox: add missing break in switch in keyPressEvent()
If the Key_Space case falls through, it does because !d->lineEdit,
which makes the following case dead code, because it is guarded by the
same condition.

Fix by adding the break, which ensures that if those two cases ever
diverge, the code stays working by intention, not chance.

Independently discovered by GCC 7 and Coverity.

Coverity-Id: 11157
Change-Id: Id14114b4157549d0f6fa036e8aa2bf0fa5a863cf
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-10-12 08:16:41 +00:00
Marc Mutz
1ab521e7f4 QFusionStyle: add missing break in switch in drawControl()
The old code fell through into from the CE_RubberBand case into the
CE_SizeGrip case if the cast of the the QStyleOption to a
QStyleOptionRubberBand failed.

Quite obviously, the drawing of a rubber band was requested by the
caller, drawing a size grip instead must be considered a bug,
regardless of any additional guards employed by the size grip case.

So, fix by removing the conditional return in the success case and
adding an unconditional break.  The function ends after the switch,
and all other cases also break instead of return, so consider the
switch from return to break a contribution to the internal consistency
of the function.

Discovered independently by GCC 7 and Coverity.

Coverity-Id: 11182
Change-Id: I2158f03b9eb018b952716ffa5e615c7b3cc49132
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-10-12 08:16:38 +00:00
Marc Mutz
2ecd95bbe9 QCalendarWidget: fix misleading if-else cascade in QCalendarDayValidator::text()
By the time we hit the last else, its if condition is trivially
true, so don't check it (but leave it as a comment).

Consequently, remove the trailing (dead) return of a default-
constructed QString.

Coverity-Id: 62766
Change-Id: I47e1a49f40e6ec95d29c5052c78bfadb63af3b84
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-12 08:16:34 +00:00
Marc Mutz
eec2d5e68a QCalendarWidget: fix a missing break statement
GCC 7 warns about implicit fall-throughs, and here it looks
like a break was indeed missing. It surely isn't catastrophic
that the other update code is executed, too, but it's also
useless.

Turns out Coverity knew it all along...

Coverity-Id: 11162
Change-Id: I88fc0174a66ec337b2d93c006e70be8d5f3bbc33
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-12 08:16:31 +00:00
Marc Mutz
dafa7cc7b5 QFileDialog: add missing break statements in switch in labelText()
It is of course wrong to potentially return the text of the Cancel
button if the text of the Accept role button was asked for.

Found independently by GCC 7 and Coverity.

Coverity-Id: 11150
Change-Id: Ie30f7875daee16a78eeff4b314ce17cbd7cd3aa8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-12 08:16:28 +00:00
Allan Sandfeld Jensen
9ad4157530 Fix gradient race condition / read-after-free
A gradient table may be deallocated while in use because we don't keep
track of references. To fix it we now reference count the cache entries.

Task-number: QTBUG-14614
Change-Id: I772ebf565ccf41d476811ca9a51b721f10de8aeb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-10-12 08:16:24 +00:00
Marc Mutz
f6498fd677 Plug more than 4k leaks in tst_QGraphicsView
The vast majority is due to leaking styles in a data-driven
test with almost 100 rows (scrollBarRanges()).

Fix by creating the style into a QScopedPointer.

The remaining ~500 leaks were due to leaked QGraphicsScenes.
They had no parent, and QGraphicsView::addScene() does not
adopt them.

Fix those by passing the resp. view as their (QObject) parent.

Change-Id: I4316798019114ea3d7504d72cd83d534a21149c0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2016-10-11 20:52:42 +00:00
Marc Mutz
6d6074e04f Plug leaks in tst_QXmlSimpleReader
The QXmlInputSource objects were allocated on the heap,
but never deleted.

Fix by allocating them on the stack instead.

Change-Id: Ifd8bd41d778c0634b7a426bbd22a367dfce511c9
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-10-10 17:17:28 +00:00
Marc Mutz
940ea856f0 QtSql: compile with GCC 7
GCC 7 warns about implicit fall-throughs now.

Fix by adding the missing comments.

Change-Id: I7383f47e690b6334ef69c9df745c2205247ca7d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-10-10 17:17:22 +00:00
Allan Sandfeld Jensen
8356caea45 Fix QPixelFormat::typeInterpretation() for Format_RGB888
RGB888 is byte oriented like the RGBA8888 formats.

Task-number: QTBUG-56250
Change-Id: Idbd496e4913e5d168decdd41557e28a71574a85b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-10 17:17:10 +00:00