Commit Graph

3901 Commits

Author SHA1 Message Date
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
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
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
Laszlo Agocs
d40647922b Revert "windows: Disable D3D9/11 with ANGLE in VMs"
This reverts commit a6000e2b66.

Temporarily remove this to unblock the qtdeclarative dev CI.

While Windows 8 VMs are fixed by this patch, Windows 7 has different
problems.

Change-Id: I45ef064ed953cc4b7bbf19657300d4fc43d82452
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-23 04:08:41 +00:00
Marc Mutz
9e139ce099 QTextureGlyphCache: add some qMove()
Change-Id: I1965f4de0f1bf9efdb15d07142f882897e163cc5
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-22 22:20:47 +00:00
Laszlo Agocs
706af26acc Do not claim TextureRGFormats on Mesa with GLES
Mesa provides GL ES 3.0 so using GL_RED in place of GL_ALPHA should work.
This is apparently not the case.

Task-number: QTBUG-46605
Change-Id: I4f661487b47e9cc11f5de110196ec37150c99c7f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-06-22 21:15:37 +00:00
Sérgio Martins
eca8f1bf98 gui: Add several QList::reserve() calls.
Reduces reallocations.

Change-Id: I0db16726f413a67b76a73fabd013f910ab5f5109
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-22 14:03:39 +00:00
Allan Sandfeld Jensen
e0139718bb Export gamma setting and metadata in QImageReader
The PNG image plugin has the capability of applying gamma correction
to read PNGs, but doesn't do so by default, and we export no way of
accessing this through the qimagereader API.

This patch adds the ability to read the PNG file gamma, and overriding
decoded gamma to get gamma correction.

Change-Id: Iaf9eaac0827516db6bc02247c58026270cd1f610
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-22 12:22:37 +00:00
Marc Mutz
9e6a61447c QIcon: don't use a QList<QImage>
QImage is larger than a void*, so holding them in a QList is needlessly
inefficient.

Use QVector instead.

Change-Id: Ifcc9eca18a87e29327586506e3a3bb7874c8b3a7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-22 10:55:58 +00:00
Marc Mutz
3e6f36175a QTextDocumentLayout: 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: I104d11cc530c9c1579e82bf4e28e3353c00b34b4
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-22 10:45:11 +00:00
Marc Mutz
792f68adea QTextureGlyphCache: don't use a QList<QImage>
QImage is larger than a void*, so holding them in a QList is needlessly
inefficient.

In this case, the maximum size of the container is a small compile-time
constant, so the best container to hold those QImages is a C array, even
though it will default-construct all 12 QImages before even starting the
loop, since the QImage constructor does not allocate memory.

Change-Id: I83ca65aa1ca51c400ca696202d24cfaeab505a5b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-22 10:43:04 +00:00
Eirik Aavitsland
03fd8fa463 Further tune curveThreshold setting based on strokeWidth
ad9698713f reduced the curvethreshold
for wide lines, to fix QTBUG-46151. But as a side effect, the
threshold was increased for lines of widths >=0 and <4.  This commit
fixes that, and also adds a lance test for the issue in QTBUG-46151.

Change-Id: I52507db622435fe1d2646640cb0bd9cd8222e453
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-22 08:19:57 +00:00
Marc Mutz
90da7ba49c QFontSubset: mark local types movable and hold in QVector, not QList
Virtually all of these types are too large to fit into a QList.

Change-Id: If55496ef3fb26d6531e9ef1bb1558887d9077a3b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 04:38:40 +00:00
Marc Mutz
452ece9c02 Remove quadratic behavior in QFontDatabase::writingSystems()
Looping over QList::contains() constitutes O(N²) behavior,
the more so as this QList is horribly inefficient since
WritingSystem is not a Q_MOVABLE_TYPE.

Since the range of possible unique values in the result
is severly limited (by virtue of being enumerated values),
use a bitmask to remember which WritingSystems were
encountered, then, after releaseing the mutex again, use
that bitmask to populate the QList.

Change-Id: I1d12eb487513ec17faa6f38942f8b681819dc0e8
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-19 18:37:30 +00:00
Laszlo Agocs
a6000e2b66 windows: Disable D3D9/11 with ANGLE in VMs
By adding support for the driver description, we can detect if
we are in VMware. In this case D3D9 and 11 get disabled, so only
the software-based options are in use.

This allows running autotests like tst_qopengl, tst_qopenglwidget,
tst_qgl, etc. in the Qt CI system. There OpenGL 2.x is not available,
so ANGLE is the only option. D3D11 is not an option, so it picks D3D9
by default. However, this results in mystic failures. The stable solution
seems to be to use WARP. This can be achieved by setting disable_d3d9 in
the built-in GPU blacklist.

Change-Id: I937c4b3fa82fc1a2d524b4eb712732722df2070c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-19 17:52:19 +00:00
Marc Mutz
2de01c8388 Move-enable QPixmapCache::Key
The default constructor already sets the d-pointer to nullptr,
so the move constructor does not introduce a new state.

Change-Id: Icd47952bdf76d2106992d6babea40d68f18d067e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-19 17:49:15 +00:00
Marc Mutz
e2d83802a0 QPixmapCache: remove unused Q_TEST_QPIXMAPCACHE-only function
Unused by tst_qpixmapcache.cpp and everything else, and
uses an inefficient QList, so remove.

Change-Id: Ia410ed19db9bb3db97460b21bc2fd9d53c95a73d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-19 16:29:24 +00:00
Sérgio Martins
bc977f690f Use Q_GLOBAL_STATIC for QThreadStorage<QGuiGLThreadContext *>
QThreadStorage isn't a trivial type.

Change-Id: Iedc3c16320fd025a0ccf627eac43a85ebd02aa5e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-19 16:25:33 +00:00
Mikhail Lappo
d82d5b1c43 Check for integer overflows in places where qAllocMore is used
Task-number: QTBUG-41230
Change-Id: Ic2167364e326092482657f2d2b4ab6ad3e5af631
(partially cherry-picked from 880986be23)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-19 15:18:15 +00:00
Gunnar Sletta
de81159574 doc: mark QWindow::requestUpdate() as \since 5.5
Change-Id: I322e2e93edc4bdb6582c7614b9a8552221317553
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-06-18 05:54:02 +00:00
Sune Vuorela
a8621a3f85 Respect manual set icon themes.
Currently all icon resolving is passed thru to the platform icon engine,
even in the case where the application developer has set their own
requested icon theme. In that case, the application developer
specifically does not want to follow the icon theme of the system, so
don't ask the platform, but rely on Qt code instead.

It leads to bugs reported to platform icon theme providers like this:
MMC: https://github.com/MultiMC/MultiMC5/issues/796
KDE: https://bugs.kde.org/show_bug.cgi?id=344469

Thanks to the multimc people (Jan Dalheimer and Peterix) for the
reports and testcases.

Change-Id: I52cda6f688b2ef9e44e060c8ae67831cb02b26c8
Reviewed-by: Eike Hein <hein@kde.org>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-18 04:57:02 +00:00
Shawn Rutledge
aec2b28eea OSX: show file dialog in showCocoaFilePanel, don't wait for exec()
This reverts commit 21e6c7ae47
because in QtQuick.Controls, we do not call exec(): we just set the
dialog visible.  If it is a sheet, then it is already acting as a
modal dialog, basically.

Task-number: QTBUG-46691
Change-Id: I7fe89f2a2ade0d4ddcf540c9bfc4f5963a077471
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-06-17 16:55:52 +00:00
Ulf Hermann
7c34ea1fc7 Don't define qAccessiblePlugins if we cannot use them.
In case of QT_NO_LIBRARY there are no plugins after all.

Change-Id: Iad891d0cf0edf9e4418a4fe4ac49cf6497ceeb79
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-06-16 14:31:00 +00:00
Laszlo Agocs
0ce2edc56a Fix gles lib loading on Android
Setting the version breaks on Android as it has no .so versions, leading
to aborting apps on devices that support GLES 3.x.

Change-Id: Id4381e08a2615a0898def8f075ce5a5c5b9c7a7d
Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-06-16 12:04:29 +00:00
Allan Sandfeld Jensen
46e8ac0308 Extend generated style strings to include new font weights
When a font style-name is not directly available from the font we
need to generate it with the data we have, so we should include all
the new supported weights.

Change-Id: I45cc0114f8c76f45bc7a639f9d0d8096a064bc51
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
2015-06-15 23:16:07 +00:00
Marc Mutz
d3cb97172f Micro-optimize QKeySequencePrivate::decodeString()
Use a QStringRef instead of a QString.

Change-Id: I63bf9775606b071cd9614306375e1316dada9f61
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-06-15 18:31:49 +00:00
Ulf Hermann
53b83ac413 Don't try to load opengl extensions or functions without QLibrary
Change-Id: If77ca6e04c83d94fd3063b68963b1bcd90980d99
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12 12:36:42 +00:00
Ulf Hermann
0ff3bbe293 Mark unused parameters with Q_UNUSED
This prevents compiler warnings on less common branches of certain
ifdefs.

Change-Id: I89bae68491151b21cf6887a854cc4c9f68838cf9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-12 08:09:21 +00:00
Marc Mutz
ca22a02296 QTouchDevicePrivate: deal in const QTouchDevice*s
Avoids the copying of the contents when returning devices().

Remove an unneeded #include (already includes by public
header; unneeded there, too, but leaving for SC purposes).

Change-Id: Ifa9a3dc2c7fada01fb624527dd4d16d0cb32a658
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-06-12 07:48:19 +00:00
Kai Pastor
c2ea62dd34 QPicturePaintEngine: Avoid slow QPainter::clipRegion
QPainter::clipRegion() is expensive especially for certain clip paths.
QPainter::clipBoundingRect() does not promise to return an exact (tight)
bound but delivers the desired result quickly. In addition, this avoids
discretization.

