Commit Graph

24203 Commits

Author SHA1 Message Date
Sérgio Martins
2a81516835 QRasterPaintEngine: Don't detach QImage
Caught being detached a few thousand times per second.

Change-Id: I9f3c80cc5178ec2016041a4f2f6e6e1f458171f1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-06-29 10:34:39 +00:00
Oswald Buddenhagen
f88f93efb6 Bump version
Change-Id: Ide0b1a80ac89b76154ecccbda68398f3a05e1f5d
2015-06-29 10:47:21 +02:00
Sérgio Martins
aa09cc029f Fix inefficient container.values().first()
Saves 1 full iteration and 1 memory allocation.

Change-Id: I7e521054bd573f30dea2ec166d566ab6ac60eb4e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-28 21:14:34 +00:00
Marc Mutz
eda79a467e QDate/QTime: fix SiC introduced by adding new non-explicit ctors
The new constructors were added in c94d41d9 to help
constexpr'ify QDate and QTime. Even though private,
they participate in overload resolution and break
function pairs overloaded on QDate and int or
QTime and int.

Mark them explicit.

[ChangeLog][QtCore][QDate/QTime] Fixed a minor source-incompatibility
between Qt 5.4 and 5.5.0 involving sets of functions overloaded on
QTime and some integer or QDate and some integer.

Change-Id: I65a09aaca2b083cda90255c24cc72ef51119d3b1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-28 21:12:43 +00:00
Marc Mutz
99d9a683b1 QGraphicsItemAnimationPrivate: replace a sort with a rotate
There's really no need to sort the whole collection if you
a) know it's already sorted and b) already know its final
position, because you looked it up using lower_bound a line
up. Instead of appending and sorting the whole thing, simply
append and rotate into place, conveniently packaged as
positional insert.

Also reverse the check for presence: less negations: more
readable.

Change-Id: Id23f108b64976061f666f517fbc436d3c72dd25b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-28 21:11:00 +00:00
Marc Mutz
1a1ca59e2d Make QGraphicsItemAnimationPrivate::Pair a (C++98) POD
There's no value in the ctor and it might be inhibiting some
C++98 POD-only compiler optimizations.

Change-Id: I6887afcd2af9805251eac2d8dfe4ced5b54bff85
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-28 21:10:31 +00:00
Marc Mutz
26281561fe QGraphicsItemAnimation: don't hold Private::Pair in QList
QGraphicsItemAnimationPrivate::Pair, being a (qreal,qreal) is
larger than a void*, so holding them in a QList is needlessly
inefficient. Worse, the code could come to depend on the fragile
property of (inefficient) QLists that references to elements
therein never are invalidated.

Fix by marking Pair as primitive and holding it in QVector
instead.

Change-Id: I190721f4b0cdeab2efab2d51536f64572cd663df
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-28 21:10:25 +00:00
Marc Mutz
dff10573f2 QWeakPointer: remove misleading Q_DECL_CONSTEXPR
Adding constexpr there is allowed, because QWeakPointer is a class template.
But in 100% of cases, it will be dropped, because the destructor is not
trivial. So, don't mislead users and devs to think that any or even all
QWeakPointers could ever be constexpr.

Change-Id: Ia50aad4d6c4fb724254308150124c666e82ef817
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-28 15:56:17 +00:00
Marc Mutz
62e3bd638a QDataWidgetMapper: use QList::reverse_iterator
... now that it's available.

Change-Id: I85f547b294688c97288aaeab2af213c59e856a2b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-06-28 15:56:12 +00:00
Marc Mutz
a8df43cd65 QCommandLineOption: Q_DECL_NOTHROW -> Q_DECL_NOEXCEPT
In IsInvalidName::operator(), marked as _NOTHROW, we're calling qWarning(),
which, of course, _can_ throw. We don't care in that case, but then we
musn't use _NOTHROW, which causes UB on MSVC, but _NOEXCEPT, which causes
std::terminate to be called.

Change-Id: I18f74546ea3b388495fdb173d3abd9a162fb78a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-28 15:56:07 +00:00
Marc Mutz
435a3d7741 QSqlIndex: replace QList<bool> with QVector<bool>
QList<bool> uses from 400% (32-bit platforms) to 800% (64-bit)
more per-element memory than QVector<bool>.

This change is binary compatible, since QList and QVector have
the same size, and the QList field was not referenced from
inline functions. This includes all relevant special member
functions, since they are all out-of-line (and move assignment
and move constructor are disabled by used-defined copy
assignment and copy constructors, resp.). The header is unchanged
from Qt 5.0, so there were also no past inline users of the
member.

Change-Id: I3a94ddc73a4f388031dfd4fce3fedccc507a39c7
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2015-06-28 15:56:02 +00:00
Daniel Molkentin
027571c8c3 Also add support for linked OpenSSL without SSL v2 & v3 support
So far, this was only supported for dlopen mode. This adds symmetric
defines for the linking case.