Change-Id: Ib35406edc12fb8206ca978bc140a7c5e21279ca2
Task-number: QTBUG-46578
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-12 07:28:46 +00:00
Friedemann Kleint
56d62345ad Fix less-than comparison for QStandardItem and QSortFilterProxyModel with invalid data.
Previously, QStandardItem::operator<() returned true when both
items had invalid data. With MSVC in debug mode (checked
iterators/STL), this triggered an assert in
tst_QStandardItem::sortChildren() since that verifies
that !(b < a) when a < b:

Debug Assertion Failed!
Line: 3006
Expression: invalid operator<

Introduce a stable sort order for invalid items such that
other items are always less than invalid items and comparing
invalid items returns false (indicating equivalence).

Change-Id: Ica0f0d9f001c86973b1941dbcc1faf282e4c47df
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-11 13:29:23 +00:00
Lars Knoll
5dbd1ed7a3 Fix signature of new methods
Don't return a const QString &, return the QString by value. This
is still broken for some of the older methods, but let's not add
to it.

Change-Id: Ic5cabb1b89eda0fcf678dbe175963e03109e5c2c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-06-10 08:14:44 +00:00
Allan Sandfeld Jensen
d12b09edd8 Remove unused and unneeded subimage scaling
Removes the feature of scaling only a clipped area of the input
which was unused and only made the code harder to read and
maintain.

Change-Id: I296a804a5bd083016fbc47543e00eb586b530d71
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-09 09:14:27 +00:00
Jaeyoon Jung
5772d7fe06 Load GLESv2 library with correct major version
Make sure GLESv2 library to be loaded even when the symlink of .so is
not installed.

Change-Id: Ie7c810a137cebc7fa59612830e3643861b532fdb
Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-08 12:10:25 +00:00
Friedemann Kleint
4bb00d9d06 Export class QAccessible::ActivationObserver.
Change a21dfab54e de-inlined its
destructor, so, the class needs to be exported.

Change-Id: I32d21622a944a93718f549060e5e5f7e71fd2646
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-08 08:17:08 +00:00
Martin Smith
79a97be9f3 doc: Remove uses of \mainclass
This qdoc command is deprecated.

Task-number: QTBUG-46476
Change-Id: Iee36f91bdcf500c2e88022a5f8a9c3accc6048c2
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-06-05 09:37:55 +00:00
Simon Hausmann
ccad00121d Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev 2015-06-04 05:56:06 +00:00
Allan Sandfeld Jensen
f04ed82ca2 Font definitions with different style names are not equal
Since we added font matching by style name, the style name is not just
a derived property and should not be ignored in comparisons.

The QFontDef::exactMatch comparison is left unchanged, since it tests
if a loaded font matches a requested one.

Task-number: QTBUG-30851
Change-Id: I4187c5b993815001f35bcf24dc449059bfdcba6f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-06-03 14:00:07 +00:00
Mitch Curtis
525a660ea3 Clarify QPainter::drawText() documentation.
The difference between rectangle and boundingRect was not quite clear.
This patch adds a snippet with a corresponding image, in order to
illustrate the difference.

Change-Id: Icb1fe737788cc93f1c5baa16bc0e04b8ec728f3a
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-06-03 13:41:37 +00:00
Marc Mutz
a21dfab54e De-duplicate vtables III: QAccessible
By making the destructor (usually the first non-inline, non-pure,
virtual function, and therefore the trigger for most compilers to
emit the vtable and type_info structures for the class in that TU)
out-of-line, vtables and, more importantly, type_info strucures for
the class are pinned to a single TU. This prevents false negative
dynamic_cast and catch evaluation.

In this third batch, we de-inline dtors of exported public classes
from the QAccessible subsytem.

Since they are already exported, users of these classes are unaffected
by the change, but since it's public API, and the dtors may have been
de-virtualized and inlined into application code, we need to avoid
adding code to the out-of-line dtor until Qt 6.

Change-Id: I5324bd1b3b9210a3ac5cf4eee9317a34e4a3b048
Reported-by: Volker Krause <volker.krause@kdab.com>
Task-number: QTBUG-45582
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-03 12:03:11 +00:00
Marc Mutz
f0eafa5672 QAccessibleInterface: move implementation beside doc block
Adjust doc text to what's used elsewhere in QAccessible.

Change-Id: I8bd194e55374b8258361ae254817a4298c4fa3dc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-06-03 12:03:06 +00:00
Marc Mutz
8d9d609e63 De-duplicate vtables, part II: exported public classes
By making the destructor (usually the first non-inline, non-pure,
virtual function, and therefore the trigger for most compilers to
emit the vtable and type_info structures for the class in that TU)
out-of-line, vtables and, more importantly, type_info structures for
the class are pinned to a single TU. This prevents false negative
dynamic_cast and catch evaluation.

In this second and last batch, we de-inline destructors of exported
public classes.

Since they are already exported, users of these classes are unaffected
by the change, but since it's public API, and the dtors may have been
de-virtualized and inlined into application code, we need to avoid
adding code to the out-of-line destructor until Qt 6.

Change-Id: Ieda9553cb4b0dae7217c37cc7cde321dd7302122
Reported-by: Volker Krause <volker.krause@kdab.com>
Task-number: QTBUG-45582
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-03 12:02:59 +00:00
Marc Mutz
133e402831 De-duplicate vtables, part I: exported private classes
By making the destructor (usually the first non-inline, non-pure,
virtual function, and therefore the trigger for most compilers to
emit the vtable and type_info structures for the class in that TU)
out-of-line, vtables and, more importantly, type_info structures for
the class are pinned to a single TU. This prevents false negative
dynamic_cast and catch evaluation.

In this first batch, we de-inline destructors of exported private
classes.

Since they are already exported, users of these classes are unaffected
by the change, and since it's private API, we don't need to avoid
adding code to the out-of-line destructor until Qt 6.

Change-Id: I450707877d2cb6a77f79ae1dd355facb98d6c517
Reported-by: Volker Krause <volker.krause@kdab.com>
Task-number: QTBUG-45582
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-03 12:02:55 +00:00
Marc Mutz
b295afb064 QStaticTextUserData: declare dtor out-of-line and export class
De-duplicates vtables and enables RTTI on this class
hierarchy.

Export, as QOpenGLStaticTextUserData (QtOpenGL) inherits it.

Change-Id: I0662870538c35f23baf6bde4594ec8b9055efae7
Reported-by: Volker Krause <volker.krause@kdab.com>
Task-number: QTBUG-45582
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-03 12:02:49 +00:00
Allan Sandfeld Jensen
8f760808e0 Fix premul conversion from ARGB32 to A2RGB30 formats.
When a premultiplied alpha changes value because it is rounded to fewer
bits the premultiplied colors may need to be recalculated with the new
value. Otherwise the color will both be wrong and potentially invalid.

Change-Id: I9ec74a22aac73cd7ffab04e180cf2bf35bb4c315
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-03 12:01:26 +00:00
Simon Hausmann
e2f66f9215 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/corelib/global/qnamespace.qdoc
	src/corelib/io/qwindowspipereader.cpp
	src/corelib/io/qwindowspipereader_p.h
	src/corelib/statemachine/qstatemachine.cpp
	src/corelib/statemachine/qstatemachine_p.h
	src/plugins/platforms/xcb/qxcbconnection.h
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/tools/qmake/tst_qmake.cpp
	tests/manual/touch/main.cpp

Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
2015-06-03 10:23:56 +02:00
Liang Qi
754efa57d8 Merge "Merge remote-tracking branch 'origin/5.5.0' into 5.5" into refs/staging/5.5 2015-06-02 23:39:22 +00:00
Sérgio Martins
f44a59f390 Don't assign iterator to const_iterator
It should also be possible to use QT_STRICT_ITERATORS in Qt's own code base

Change-Id: I0914db480d4d2b06e71e3a2588163efdd3ff6d27
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-02 19:41:16 +00:00
Lars Knoll
beef975f92 Cleanup the mouse event handling in testlib
Calling QCursor::setPos() to emulate mouse move events
is a rather bad idea, as it creates round trips through
the server, leading to timing issues etc.

In addition, we should not call qapp->notify(), but rather
route the events through the proper QPA interface. This
is required to properly generate all other events such
as enter/leave etc. As this breaks existing tests,
put the new behavior behind an #ifdef for now. Like this,
we can fix tests one by one, and then turn on the define by
default for 5.6 (with a changelog message).

We emulate timestamps to avoid creating double clicks
by mistake. In addition, fix QGuiApplication::processMouseEvent
to not push events back into the QPA event queue (as this is
a bad hack and breaks the new testing system).

Change-Id: I71774cb56674d7fb66b9a7cf1e1ada1629536408
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-02 08:02:35 +00:00
Allan Sandfeld Jensen
71fe2df773 Syntax clean up in qimagescale
Corrects a few white-spaces, return statements and else statements
to fit Qt coding style.

Comment updated to indicate how far the code is getting from its
original roots.

No semantic changes.

Change-Id: Ia2288c501788a291bfc4e8b70e8eb1efb7a90128
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-02 07:46:17 +00:00
Liang Qi
166c2499d9 Merge remote-tracking branch 'origin/5.5.0' into 5.5
Change-Id: I060b0e10e55487a4a4a101f77ad7c8dc8cf0f553
2015-06-02 09:44:03 +02:00
Jani Heikkinen
7bc9310a22 Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5.0 2015-06-02 04:20:54 +00:00
Allan Sandfeld Jensen
6b4c1ad58c Fix wrong method name in QColor documentation
The methods are called hslHue and hslSaturation. This was leading
to dead links.

Change-Id: I0997c415958aae9a66fb037d98f8ad3d43b38231
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-01 17:57:18 +00:00
Liang Qi
fcfd31c9fd Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	qmake/generators/mac/pbuilder_pbx.cpp
	src/corelib/global/qglobal.h

Change-Id: I2c0f7544bf194f2d0f59218fd583c822901487b0
2015-06-01 17:46:58 +02:00
Laszlo Agocs
0e1b4e896f Avoid QWidget dependency in QtGui
It's not a real dependency as all we need is to store a pointer,
but better not to use the name QWidget at all.

Change-Id: I30ef1dd44ac7e42c1b9c84675f94088b8c516076
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-06-01 13:38:18 +00:00
Laszlo Agocs
78e3354083 Clip QOpenGLWidget and QQuickWidget correctly
Introduce support for the widgets' clipRect(). Right now render-to-texture widgets
in scroll areas placed close to each other result in broken (non-existent) clipping.
Similarly, stack-on-top widgets fail to clip when placed inside a scroll area.

This is now corrected and the qopenglwidget example is enhanced to utilize a scroll
area.

Task-number: QTBUG-45860
Change-Id: I859a63d61a50d64ba9e87244f83c5969dce12337
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-06-01 13:38:14 +00:00
Marc Mutz
4ca16e99e7 QAbstractTextDocumentLayoutPrivate: declare dtor out-of-line and export class
De-duplicates vtables and enables RTTI on this class
hierarchy.

Export, as QPlainTextDocumentLayoutPrivate (QtWidgets)
inherits it.

Change-Id: I8aee43b43898a72430d8bc1247ea76c7d4e9031d
Reported-by: Volker Krause <volker.krause@kdab.com>
Task-number: QTBUG-45582
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-01 05:23:38 +00:00
Marc Mutz
60f4d5165a src/gui/text/text.pri: add missing header qabstracttextdocumentlayout_p.h
Change-Id: Ia825ef6d932fbd45ceaf8c54a3207f207fa40994
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-01 05:22:05 +00:00
Marc Mutz
87d57d1994 Fix users of QTextLayout::additionalFormats to use the new API
QTextLayout::additionalFormats setters and getters using QList<FormatRange> have
been deprecated; port to the QVector versions.

Moved op== definition for FormatRange needed in tst_qsyntaxhighlighter.cpp
to a friend declaration in FormatRange itself, because MSVC 2008 doesn't find
it otherwise.

Change-Id: Ibab6589df057f02377d895079b56395859e3401e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-05-30 10:56:24 +00:00
Allan Sandfeld Jensen
455653d77f Combine x and y oriented sample helpers
The range sampling operates the same in both directions just with
different step-sizes, so the code can be unduplicated,

Change-Id: I47805a7e925d4058f62c558ef08e79485915e937
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-05-30 01:18:23 +00:00
Allan Sandfeld Jensen
a7a0b741c5 Remove unused call indirection
The global variable is a left over from when there was an MMX assembler
implementation, and is now just making the compiler's job harder.

Change-Id: I686704b64a2f8c68ec8ca83f2ac3e465ded773e0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-05-30 01:18:16 +00:00
Marc Mutz
c0ddd5fa12 QTextLayout: replace a use of an inefficient QList with QVector
The QTextLayout::FormatRange is larger than void* and thus should not be held in
QList. Use a QVector instead.

Other parts of Qt already hold FormatRanges in QVectors, so this also makes
handling FormatRanges more consistent.

To avoid ugly names for the getter which doesn't overload on return type alone),
rename the set of function to format (from additionalFormats).

[ChangeLog][QtGui][QTextLayout] Added QVector-based alternatives setFormat(),
format(), and clearFormat() to setAdditionalFormats(), additionalFormats(),
and clearAdditionalFormats(), resp.

Change-Id: Ie04a561b43c91c3b2befb3cac2981821f84d5f77
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-29 14:00:10 +00:00
Liang Qi
2670bdeee4 Merge remote-tracking branch 'origin/5.4.2' into 5.4
Change-Id: Ied2a227a25859163a924c7b5717492a1f974c5ca
2015-05-29 10:00:01 +02:00
Friedemann Kleint
765fea8dad QtGui/Windows: Fix static build.
qtbase\src\gui\kernel\qgenericpluginfactory.cpp:70: error: C2220: warning treated as error - no 'object' file generated
qtbase\src\gui\kernel\qgenericpluginfactory.cpp:70: warning: C4100: 'specification' : unreferenced formal parameter

Change-Id: I2dbb114fa9feaf862b4554b128caca0dcb5e291e
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-05-27 15:29:23 +00:00
Laszlo Agocs
43e82a3b09 QOpenGLWindow: initializeGL is to be called before resizeGL
This involves deinlining some private class stuff to keep things
readable and maintainable.

Task-number: QTBUG-46002
Change-Id: Ie2888aa6c16a6f5182b61fbaa43288cfcc96cbc4
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-05-27 11:50:35 +00:00
Laszlo Agocs
3311d92d8e Fix failing input device notifications on embedded
The connection to the deviceListChanged() signal may be queued. To make it
work our custom types have to be registered.

The problem is only visible with input backends like evdevtouch that live
on their own thread.

Task-number: QTBUG-46069
Change-Id: I4c03e8031e4337b5e711a3bd2cf405d15d6ce214
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
2015-05-27 11:50:39 +00:00
Marc Mutz
16b95b65a6 Q*GlyphCache: de-inline dtor and export vtable
The destructor is the first virtual method. By not defining it
out-of-line, we provoke multiple copies of vtables, not all of
which can be merged by the linker. If the linker fails, RTTI
such as dynamic_cast and catch-blocks involving the type will
not work.

Additionally, QFontEngineGlyphCache was not exported, and
therefore also not its vtable, making it impossible for
users outside of QtGui to get a unique RTTI for the class.

Change-Id: Ib265945934216bb609629431eb4c71996d4fd39d
Reported-by: Volker Krause <volker.krause@kdab.com>
Task-number: QTBUG-45582
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-05-26 17:51:47 +00:00
Marc Mutz
10d53a3f0e Add qHash(QKeySequence)
Key sequences can be compared for equality,
so qHash should be overloaded, too.

[ChangeLog][QtGui][QKeySequence] Added qHash(QKeySequence).

Change-Id: I3cf896292459897d66198d96dfcdba1a39bdafce
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-05-26 17:51:42 +00:00
Lars Knoll
66050f2ac8 Make event delivery from testlib synchronous
Directly process events delivered from testlib in QGuiApplication. The
old code put these events into the QPA event queue leading to race
conditions with plugins delivering native events from a secondary
thread.

Change-Id: I5646b1014f681593d487c9d1e65053ba06206411
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-23 11:38:24 +00:00
Allan Sandfeld Jensen
ad9698713f Adjust curveThreshold based on strokeWidth
Currently curveThreshold is relative to pen width, this allows wide
pen to be increasingly off target.

This patch adjust the curveThreshold relative to stroke width, thereby
ensuring wide pens stays on the curve.

Task-number: QTBUG-46151
Change-Id: Ifd4371aa2853331d02e3c6f6565c243eb1b7ed2e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-05-22 05:45:38 +00:00
Friedemann Kleint
b0a1a134c2 Add debug operator for QTouchDevice.
Produces:
QTouchDevice("", type=TouchScreen, capabilities=Position|Area|NormalizedPosition|MouseEmulation, maximumTouchPoints=10)

Remove operator from manual test.

Change-Id: I6b792665031902d5f822c80807a400a334c27526
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-05-22 04:36:41 +00:00
Friedemann Kleint
97e75b2763 Make QTouchDevice a Q_GADGET and introduce Q_ENUM/Q_FLAG.
Make it possible to stream the enumerations to a debug stream.#

Change-Id: I0add2dcd835333a8d6cebf779252f22c1418faf3
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-05-22 04:36:28 +00:00
Allan Sandfeld Jensen
d4a296b538 Do not modify decoder when determining image-format
We should not configure the decoder when just determining the image-
format. Doing so can cause all versions of libpng to print a warning,
and some versions to fail to decode.

The code appears to be a leftover from when the image-format logic was
copied out of the introduction of the decoding method, where the proper
settings are still applied.

Task-number: QTBUG-46233
Change-Id: I6619728804f040ae6c9d637c7298a8586e22499e
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2015-05-21 08:49:47 +00:00
Shawn Rutledge
d8bfd812c3 D-Bus system tray icon: submenus can be created after context menu
QMenuPrivate::init() calls QPlatformTheme::createPlatformMenu() to
create a platform menu, but on Linux, that returns null for now.
QSystemTrayIcon::setContextMenu() results in recursive calls to
QSystemTrayIconPrivate::addPlatformMenu() which then calls
QDBusTrayIcon::createMenu() for the context menu and each submenu.
However if a submenu is added afterwards, a corresponding platform
menu is not immediately created.  Now copyActionToPlatformItem()
will detect and create the missing platform submenu, by calling
a new method: DBusPlatformMenu::createSubMenu().  This is because
there is no way of knowing that it's a tray-specific context menu
(which is so far the only case in which we use DBusPlatformMenu).
So, QPlatformMenu::createSubMenu() needs to exist as a new
QPA interface for this use case.