Change-Id: I9cbfa18e04d041dde0cbd833929782cada9eb812
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-06-28 12:49:16 +00:00
Allan Sandfeld Jensen
fdef1dc7fe Fix decoding of JPEGs with invalid EXIF headers
We should accept JPEGs with broken EXIF headers since the header is
optional and can be ignored if broken.

Task-number: QTBUG-46870
Change-Id: I494e5497b8449ce6494285d4d77caadbbb0ccaf8
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2015-06-28 09:03:49 +00:00
Gabriel de Dietrich
7d5e849e28 Apple's 3.6.0svn based clang doesn't support -Winconsistent-missing-override
That's the version Apple ships with Xcode 6.3.2. We set the
threshold to Xcode 7, whose clang version supports the "missing
override" warning.

Change-Id: Ibcab8a45306120bdcd02ca5b0bb0d1c638cea177
Task-number: QTBUG-46833
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-28 07:46:50 +00:00
Liang Qi
cb6cba2b6f Merge "Merge remote-tracking branch 'origin/5.5.0' into 5.5" into refs/staging/5.5 2015-06-28 07:46:47 +00:00
Friedemann Kleint
0d5744d740 tst_formlayout: Fix top level widget leaks.
Instantiate widgets on stack and add cleanup function for the check.
Change all functions instantiating a QFormLayout without widget on
the stack to use a toplevel widget and pointer variables since
otherwise, the labels automatically created by a call like
QFormLayout::addRow("bla", widget) leak.

Change-Id: I72a7a9c3175b5793a9450c6fcb970012ccd2274b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-06-27 19:48:04 +00:00
Friedemann Kleint
e849e2c162 tst_qboxlayout: Fix top level widget leaks.
Instantiate widgets on stack and add cleanup function for the check.

Change-Id: Ia527c228f9173d1b5aeba94ba4e14e1beba60731
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-06-27 19:47:08 +00:00
Friedemann Kleint
75dfebae4a tst_gridlayout: Fix visible top level widget leaks.
Gather member variables testWidget, testLayout, w1..w3 and sp
used in getItemPosition() and itemAtPosition() in Helper
class ItemTestWidget.

Remove member variables m_grid, m_toplevel and instantiate the
top level widget on the stack in minMaxSize().

Remove empty slots and functions.

Add a cleanup() test checking that no visible top levels
are leaked with explanatory comment about data driven tests.

Change-Id: Ia30120d78144dab3b7c73864c6fbcef606cb19d3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-06-27 19:46:04 +00:00
Marc Mutz
556cdac9ac QSharedPointer: destroy LHS on move assignment
Howard Hinnant is right: just swapping may keep a resource alive too long.
The problem with replacing swap(other) was that the naïve approach:

    clear(); swap(other);

is not safe for self-assignment. Taking a cue from the default std::swap()
implementation, and the copy-swap idiom, a self-assignment-safe version is

    QSharedPointer moved(std::move(other)); swap(moved);

which is to what I changed the implementation now.

Change-Id: I589fdae50ae22b95350db8250b02d983dc8487a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-27 17:22:54 +00:00
Liang Qi
4dd8a63fc1 Merge remote-tracking branch 'origin/5.5.0' into 5.5
Conflicts:
	src/plugins/platforms/cocoa/qcocoafiledialoghelper.h

Manually fixed src/testlib/qtestcase.cpp to return the right type.

Change-Id: Id1634dbe3d73fefe9431b9f5378846cb187624e4
2015-06-27 13:54:35 +02:00
Sérgio Martins
b3fc0443a0 network: Use QList::reserve(), reduces reallocations.
Change-Id: Ie0e8cbd28802826206d7e92584b5d56bb844fb09
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-27 11:48:40 +00:00
Sérgio Martins
507b6b3e4b Use QList::reserve(), reduces reallocations
Change-Id: I9f218bdd65a97ad9c867b695f3ba27ab64a54d2a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-27 11:48:36 +00:00
Sérgio Martins
a5306c35d1 QList: Introduce constFirst() and constEnd()
Allows to easily prevent detaching in common code like: getList().first()

[ChangeLog][QtCore][QList] Added the convenience constFirst and constLast functions.

Task-number: QTBUG-46026
Change-Id: I51ecb51fe91fc7d993ad35b5c7392f4da88e5f7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-27 11:48:33 +00:00
Thorbjørn Martsum
f1b01b7d15 QHeaderView - fix a logical / visual index mismatch
f9408317e7 was unfortunately
approved though it had an annoying bug. The patch had
an assign of a visual index into a logical index.

This patch fixes that issue.