Task-number: QTBUG-45803
Change-Id: Ib319e873082196515ea0580d70d069099cf2c175
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-05-21 05:17:08 +00:00
Laszlo Agocs
412eb090c9 Fix GLES3 functions on iOS
Task-number: QTBUG-45933
Change-Id: I784e34c1cfee5ea69955c221f0448c1d04e0b6d7
Reviewed-by: jian liang <jianliang79@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-05-18 18:13:46 +00:00
Nico Vertriest
a4848142b4 Doc: added doc for non-documented functions
Task-number: QTBUG-36985
Change-Id: I85f58c2877d83b98bf3427cbb0f567575803524f
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-05-18 08:01:37 +00:00
Timo Jyrinki
03281150b9 Add environment variable support for testability library use.
Add the option to load the testability library based on whether
an environment variable QT_LOAD_TESTABILITY is set, in addition
to the current "-testability" flag.

This improves the use of testability library together with the
autopilot functional testing tool.

Task-number: QTBUG-32974
Change-Id: I6abf2c004cbff2ce0aff44e24a99bcc8188a52ae
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-05-15 11:47:21 +00:00
Allan Sandfeld Jensen
e905526090 Better match thin font styles
A style name 'Extra Thin' or 'Thin Italic' should be parsed as Thin
font weight.

Change-Id: I8acebed7330c23231b3742d887081d8b3d0aeb19
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-05-14 00:28:06 +00:00
Friedemann Kleint
c2e0c126d8 Introduce a version number to QPlatformInputContextFactoryInterface.
Append a version number to QPlatformInputContextFactoryInterface_iid
as is done for QPlatformIntegrationFactoryInterface. Start with 5.1 since
c91c05b056 changes the API in 5.4.
Use macro in plugins.

Task-number: QTBUG-46009
Change-Id: I1d1a89bde50d263354f33a6917efb1c084211842
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-05-13 12:41:30 +00:00
Friedemann Kleint
45ccabdd49 Increase version number of QPlatformIntegrationFactoryInterface.
Increase version 5.2->5.3 in macro
QPlatformIntegrationFactoryInterface_iid and use that in the plugins.

Task-number: QTBUG-46009
Change-Id: I491ab0ac169ede5c103b40e1bcbcbf511922a911
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-05-13 12:41:15 +00:00
Timur Pocheptsov
21e6c7ae47 Cocoa integration - implement Qt::WindowModal file dialogs
Previously, for Qt::WindowModal dialogs  we were creating modal sheet with beginSheetModalForWindow:
and later (from exec) calling -runModal, essentially making a window modal dialog into (now) application
modal sheet, which is not right- it's centered relative to desktop and the jump from window modal sheet's
position (centered relative to a window) to application modal was quite visible.
Now, instead of [panel runModal] (== [NSApp runModalForWindow:panel])
we call [NSApp runModalForWindow:theRequiredWindow].

Change-Id: I793dc72c7d1fe96497bb35754f4d0eac9a5e00e5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-05-13 11:18:21 +00:00
Marc Mutz
ce9ad30c78 QQuaternion: optimize op*
Swap subexpressions around so the expressions involving w
(the first member in memory order) execute first.

And no, compilers don't do that automatically. Well, GCC 4.9 doesn't.

Change-Id: I918ecc27a9ac9775fa91968c0548d182d7ad28e3
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-05-13 01:08:55 +00:00
Sérgio Martins
2a2e7ec20a QQuaternion: Deprecate conjugate() and introduce conjugated()
Change-Id: I9aa835138e1e33448fea920f7a5ba99b26a95ebf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-05-13 01:08:45 +00:00
Konstantin Ritt
43cab86802 Fix overcaching the fallback families list for a requested family
The cached list didn't take fontStyle, styleHint and script into account.
As long as QFontCache isn't explicitly disabled, loadEngine() rarely
called for the same family, foundry, style and size - so avoid caching
anything here at all.

Change-Id: I7779bf33fc074edc00799f9a39d67327f8c88ccc
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-13 01:08:36 +00:00
Konstantin Ritt
c874e10cbc Simplify QFontDatabase::findFont()
QFontDatabase::load() is the only caller that passes non-null
QFontPrivate* to QFontDatabase::findFont(), to adjust the pointSize
with regards to the font's dpi; do that right in QFontDatabase::load().
The `multi` param's meaning is, in fact, an absence of the
QFont::NoFontMerging flag,
so prefer the latter and prevent ambiguity in the future.

Change-Id: Icc7751044e454ca438e7627364faa415287bf1ae
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-05-13 01:08:33 +00:00
Konstantin Ritt
994a7476ef [QFontDatabase::findFont] Get rid of the refactoring leftovers
The logic this code was aimed for has been covered by a more complete
solution in QFontDatabase::load() years ago; simply drop the dead code.

Change-Id: Id8860353ff4f4d2f1529aa89810d6c5725e97d24
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-05-13 01:08:30 +00:00
Alexander Volkov
77e0090995 QMouseEvent: add constructor which takes the source as a parameter
Simplify the code by passing the source of a mouse event
directly to the constructor instead of setting it by
QGuiApplicationPrivate::setMouseEventSource().

Change-Id: I1774cf39a211d36d3adf0ff30f3bd2fb7c5fb429
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-05-12 10:17:40 +00:00
Allan Sandfeld Jensen
ba323b04cd Optionally apply orientation on QImage read
Make it possible to read images with EXIF orientation automatically
applied. This was originally implemented without opt-out in Qt 5.4, but
reverted. Here it is implemented as opt-in for JPEG, and opt-out for TIFF
to keep behavioral consistency.

The EXIF support for JPEG was written by Rainer Keller.

[ChangeLog][QtGui][Image plugins] An option has been added to
QImageReader to enable automatic application of EXIF orientation.
This behavior was default in Qt 5.4.1, but reverted in Qt 5.4.2.

Task-number: QTBUG-37946
Task-number: QTBUG-43563
Task-number: QTBUG-45552
Task-number: QTBUG-45865
Change-Id: Iaafd2519b63ede66ecc1f8aa4c7118081312b8f5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-05-12 09:25:11 +00:00
Bjoern Breitmeyer
12dd4ff7e7 Remove effectless statement.
The UNDER_NT define is useless as the include
already happens before in qfunctions...

Change-Id: I25fc23e169ce91d787331a7a86023aa7b424d687
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-12 09:10:52 +00:00
Laszlo Agocs
55225948a9 Create context with the correct screen in QOpenGLWindow
Targeting a non-primary screen with a QOpenGLWindow requires (at least
with GLX) that the context is created with the same screen. Otherwise
the context cannot be used with the window (BadMatch due to different
X screens)

Change-Id: I64f38ad7317d39a164bb69bb1430692319fc49d4
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-05-12 08:58:56 +00:00
Giulio Camuffo
1f03520a20 Add a way to filter window system events
This change introduces the class QWindowSystemEventHandler
which can be used to hook into QWindowSystemInterfacePrivate to
filter and dispatch window system events.
One use case is to intercept key events from the underlying system
in QtCompositor and feed them into the xkbcommon state, and to modify
the events based on the resulting state.

Change-Id: I829eb7d960420135990fb0f6db54c14eea3e8e48
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-05-12 07:17:25 +00:00
Andy Shaw
a1ada382ff Handle parsing of GL_VERSION as reported by Nexus 6
The Nexus 6 device reports a GL_VERSION which is strictly not conformant
to what is expected from GL_VERSION, so a check is added for this case so
that it correctly detects the right OpenGL ES version.

Change-Id: I00297dd7c1e505dd7f9ab8a7fa480f514162b488
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-05-11 07:15:46 +00:00
Kai Koehne
dad54e794f MSVC: Silence compiler warning about INFINITY
Contrary to the comment, MSVC does support INFINITY, but
always prints a warning when it's used:

qpainterpath.cpp(3066) : warning C4756: overflow in constant arithmetic

Avoid this by using numeric_limits<T>::infinity.

Change-Id: Ie925b036b807378da5298a275fa108347c24519e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-11 07:09:37 +00:00
Allan Sandfeld Jensen
9b2ee419b4 Merge "Merge remote-tracking branch 'origin/5.4' into merge5.5" into refs/staging/5.5 2015-05-08 17:34:00 +00:00
Laszlo Agocs
4fe68ffbe5 Add GPU_BLACKLIST support to QTestLib
In addition to BLACKLIST, Qt will now look for GPU_BLACKLIST too.
Test cases that are specified as disabled in the GPU blacklist
will be skipped. This is particularly relevant when running tests
on Embedded Linux devices.

For example, the following JSON would configure the test case
glxContextWrap to be skipped on drivers where GL_VENDOR contains
UnstableDriverVendor:

{
    "entries": [ {
            "gl_vendor": "UnstableDriverVendor",
            "features": [ "disable_glxContextWrap" ]
    } ]
}

In contrast to the regular blacklist, GPU-blacklisted test cases are
not run at all. This is because driver problems and instabilities
often lead to crashes.

Change-Id: I340cf5c0261a206109b78409774408981bba5c68
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-08 15:11:32 +00:00
Allan Sandfeld Jensen
1fce111809 Merge remote-tracking branch 'origin/5.4' into merge5.5
Conflicts:
	src/corelib/global/qglobal.h
	src/corelib/io/qnoncontiguousbytedevice_p.h
	src/gui/image/qjpeghandler.cpp
	src/network/access/qhttpthreaddelegate_p.h
	tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
	tests/auto/widgets/widgets/qmenubar/BLACKLIST

Change-Id: I01de8c1c28efcedfd7953d05025f54802dc08ab3
2015-05-08 13:26:44 +02:00
David Faure
cd90182e67 QStandardItem: add user-tristate and auto-tristate getters/setters
and deprecate isTristate()/setTristate() which isn't specific enough.

This matches the changes to the flags themselves.

Change-Id: I0ba592af340cb81fc9f4d483569844fe8d7510c3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-05-07 09:50:59 +00:00
David Faure
ae8406d82f Deprecate ItemIsTristate in favor of ItemIsAutoTristate.
This makes the behavior much more clear. You can get a tristate checkbox
just by setting the CheckStateRole to PartiallyChecked, no tristate flag needed.

The flag, on the other hand, enables the automatic-tristate behavior in
QTreeViews (and only there), hence the new name for it.

Change-Id: I18d292a8b8294c863eab806f3874d15dfb72556c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-05-07 09:14:18 +00:00
David Faure
5d78584523 QTextTable/QTextDocumentLayout: remove dead code
Change-Id: I3eb72a43129c58574036b6ca8c8c8413ca24b43a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-06 11:28:55 +00:00
Laszlo Agocs
39e3977cc5 Add flip support to QPlatformBackingStore::toTexture()
Necessary for iOS. In addition to swizzle we also need to communicate the need
for flipping, so switch to flags instead of bools.

Task-number: QTBUG-40034
Change-Id: I055e591afd838878503be6f5f69aa7347965d9cf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-05-06 10:39:02 +00:00
Richard Moe Gustavsen
1c7e3a2a33 QShapedPixmapWindow: ensure we set a valid geometry
On touch platforms, QCursor::pos() will only be 'valid' when a
touch event has (at least once) been translated to a mouse event.
Currently this never happens in QtQuick since QtQuick always
accepts all touch events and performs its own translations.

So rather than setting the geometry of QShapedPixmapWindow from
QCursor directly, we instead base it on mouse events. This will
ensure that we never try to set the geometry of the window to
an 'invalid' value, which can cause a crash on platforms like iOS.

Note that we currenly miss an API in Qt to get the current
touch points. When that is in place, we can also set
a correct start position for the window before the
first mouse move event arrives.

Task-number: QTBUG-45877
Change-Id: I320598e87d43f6e9e087c204a69b95465128f468
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-06 07:59:19 +00:00
Richard Moe Gustavsen
cb07059525 QShapedPixmapWindow: don't accept input focus
Inform the platform that it should not activate the window
when shown by setting Qt::WindowDoesNotAcceptFocus. This compliments
the already set Qt::WindowTransparentForInput, which specifies
that mouse/touch events should also pass through the window. In
other words, the window is just for showing output and should not
respond to input.

Change-Id: I3e90a28be2f2e27e2044effedf64f47c94a857a5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-06 07:59:14 +00:00
Allan Sandfeld Jensen
4c8bbf8dda Revert change of NOTHROW to NOEXCEPT
The change would remove the noexception hint on MSVC versions that
doesn't support noexcept but supports their older 'throw()' hint.

Change-Id: Ie5163f2413522f427279f59c8562c0ce4769bc82
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-05-05 07:06:43 +00:00
Volker Krause
337c279215 Make data tables const.
Moves some of them to the .rodata section, the rest at least to
.data.rel.ro[.local].

Change-Id: I85676ddf22b0c0097f3f0dce4c3dc018dc29d045
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-05-05 05:31:32 +00:00
Sérgio Martins
f44f2136e0 Add Q_REQUIRED_RESULT in several places
Change-Id: Icda3000f1d9f0d41612a50a816aa5de5e32028d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-05-04 13:57:47 +00:00
Marc Mutz
ec73b5d4b8 QQuaternion: prepare isNull(), isIdentity() for constexpr'ification
...by dropping the use of qIsNull(), which, in Qt 4, distinguished
between -0.0f and +0.0f.

But mathematically, whether x, y, z are ±0 doesn't change the fact
that the result is the identity element (x, y, z should contain the
identity element for addition and w the one for multiplication), or
the null element (additive identity).

So using qIsNull() was wrong even in Qt 4. In Qt 5, qIsNull() returns
true for both ±0, so we can just as well compare to 0.0f instead,
which allows to mark these functions constexpr (qIsNull() can't be).

Do so.

Change-Id: I78b1fa7890036dd3cb4de7f90b75d439f9835e73
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-05-04 13:49:27 +00:00
Allan Sandfeld Jensen
e445f3c47b Add noexcept to move constructors and assignment operators
Add the noexcept attribute to all move constructors and assignment
operators in QtGui that didn't already have it.

Change-Id: Idcdf79ae8349b8793e7394b5ae7c08e6111fbc9a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-05-04 11:27:48 +00:00
Simon Hausmann
7f8719e663 Merge remote-tracking branch 'origin/5.5' into HEAD
Change-Id: I487a4b7c05687a10c498ac219c31367d4db6fbc0
2015-05-04 13:19:31 +02:00
Thiago Macieira
eb82959d66 Fix undefined behavior in left-shifting into negative
It's undefined behavior to left or right-shift a signed integer such
that the sign changes. Since SymbolCsbBit is 31, make sure we use
unsigned numbers.

Found by ICC
qplatformfontdatabase.cpp(614): error #68: integer conversion resulted in a change of sign

Change-Id: Idf715b895bac4d56b4afffff13da78d294b1248e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-05-04 06:00:39 +00:00
Laszlo Agocs
9ae7e33f28 Use stdint.h in qopengl headers on MSVC too
Task-number: QTBUG-45774
Change-Id: I1505b4ebeb99371ec2099657c9ce05418dd54224
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-05-02 11:38:32 +00:00
Konstantin Ritt
3ce2dd391e [QFontDatabase] Get rid of QtFontEncoding
This one has not been unsed for ages (since Qt3?).

Change-Id: Iaf514db1b698b34a303f34c150b72db989eb176c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-01 05:36:11 +00:00
Konstantin Ritt
a77dc1a669 [QFontDatabase] Drop QtFontDesc's familyIndex member
Many times set but never used.

Change-Id: I297f21d4b9878e5f9559a2dfdb2d3de34107bb7d
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-05-01 05:36:09 +00:00
Konstantin Ritt
9bf6ea7fde [QFontDatabase] Get rid of some dead code
1. Checking if `db->count == 0` inside the
`for (int x = 0; x < db->count; ++x)` loop makes absolutely no sense;
2. The family gets loaded just a line above (ensurePopulated()).

Change-Id: I72dbd42565c4f5a5d9ff8879f10ee0ece7298fa7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-01 05:36:04 +00:00
Konstantin Ritt
7443b3c949 Optimize QFont::resolve(const QFont &other)
When resolve_mask is 0, the font inherits just everything, and there is
no need in checking for any resolved attributes;
the resolved font always inherits dpi, so do not check it either.

Change-Id: Ie5d7ced0859d46a9237447e29051a22569480a51
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-01 05:35:53 +00:00
Allan Sandfeld Jensen
041cbe4b38 Add missing RGB32 <-> RGB30 convertions
Completes the inplace converters so that we can rely on inplace
conversions to succede as long as the image depth is the same.

Change-Id: Ia1ae34b5de1bc16e87ff5403bdacfcae44a22791
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-30 19:27:39 +00:00
Allan Sandfeld Jensen
68faf3a9bb Fix QImage format after inplace conversion
Some inplace conversions would not set the requested image format in
the returned image, due to the same conversion being used for several
destination formats.

This patch ensures all inplace conversions return the right format,
and adds testing infrastructure to easily test iterate over all formats
so that they all can be tested.

Change-Id: I68ab17a713ddb2aa8ed6aaf0a0a1ec8bbcb56090
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-30 15:26:26 +00:00
Allan Sandfeld Jensen
52ddfb36c8 Fix two errors in RGB30 conversions
The one converters from RGB30 was misplaced in the method table, and
the unpremultiplication from A2RGB30 to RGB30 had an underflow mistake
when alpha was 2.

Change-Id: I92c11ede28611a3dbdce72aca1898845c120c209
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-30 10:00:21 +00:00
Rainer Keller
518f886b61 Revert "Rotate images according to Exif orientation"
Due to a behavior change.

This reverts commit 9157087334.
This reverts commit 16c32c6dfb.

Task-number: QTBUG-37946
Task-number: QTBUG-45552
Task-number: QTBUG-43563
Change-Id: Idf8df7d8f22465e8f6b51acb68993ac97208b184
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-29 17:36:43 +00:00
Allan Sandfeld Jensen
7f8da2179b Convert opaque indexed images over RGB32
There is no reason to use the more expensive ARGB32 conversions when
there is no alpha channel involved.

Change-Id: Ifcb325352b8c806ef755db385121a2939c5825b2
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-28 21:43:50 +00:00
Allan Sandfeld Jensen
f15d6c3fa9 Preserve QImage metadata in image transforms
Some QImage methods were not preserving image metadata, or only
preserving some of it. This adds the missing parts and adds a test for
metadata.

Change-Id: Ib5892a23e49dfde5ea26074d3deaa887fa930c6b
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-28 12:42:12 +00:00
Liang Qi
1c8451bdbb Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/tools/qdoc/tree.cpp
	tests/auto/gui/painting/qcolor/tst_qcolor.cpp

Change-Id: Iaa78f601a63191fa643aabf853520f913f2f0fdc
2015-04-27 21:36:32 +02:00
Marc Mutz
57a010adf4 Mark QRGba64 as Q_PRIMITIVE_TYPE
Change-Id: I1ab25a7b880b47f616ae152400c1e2116688ec4c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-27 07:30:18 +00:00
Marc Mutz
9c4cbc0cc7 QGenericMatrix: remove one of two non-initializing ctors
...and port to the remaining one.

Can't do the same for QMatrix4x4, because that class is exported.

Change-Id: I5448921af9e9194532be1b9f8d739b5c418a5e0b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-04-26 12:40:43 +00:00
Marc Mutz
2447dd2659 QGenericMatrix: remove copy ctor
The compiler-generated one is just fine.

Change-Id: Iaacc56d4224c69b66823cc64640a00117c44d3cc
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-26 12:40:37 +00:00
Allan Sandfeld Jensen
bc162382e5 Short-cut SSE4 unpremultiply
Even with SSE4 optimized unpremultiply it is still significantly faster
to skip the calculation on alpha values 0 and 255.

Change-Id: Iafe658fea8eacf35a857f292952b0c1ee056139c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-25 00:15:52 +00:00
Marc Mutz
ce302a53df Simplify QQuaternion::operator!=()
Change-Id: I5043c86362f5126c52d768b51774086869429e08
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-04-24 13:51:20 +00:00
Morten Johan Sørvig
7b97f53e71 Fix synchronousWindowsSystemEvents spelling.
"WindowsSystem" -> "WindowSystem".

Strictly a QPA API break; there are no users of the
function in QtBase.

Change-Id: If2151b57587c68a7b5cbf261c54634aa930f2792
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-04-24 11:24:48 +00:00
Allan Sandfeld Jensen
f657ecdc5d Fix inplace double mirroring on odd sized images
The QImage inplace mirroring method, failed to handle the middle line
when mirroring both ways (rotate 180). In both other mirroring cases
the middle can be left untouched, but in this case it needs to be
mirrored half way.

To make the logic simpler, double mirroring will now mirror half the
lines instead of half of every line.

Change-Id: Iaa1f1e1c3f7dedfb78891fc93207f6d0c64bcafe
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-23 10:14:48 +00:00
Allan Sandfeld Jensen
63d5a42b59 Revert "Remove separate SSE4 unpremultiply function"
Could causedSSE4 instructions to be used on non SSE4 machines
in cases when qUnpremultiplywas not inlined.

This reverts commit 964ccc5853.

Change-Id: Ic676ade8f75129e8d37c4d96cbfb2bdb5b794919
Task-number: QTBUG-45741
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-23 09:25:28 +00:00
Liang Qi
b31e98d477 Don't use anonymous types declared in an anonymous union
At least clang is unhappy with them when -Wnested-anon-types is enabled.

Change-Id: Ia9869fecb836b27be69f7b9715fd614f384bb912
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-04-22 08:49:39 +00:00
Liang Qi
aed5a71683 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/corelib/statemachine/qstatemachine.cpp
	src/corelib/statemachine/qstatemachine_p.h
	src/gui/painting/qdrawhelper.cpp
	src/plugins/platforms/xcb/qxcbnativeinterface.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/plugins/platforms/xcb/qxcbwindow.h
	src/testlib/qtestblacklist.cpp
	src/tools/qdoc/node.cpp
	src/tools/qdoc/node.h
	tests/auto/gui/painting/qcolor/tst_qcolor.cpp

Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
2015-04-22 09:25:54 +02:00
Laszlo Agocs
a989e5c54f Enhance QWindow::devicePixelRatio() docs
Document that fact that for non-create()'ed windows this is the
same as QGuiApplication::devicePixelRatio() which is the highest
dpr in the system. This has consequences when running with multiple
displays so application developer's have to be aware of this.

Change-Id: Ic05a18732ff021659da04428cb49421ac3453870
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-04-21 11:50:54 +00:00
Marc Mutz
05d1693793 Add qHash(QMatrix) and qHash(QTransform)
QMatrix and QTransform can be compared for equality,
so qHash should be overloaded, too.

[ChangeLog][QtCore][QMatrix] Added qHash(QMatrix).
[ChangeLog][QtCore][QTransform] Added qHash(QTransform).

Change-Id: I1ce925ebe258c9d7e35b68e5ac5c3373f1460c58
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-21 07:28:14 +00:00
Marc Mutz
1b5f29e28a Remove <qhash.h> where it's not used
To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5)
in public headers.