Change-Id: I9cc75e4e9701858c92e2c3e5817415041b42f8e8
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2015-06-27 07:08:46 +00:00
Konstantin Ritt
12b36aec2b [QZip] Do not depend on platform definitions
Guarantee the values are exactly the same on all platforms
and avoid the macro redefinition(s) on a newer MinGW.

This also fixes a typo in #define S_IFLNK 020000 (<-- must be 0120000).

Change-Id: I4993d2a9bdb4b0871af110b89c137ce0ac0e953a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-06-27 02:29:53 +00:00
Laszlo Agocs
a8a8cdd24b Add support for driver_description and os.release in GPU blacklists
os.version is the kernel version which is just not very useful or easy to
use for us. Instead, introduce a string that allows easy differentiation
between Windows 7 and 8.

From the adapter identifier the driver description is often helpful too,
especially in virtual machines.

These allow writing rules like:

{ "description": "Use WARP in some Win 8 and 8.1 VMs",
  "os": { "type": "win", "release": [ "8", "8.1" ] },
  "driver_description": "VMware SVGA 3D",
  "features": [ "disable_desktopgl", "disable_d3d9", "disable_d3d11" ]
}

Change-Id: I196f6b44d7bb9e42ef47f61f4c28d8aa79afb7c4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-26 15:27:31 +00:00
Nico Vertriest
e1b7c55a43 Doc: rearrange tables with overflow
Task-number: QTBUG-46475
Change-Id: Id599b2eb0dee0c003475c094ad61700150e37e65
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2015-06-26 11:26:24 +00:00
Tor Arne Vestbø
dc6191ccb4 Treat color (ARGB) glyphs, e.g. Emoji, as having unreliable glyph outlines
This is used by the scene graph to automatically switch over from distance
field text to native text rendering for the given glyph node, which allows
mixing regular text with Emoji in e.g. a Text item without having to set
renderType to Text.NativeRendering.

Change-Id: I5d96d1dab329a975e3442284bf4c5a82174177c9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-06-26 10:56:42 +00:00
Tor Arne Vestbø
2d1189d9f2 lance: Ensure that OpenGL FBO is cleared before being used as surface
Merely filling with Qt::transparent is not enough, as the default blend
mode of QPainter is QPainter::CompositionMode_SourceOver, where the alpha
of the source is used to blend the pixel on top of the destination. The
destination in the case of an FBO may contain garbage, and we end up with
the same garbage as the alpha is 0.

This was evident when running the ellipses and porter_duff/porter_duff2
tests on OS X. These tests can now be un-blacklisted.

Change-Id: I315fa764fa29fb3a06e38945a738a6feadf4502d
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2015-06-26 10:55:40 +00:00
Mike Krus
5757b8c516 Return format as specified in original QWindow
Overload QPlatformWindow::format() to return the desired format
defined in the QWindow. This is required for windows that define
specific surface formats (such as those used in Qt3d which require
a depth buffer).

This is similar to what is done in the OS X Cocoa QPA plugin.

Change-Id: I7661a2a9c4e13603d03d3a5be10d000f73c712e6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-06-26 06:54:49 +00:00
Thiago Macieira
3de7a966f1 Fix warning with MSVC 2013
warning C4100: 'name' : unreferenced formal parameter

This is despite the new Q_ASSERT "using" its expression even in release
mode.

Change-Id: Ieebfc4ab72a6493eaa68ffff13ead0574dd78627
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-06-26 06:49:38 +00:00
Friedemann Kleint
e2d3436e4d Windows / Wifi plugin: Refactor code resolving symbols from wlanapi.dll.
Instantiate QLibrary once and use member functions instead of using
the static functions which instantiate QLibrary in each call.
Strip suffix from file name.

Task-number: QTBUG-46710
Change-Id: Ia6ec5542e1104ea9024961dda202e6f22bcf5b69
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-06-26 06:49:29 +00:00
Friedemann Kleint
97207e2c7f Prospective fix to stabilize tst_QAbstractItemView::task200665_itemEntered().
The test tried to position the mouse cursor over item #0 . This
sometimes results in the cursor being outside the window when
the window manager adds the window decoration on X11.
Move the cursor to the center of the window instead.

Add cleanup slot checking top level leaks, remove empty
functions.

Change-Id: I908240e1cc3fdbe370b43eae0015272ca342a312
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-26 06:48:32 +00:00
Thiago Macieira
fae33bfbe3 Update the changelog with the LTS discussion results
And include one more ChangeLog entry that was committed to 5.5.0