Change-Id: I6117e8a6b11200d2f1a0a94a0e87d5c27538218e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-20 07:41:34 +00:00
Marc Mutz
103086e379 Replace <qhash.h> with <qhashfunctions.h> where applicable
To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5)
in public headers.

Change-Id: Ic3398f4f330e15a3b55065858add26b90fd70e6c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-20 07:41:27 +00:00
Harald Hvaal
8fb881900c Enable checking for whether the system palette was explicitly set
In order to obey a palette set globally on QApplication, an application
attribute for checking if it's set at all is added.

Task-number: QTBUG-39800
Change-Id: I26b965e6e18e0e1ca4df03cf343b3527df3636b2
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-20 06:39:31 +00:00
Allan Sandfeld Jensen
964ccc5853 Remove separate SSE4 unpremultiply function
Merges the SSE4 specific unpremultiply with the normal version, and
adds a SSE2 fallback. There was no reason to split the two since
compile time options will ensure the right version is inlined.

Also adds short-cut for 0 and 255 values.

Change-Id: Ie5aa262f6964219fd3062d4a498f697cf79a4595
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-16 19:24:06 +00:00
Laszlo Agocs
f3fad26bc9 Add matching by GL_VENDOR to QOpenGLConfig
This will be essential on Linux, especially Embedded where PCI IDs are
not that useful.

Change-Id: I2fa8ca07236e8aae203e21fe629d12aab092c7fd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-16 16:47:43 +00:00
Laszlo Agocs
71e3ce7f0b The default wrap mode is REPEAT
As per spec, both for OpenGL and OpenGL ES. No wrap mode is
applied unless setWrapMode() is called so the default values
should be initialized to match OpenGL's default.

Correct the copy-paste mistake in the warning messages.

Change-Id: I094cc511dc7de4a214da61faadb1fc362270b2d4
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-04-16 16:46:35 +00:00
Allan Sandfeld Jensen
a7303e45db Move composition out of qdrawhelper.c
Also changes the way the SSE2 composition modes are inserted into the table,
so it is handled like all the other tables and doesn't require duplicating most
of the table.

Change-Id: I8de383caece0367bc7466d7a1b145aa820c3bd6a
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-16 11:23:20 +00:00
Allan Sandfeld Jensen
528279febe Optimize non-native bilinear transforms
Reading directly from an array instead of calling a function pointer
is much faster.

Change-Id: I833b33448bad064d6f38d2f9ff44138d90206822
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-16 09:32:31 +00:00
Allan Sandfeld Jensen
95f694682e Implement radial and conical gradients for rgb64 rendering
Adds the last two missing source types to rgb64 rendering.
Conical and radial gradients. At the same time linear
gradients are moved to a template form to increase code
sharing.

Change-Id: I30fdd0837b0da03e3447683856ebbe4d7f48df6c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-15 19:34:04 +00:00
Liang Qi
f98d125b29 Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5 2015-04-15 15:53:16 +00:00
Allan Sandfeld Jensen
7432c7c08a Cleanup and optimization of qimage smoothscale
Cleaning up smoothscale code. Upscaling is improved using existing
optimized interpolation methods, and downscale is given SSE4.1
optimized versions.

Change-Id: I7cdc256c26850948aef7dae26fda1622be6b8179
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-15 11:25:41 +00:00
Konstantin Ritt
ba5af03a5a [QTextCursor] Better use of the cached whiteSpace attribute
In compare to QTextEngine::atSpace(), this also handles the less-common
"white spaces" and the exceptional control codes.

Change-Id: I52878932926b7f9fe36c9dd01007963b9691fbf0
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-15 11:07:44 +00:00
Konstantin Ritt
c586f958b3 Fix trivial copy-paste typo in QTextBlock::previous() docu
Change-Id: Ia5d260af00aecf40400653e41248b5dd5f074b74
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-15 11:07:01 +00:00
Liang Qi
605617b5dc Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I004854a25ebbf12b1fda88900162fe7878716c58
2015-04-15 09:09:24 +02:00
Laszlo Agocs
472216da2d Defer Q(OpenGL|Raster)Window updates when non-exposed
This is similar to how widgets work. On platforms like OS X this
becomes essential since in non-exposed state SwapBuffers does not block
so continuing to update continuously leads to undesirable effects.

Task-number: QTBUG-45524
Change-Id: I80f4c00b218561b9e62c3cad1e66f61f4debd4af
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-04-14 15:50:43 +00:00
Allan Sandfeld Jensen
ac659cd203 Extend high color rendering to image rendering
A previous commit added 16-bit per color-channel precision to
solids and linear gradients. This patch extends that to include
texture data.

To support that pixellayouts now have a method to convert to
RGBA64.

Change-Id: I661ae91bd7038085787003608a0af4add057e478
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-14 09:37:47 +00:00
Allan Sandfeld Jensen
5c7d2d1d67 Add support for more composition modes in rgb64 rendering
Change-Id: I3bacecbabdf2d7b2de1acd86ab9383e69924a390
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-13 19:14:52 +00:00
Allan Sandfeld Jensen
29380121ef Fix RGB30 painting tests
Some tests were failing because the color was not read correctly from
a QImage. To make it possibly to read more accurate colors a pixel
accessor returing QColor has been added.

Some tests also had the wrong order of arguments, confusing dest and src
formats. This has been corrected, so they test what they claim to test.

A test for RGB30 linear gradients is also added.

Change-Id: Ic623ae1b8e0bf7383056b641c6e8230a1d7dd0dd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-13 13:01:45 +00:00
Alessandro Portale
6c6fe766a8 Improve QTextDocument::toPlainText doc related to inline images
"Embedded objects, such as images, are represented by a
Unicode value U+FFFC (OBJECT REPLACEMENT CHARACTER)."

Also updated the QTextImageFormat docs with the same wording.

Task-number: QTBUG-44538
Change-Id: I64dd5f5be4a0ecc64b30758a72f8b4281c17924b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-04-10 15:37:06 +00:00
Eike Hein
417a221072 Expose ItemViewActivateItemOnSingleClick in QStyleHints
This completes support for ItemViewActivateItemOnSingleClick in
QPlatformIntegration and exposes the setting in QStyleHints.

Based on the review process, the public name used is
'singleClickActivation' for brevity, as well as to avoid con-
fusion over alluding to "item views" in the Qt Quick context.

KDE Plasma intends to use this via Qt.styleHints to have
Qt Quick-based UI correctly implement the global single vs.
double click user preference for item activation.

[ChangeLog][QtGui] Added QStyleHints::singleClickActivation
to access whether the platform expects item activation to
occur on single clicks rather than double clicks.

Change-Id: I0916e9e68c3a157f95053da8227b2612803653f7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-10 12:27:38 +00:00
Andy Shaw
34ec0713bb Add a means to set the application icon where supported
On OS X the application icon can be changed at runtime, so this adds a way
to set this via the QPlatformIntegration.

[ChangeLog][OS X] QApplication::setWindowIcon now changes the icon for the
application in the dock.

Task-number: QTBUG-43999
Change-Id: Ice298c0bd52f10f4866f37c6d3f20cf5419b7a1b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2015-04-10 10:10:25 +00:00
Friedemann Kleint
b59521f2a4 Add FIXME comments to make Q[]Validator::setRange() non-virtual.
There is no apparent reason why these functions should be virtual.
The virtual keyword originates from the CVS import.

Change-Id: I4f8051cd4e89ca3037a78d12f17c93265c755b8e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-04-10 09:41:21 +00:00
Allan Sandfeld Jensen
60e8519544 Solid and gradients in high color accuracy
This patch updates the internal color precisions of solids and
gradients to 16bit per color. This makes it possible to render
at higher precision on non-premultiplied ARGB32, the RGB30
formats and any other hi-color formats if more are added.

[ChangeLog][QtGui][Painting] Internal precision of solids and gradients
is now up to 16bit per color.

Change-Id: Ieae5468bd6de1f56adfa4cb9fa966faf2ed824fd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-10 09:15:59 +00:00
Lars Knoll
c52bcf7337 Support gradients natively in the PDF generator
Add native support for linear and radial gradients to our
PDF generator. This fixes a couple of issues with both the
quality of the generated PDFs as well as sizes of the files.

Task-number: QTBUG-42758
Change-Id: Ib905457e11e4dc52443c76b3761bca8d1fbe9bfc
Reviewed-by: Stephen Chu <stephen@ju-ju.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-04-09 12:22:13 +00:00
Liang Qi
4973786f0d Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I04f9f2749f68c0cb5a427b8d84e43b44bb143e4d
2015-04-08 21:24:26 +02:00
Laszlo Agocs
cd61b6c969 Add a cast to glTexImage2D to keep QNX happy
The internalformat parameter seems to be GLenum (unsigned int) on QNX
based on the error message in the linked bug report. The standard is
GLint, though. To keep everyone happy, add a cast.

Task-number: QTBUG-45346
Change-Id: I57fece7b381e0d02acc842a21b1edc5451ea0224
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2015-04-08 16:26:20 +00:00
Allan Sandfeld Jensen
e63752e6bb Remove table of mostly null pointers
The patch moves the initialization of the format to format blend tables
to runtime, so we only have to explicitly set the values that are
not null. This removes most of the lines in qblendfunctions.cpp.

Change-Id: Ie017f380ff11cfb764a631cfea7626786731b5fb
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-08 15:27:53 +00:00
Konstantin Ritt
5b5d25cc41 [QtFontFamily] Get rid of unused member
Change-Id: I8c70995767bfb5fdbd6e9e9464029beeccf41f53
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-08 15:17:47 +00:00
Friedemann Kleint
a21a24ee48 [QFontEngineFT::loadGlyph] Fix reversed condition.
Introduced by 237cb0d082
(Consolidate paths for fetchMetricsOnly cases).

Task-number: QTBUG-45444
Change-Id: Icd642c09490f1cfc5804313d60d467290ae599ba
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-04-08 12:10:12 +00:00
Laszlo Agocs
a715c6ceb8 Use the default fbo in Qt sense in blitFramebuffer
QOpenGLFramebufferObject::blitFramebuffer() passes 0 when no FBO is specified.
This goes against the rest of the framework where the default fbo is what
QOpenGLContext::defaultFramebufferObject() returns. This becomes significant
with QOpenGLWidget and on iOS.

Task-number: QTBUG-45328
Change-Id: Iaeb82cd3786ad395116679c9626bdcb10e93b4e3
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-08 05:58:27 +00:00
Konstantin Ritt
237cb0d082 [QFontEngineFT::loadGlyph] Consolidate paths for fetchMetricsOnly cases
Use GlyphInfo as a temporary buffer for storing the glyph metrics
and go through the same code for fetchMetricsOnly and !fetchMetricsOnly.

Change-Id: If8bb85056e5f09588cc3956b43dc51a54d5aecfe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:09:27 +00:00
Konstantin Ritt
550fb85b65 [QFontEngineFT] Move code around to improve readability (no-op)
Move some variables initialization closer to the usage context.

Change-Id: I0f1de0ddc9f0fbe3ec4a56455ccc14f9e8d94e5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:09:00 +00:00
Konstantin Ritt
037ad03182 [QFontEngineFT] Avoid double-negation of info.x
Make it consistent with fetchMetricsOnly path.

Change-Id: I6a2d2568d5579255582217515a4e598722547c60
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:08:02 +00:00
Konstantin Ritt
95d034a14f Introduce QQuaternion::fromDirection()
...which constructs a quaternion using specified forward and upward
directions, so that the resulting Z axis "faces" a given forward direction.

Change-Id: Ib77b8ab5c359a4880b0d946face87026acdc6f0b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Michael Krasnyk <michael.krasnyk@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:07:48 +00:00
Konstantin Ritt
3fb6014ce7 [QFontEngineFT] Guarantee correct metrics for alphamap and its bounding box
...for both cached and non-cached modes, by disabling hinting
for transformed glyphs in loadGlyphFor().

Change-Id: I13766a653ebd72cbed0f5c38ca3536d042aed762
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:07:40 +00:00
Konstantin Ritt
134c6db858 [QFontEngineFT] Consolidate .*lpha.*MapForGlyph() behavior
...and decrease code duplication.

Change-Id: I5eb3c0694dde9030405a3bd3d410ff9784ed7717
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:06:55 +00:00
Liang Qi
20cac3d9c9 Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: If9fd98525b6b4ca07e5e006fc98bf372a73b8a21
2015-04-06 19:10:25 +02:00
Sérgio Martins
20c651d8b8 Fix QNX and Blackberry -qtnamespace build
Task-number: QTBUG-43569
Change-Id: I81a560d1508de4d808a807f1febdc17619cf4dda
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2015-04-01 10:24:24 +00:00
Liang Qi
0e6ee136c9 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/testlib/qtestblacklist.cpp
	src/widgets/accessible/qaccessiblewidgets.cpp

Change-Id: If032adb9296428f62384ed835dbf41ee7a0b886c
2015-04-01 09:10:26 +02:00
Alexander Volkov
7baaec17ed Fix use of the window geometry specification
Until now we applied the geometry in QWidget::setVisible() by
calling QWidget::move() and QWidget::resize(). But these
methods are unreliable when the window is created but not
visible yet. For example, specifying the window position by
"-geometry +0+0" will take no effect.

Apply the geometry directly to QWindow in QWindow::setVisible().
QWidget will update its geometry after the response of the window
system. Besides it allows to specify the geometry for QML
applications.

Task-number: QTBUG-44713
Change-Id: I9a0e110e81e569c81da802729707fec104fef887
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-27 08:00:01 +00:00
Allan Sandfeld Jensen
c51240ca75 Optimize fetching pixel values for SSE2 bilinear sampling
Most of the CPU time was spending in fetching pixel values instead of
calculating the bilinear sample. The access to vectors unions turns
out to be very slow, and should be avoided. This patch removes the
uses of vector,int array union in the bilinear sampling for SSE2.

Change-Id: Ie765a80963c4899db59a583ea9a59d15e05f2b13
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-04 15:42:22 +00:00
Laszlo Agocs
2266f51922 Fix incorrect FBO bindings with QOpenGLWidget
QOpenGLContext::defaultFramebufferObject() knows nothing about QOpenGLWidget
and QQuickWidget. The problem is that this function (and others that rely on it)
is expected to give the widget's backing FBO in paintGL() and friends.

To overcome this, we have to provide a way for such widgets that indicate what is
the expected "default fbo".

Task-number: QTBUG-43269
Change-Id: I43f439f8609382b9f7004707ab0ef9f091952b4f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-30 20:48:07 +00:00
Friedemann Kleint
a68b03d6a9 Fix qdoc warning in qopengltexture.cpp.
qtbase/src/gui/opengl/qopengltexture.cpp:3652: warning: Cannot find 'ComparisonFunction' specified with '\enum' in any header file

Change-Id: I92e808310f2d775cda30c1f1b6aaf0ed739b02f1
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-03-30 13:06:35 +00:00
Friedemann Kleint
3203ac3f4e Use QDebugStateSaver to restore space setting in stream operators.
Returning dbg.space() breaks formatting on streams that already
have nospace() set.

Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e
Reviewed-by: David Faure <david.faure@kdab.com>
2015-03-30 12:59:58 +00:00
Andrew Knight
d1ee1c52d1 Fix "'QCss::Property' is not a class or namespace"
As reported by GCC 4.9.2 x86_64-linux-gnu. The error message is correct;
QCss::Property is the name of an enum.