Change-Id: I255870833a024a36adf6ffff13eb0808447c50f8
2015-06-25 15:58:28 -07:00
Konstantin Ritt
9901bfe914 Simplify permission flag handling a bit
Change-Id: I753f7a398c39e7300821658f27e4813c591eebc3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-25 16:53:57 +00:00
Tor Arne Vestbø
a79dd87f3f Add lancelot test for Emoji text rendering / color glyphs
Change-Id: Id69c28ec49be660e40beaf37bad9ac0d4ce0662d
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2015-06-25 16:53:50 +00:00
Oswald Buddenhagen
f2b7a523da (mostly) build system changelog for 5.5.0
Change-Id: Ib68a73574a2c6c13e90484ad5a86398e1cea24cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-06-25 06:54:47 +00:00
Olivier Goffart
021ffbfc6f Changelog: Document the SIC related to indirect includes
Because of 90e7cc172a

Change-Id: I3e9339d6e07d6564e38f3f25df28644437ed5955
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-25 06:54:40 +00:00
Daiwei Li
db377a4202 QSortFilterProxyModel: Keep invalid index updated on source model sort
If we have a filter applied that removes all entries, the source
model is sorted, and then we remove the filter, QSortFilterProxyModel
never emits rowsInserted. This is because it doesn't have the correct
source mapping and doesn't update when the filter is removed.

Change-Id: I447b2d150e509b128d27f4dabc4e081ca4ef037f
Task-number: QTBUG-46282
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-25 00:46:48 +00:00
Konstantin Ritt
7082c20e4a [QFontMetrics] Mark obsolete charWidth() method for deletion in 6.0
It was obsoleted for quite a while already and we forgot to get rid
of it the last time.

Change-Id: Ib15e71829e80648aa667a6b0af31698460b99cc1
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-25 00:17:17 +00:00
Christian Kandeler
ec8c1dcf14 Make QDir::relativeFilePath() return "." for a path to itself.
The rationale being that the empty string is not a valid path component.

[ChangeLog][QtCore][QDir] QDir::relativeFilePath() now returns "."
instead of an empty string if the given path is the same as the
directory.

Change-Id: Ibcf31904b2ae5edf5639d4c2e5ba234365d347fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-24 15:43:58 +00:00
Gabriel de Dietrich
0e41a58fb8 QPageSetupDialog: Add missing Q_DECL_OVERRIDE
Also removed unnecessary virtual specifiers.

Change-Id: Id3e0fcf6916d4ccde351e5456e4f92f3cbedc3f6
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-24 15:24:14 +00:00
Gabriel de Dietrich
02ea023521 Add missing Q_DECL_OVERRIDE in Cocoa specific header files
Change-Id: I91831390e9e0d97ab28f0e34ca0573fb2c84e954
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-24 15:24:10 +00:00
Marc Mutz
862b1b3ceb Micro-optimize QKeySequence datastream operator (I)
Instead of creating a QList with the keys with one of two statically
known sizes, stream the contents itself. Apart from QDataStream,
this no longer allocates any memory.

Change-Id: I5ed814b186dcaf8cc7dedcc520928aefab01f009
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-24 13:27:53 +00:00
Marc Mutz
3290330d44 QStateMachine: remove unused qHash(QPointer<T>)
Change-Id: Idae3621d1a3cb961e2d46fd58208829651382c11
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-24 13:24:40 +00:00
Marc Mutz
5fb8839023 QMdiArea: don't hold QPointers in QList
QPointer is larger than a void*, so holding them in a QList is needlessly
inefficient. Worse, the code could come to depend on the fragile property
of (inefficient) QLists that references to elements therein never are
invalidated.

Change-Id: I3cdd4914658b6fe025ad379007502b4223e126cd
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-24 13:23:39 +00:00
Marc Mutz
419533eba4 QPicture: don't hold images in QList
QImage is larger than a void*, so holding them in a QList is needlessly
inefficient. Worse, the code could come to depend on the fragile property
of (inefficient) QLists that references to elements therein never are
invalidated.

Change-Id: I153995d691692f7317cab31b95a00d679f31c0af
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-24 13:23:13 +00:00
Marc Mutz
d0b659f183 QPicture: don't hold pixmaps in QList
QPixmap is larger than a void*, so holding them in a QList is needlessly
inefficient. Worse, the code could come to depend on the fragile property
of (inefficient) QLists that references to elements therein never are
invalidated.

Change-Id: I82bb9a88e7030e566f39421cd78babcf01bce285
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-24 13:22:36 +00:00
Marc Mutz
1f46321717 QZip*: mark various types movable and primitive
... even if they are not (currently) held in Qt containers
(though FileInfo is).

Change-Id: Id14d4af89fed8bcefdbb9b28d11c1c43fccf7190
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-24 13:22:09 +00:00
Marc Mutz
eb47c18081 QtGui: don't hold QPainterPath in QList
QPainterPath isn't marked movable , so holding them in a QList is needlessly
inefficient. Worse, the code could come to depend on the fragile property
of (inefficient) QLists that references to elements therein never are
invalidated.

Change-Id: Id4dae8037401c52fd57a2274e45399a9b70beb69
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-24 13:21:40 +00:00