Change-Id: I9fb29d39ac11a644b7b08227f102594b3f3017f0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Debao Zhang <hello@debao.me>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2015-03-30 06:12:59 +00:00
Konstantin Ritt
dec451cf67 Update Unicode data up to v7.0
* Two newly adopted currency symbols:
  the Azerbaijan manat and the Russia ruble
* Pictographic symbols (including many emoji), geometric symbols,
  arrows, and ornaments originating from the Wingdings and Webdings sets
* Twenty-three new lesser-used and historic scripts
  extending support for written languages of North America, China, India,
  other Asian countries, and Africa
* Letters used in Teuthonista and other transcriptional systems,
  and a new notational set, Duployan

For more details, see http://www.unicode.org/versions/Unicode7.0.0/

The Properties struct's .*Diff members were narrowed down
to signed 15 bits and the unicodeVersion has been expanded to 8 bits.

[ChangeLog][QtCore] Unicode data updated to v.7.0

Change-Id: I93ab6f79fa3b05f61abc7279f1d046834c1c1a0b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-27 16:40:06 +00:00
Laszlo Agocs
52781f2a7d Make versioned OpenGL functions working with the subclass pattern
QOpenGLFunctions allows both deriving from it and getting an instance
via QOpenGLContext::functions().

Unsurprisingly a large number of users attempt to use the versioned
function wrappers in the same way. Unfortunately this approach was
not that well supported.

Besides some potential base class exporting issues the real blocker for
QOpenGLWidget - or any versionfunction subclass whose associated context
changes during its lifetime - is that the functions instances could
only be initialized once. Unlike instances retrieved via
QOpenGLContext::versionFunctions(), instances created "manually" were not
deinitialized upon the destruction of the associated context because
context did not know about them.

A pattern like

  initializeOpenGLFunctions();
  delete context;
  create new context and make it current
  initializeOpenGLFunctions();

is working fine in QOpenGLFunctions-derived classes but not with the
versioned ones.

To overcome this, start registering such instances to the context too.
QOpenGLContext::destroy() can then reset the internal state so a
subsequent initializeOpenGLFunctions() will reinitialize properly instead
of bailing out mistakenly thinking that everything is ready to use.

Task-number: QTBUG-45199
Change-Id: Ia1420bcccb33c51508698b7a1b036c7544a66e74
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-03-27 16:36:34 +00:00
David Faure
211c6f3dc7 QJpegHandler: fix race condition
rgb888ToRgb32ConverterPtr was a static variable, written by one thread
and read by others.
Detected by helgrind, in an app doing image loading in QRunnables.

Change-Id: I06813050b75182cffe26338a3af98eb7d2636abc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-26 22:44:16 +00:00
Konstantin Ritt
cd1cdd1516 Fix soft-hyphen appearance at line-break
Replace it with '-' and set dontPrint to true;
later we unset the dontPrint flag if soft-hyphen appears at the
end of a line after line breaking.

Task-number: QTBUG-44234
Change-Id: I05b69bcbbe07e1ee8a5d35d24372356ce8ab9db8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-03-26 20:00:45 +00:00
Konstantin Ritt
cfe3ac9c65 Set dontPrint flag for the respective glyph
The str_pos variable hasn't been incremented prior to string[str_pos].
Ouch!

Change-Id: I54a160c26e23821037bf6ee8aea3e0a94a5e71f9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-03-26 20:00:41 +00:00
Konstantin Ritt
a8e3245b50 Better detection of Symbol fonts
> Symbol character sets have a special meaning.
> If the symbol bit (31) is set, and the font file contains a 'cmap'
> subtable for platform of 3 and encoding ID of 1,
> then all of the characters in the Unicode range 0xF000 - 0xF0FF
> (inclusive) will be used to enumerate the symbol character set.

If we detected the font has a symbol character set, report no other
writing systems support.

Change-Id: I1030f3339c166ffd03c7caee1b1b26010dfdc314
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-03-26 20:00:38 +00:00
Konstantin Ritt
951e8a52ae Detect Thai writing system support from the font's Code Page Bitfields
https://msdn.microsoft.com/en-us/library/windows/desktop/dd317754(v=vs.85).aspx

Change-Id: I893746210dc71b9de6f6c064fd9fcaf6340e3c71
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-03-26 20:00:35 +00:00
Friedemann Kleint
85f9478227 Fix debug stream operators.
- Use QDebugStateSaver to restore space setting in stream operators
  instead of returning dbg.space() which breaks formatting on streams
  that already have nospace() set.
- Fix some single character string constants.

Change-Id: I0fe86bb1adbdd4a76ab6d2f8c19e063b45ddcf3b
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-04-01 13:49:32 +00:00
Debao Zhang
b798b53db7 Don't remove mnemonics and parentheses under non-Mac system.
SHA: 8e3aacf61b is a mac only patch, but
some code introduced by which is not wrapped with Q_OS_MAC. So add
the missing Q_OS_MAC here.

Change-Id: I748d46b977740e6116dab5659ad1e47d23262a0f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-26 06:10:05 +00:00
Laszlo Agocs
0764407040 Avoid crashing in the vao when not supported
The stored context pointer has to be reset to null in
destroy() even when no VAO was created (vao is null).

Otherwise destroying the context that was stored in the VAO
will not lead to resetting the stored pointer, and a subsequent
destruction of the VAO object will try to dereference it.

Task-number: QTBUG-44562
Change-Id: I438bb3954d4bbd8b8d8704f6087479804f0073a7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-03-25 13:10:49 +00:00
Andy Shaw
2e4a107e7e Ensure that CSS rules are inherited from the parent tags
When CSS is set in a head tag then it was not being inherited by the child
tags when the CSS specification indicates that the properties are in fact
inherited. This ensures that those properties are inherited and the non
inheritable ones are unchanged.

A test is added to cover the different situations with inheritance and a
fix is done for the QTextDocumentFragment test which was passing despite
having incorrect defaults.

Task-number: QTBUG-28770
Task-number: QTBUG-34153
Change-Id: I55966240845a885852a04ecb82c61926dea9f800
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-03-25 11:55:47 +00:00
Alexander Volkov
738c07542a Don't replay mouse press event which closes a popup on X11
Add a new style hint to QPlatformIntegration: ReplayMousePressOutsidePopup.
Return false for it in the xcb plugin.

This commit restores the behavior which was in Qt 4.

Task-number: QTBUG-34814
Change-Id: I19fee762395a51475cc67b52b368c70679ca736b
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-25 11:33:45 +00:00
Liang Qi
26a9783d55 Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5 2015-04-01 11:27:03 +00:00
Friedemann Kleint
7c2360b762 Split out some inline qdebug formatting helpers to qdebug_p.h.
Extract helpers to be able to format classes without type names
and use those for formatting QEvents to reduce clutter.

For example:

QWidgetWindow/"MainWindowClassWindow" QMouseEvent(QEvent::Type(MouseMove), buttons=QFlags<Qt::MouseButtons>(LeftButton), localPos=QPointF(50,116), screenPos=QPointF(948,652))
QWidget/"qt_scrollarea_viewport" QMouseEvent(QEvent::Type(MouseMove), buttons=QFlags<Qt::MouseButtons>(LeftButton), localPos=QPointF(45,32), screenPos=QPointF(948,652))

becomes

QWidgetWindow/"MainWindowClassWindow" QMouseEvent(MouseMove, LeftButton, localPos=50,116, screenPos=948,652)
QWidget/"qt_scrollarea_viewport" QMouseEvent(MouseMove, LeftButton, localPos=45,32, screenPos=948,652)

Change-Id: Ie5441d922962a05caed6b7079a74ea8a2b8a64fb
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-04-01 04:26:50 +00:00
Liang Qi
ce9519593a Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	mkspecs/android-g++/qmake.conf
	qmake/generators/unix/unixmake2.cpp
	src/gui/image/qimage_conversions.cpp

Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
2015-03-31 10:03:31 +02:00
Friedemann Kleint
c6ff750686 Improve debug formatting of key and mouse events.
Use the debug operator for enums and flags to format keys and
modifiers.

Change-Id: Id748e4b2202797efcbf3a616d111399929ada8b1
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-25 10:31:16 +00:00
Liang Qi
135ebe4f3d Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: If5d2e621c2fa5476c3ab687a3f4620c54fc3b32e
2015-03-24 07:38:02 +01:00
Laszlo Agocs
cafd54d34b Use glFinish() in QOpenGLWidget unless glFlush() is known to be enough
The driver used on the Odroid-XU3 does not like doing just glFlush()
before accessing the texture in another context. There is no guarantee
that glFlush() is enough to sync access to resources between contexts, so
start using glFinish() as the default, except on common desktop hw + iOS
where flush is enough and presumably more efficient.

To unify the code pathes, remove the separate flushes and do it only
once, before the backingstore compositor indicates that it is about to
access the textures. This should improve performance a bit, esp. when
doing multisampling since we flush only once then.

A helper function is added to the internal QOpenGLExtensions because
it is highly likely that QQuickWidget will need the same.

Task-number: QTBUG-45106
Change-Id: Ifb405c5723f29f2f6c04df8e15fb70280681755e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-03-23 09:26:42 +00:00
Laszlo Agocs
975260503a Add a note about not requesting a profile
As per spec not requesting a profile on 3.2+ is same as requesting
core since the profile mask defaults to core.

Change-Id: I5d03ac08bcba20c273c1c32a51f6a105eba0629f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-03-20 14:06:28 +00:00