Commit Graph

26750 Commits

Author SHA1 Message Date
Thiago Macieira
043f5d3eb5 QNetworkInterface: fix handling of interfaces with no addresses
Certain Linux interfaces have no addresses at all (hardware or IP), like
the nlmon interfaces. They weren't being reported.

Change-Id: I8de47ed6c7be4847b99bffff141c2b60c2089ad3
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-01-21 05:19:08 +00:00
Jani Heikkinen
7b2fb038ae Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6 2016-01-21 04:27:06 +00:00
Thiago Macieira
26ece94a68 Move QIpPacketHeader to the header where QNetworkDatagramPrivate will be
Change-Id: I14839ba5678944c2864bffff1417a1d4b790f9c3
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-01-21 01:06:18 +00:00
Marc Mutz
198768cbba QWidget: fix expensive iteration over QMap::keys()
... with iteration over the hash itself.

Can't keep the call to ungrabGesture() in the loop,
because it removes the current element from the very
hash being iterated over. Instead, inline the call
and optimize based on the context:

- don't remove element by element, but clear the
  hash completely at the end.
- drag the check for QGestureManager::instance()
  out of the loop.
- drop the check for presence of the key in the
  hash, since it would be always true.

Change-Id: I6bf7cc8a59a51ccc8046a5b6d1cab5784e79fd55
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-01-20 21:17:53 +00:00
Edward Welbourne
9c0de96454 Make some initializers be declarations.
This shortens an earlier over-long line of declarations and makes
visible that these are declare-and-initialize.

Change-Id: I39fa9613196c34f7e2b2da04da729324d7f83a55
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-01-20 17:13:04 +00:00
Edward Welbourne
57e024cc81 Avoid shadowing a name (and use the outer variable an extra time)
QDateTimeParser::parseFormat()'s top-level scope has a const int max;
this was shadowed by a short-lived max in an inner scope; and the
outer scope's max could be re-used one more time after that to save
re-evaluating the same unchanged expression it held.

Change-Id: I9f07452bb0b4e5ff4bcf6396d42d1419de6276fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-01-20 17:12:58 +00:00
Edward Welbourne
aa196457da Avoid dereferencing before the start of a string.
A check for a backslash before a quote neglected to pretest that the
quote wasn't the first character in its string.

Change-Id: Ib5226836d1111e37bed984938f7c667be59eb1c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 17:12:48 +00:00
Edward Welbourne
d8c0bd4207 Make it clearer what's happening with a fall-through.
An if () {...}'s close-brace was hiding on the end of a break; line,
an idiom used in several places for braces that existed to contain a
case (for the sake of local declarations).  This made it hard to see
that there was an if() whose else was the resulting (commented)
fall-through.  So put that close-brace on the comment's line and make
the comment clearly indicate it's an else.

Change-Id: Ie7e7c7063bef96536d6231297b083fc384f2363e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 17:12:36 +00:00
Edward Welbourne
1967accb64 Expand springForward_data() to cover a few more time-zones.
The important one is EET, for the benefit of our CI system; but other
European zones and the USA's coastal zones likely have enough hackers
in them to make this worth checking.

Change-Id: Idcc703bce29808e1a0a6279680cc8d3cbed38dac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 17:11:58 +00:00
Edward Welbourne
f7d9e34b96 Be fussier about setting tst_QDateTime's globals.
Time zones change on the whim of politicians.  Consequently, we can
seem to be in CET/CEST or on UTC (because we tested sample dates when
our zone coincided) when we aren't (i.e. we're in a materially
different zone at the time probed by some particular test).  Make the
initialization of the globals that test this more robust against
governmental meddling and document the unfixable problem with Algeria:
a DST transition *on the epoch*.

Change-Id: I17c5c81d339b80af12f4ffab367e28052dd6c2fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 17:11:49 +00:00
Edward Welbourne
722df6e0a2 Nomenclature corrections relating to CET.
There are several European time zones; the only one relevant to the
tests here is CET.  They won't work with WET, GMT or EET.  So name
them and related variables for CET, not for Europe.

CET's summer-time isn't called CST; and the (existing) spring forward
test works only in CET/CEST, not elsewhere in Europe.

Change-Id: I55c7544bf792de7495700b749b935ec534831d8b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 17:11:33 +00:00
Friedemann Kleint
191858abe8 QMainWindowLayout::unplug(): Prevent unplugging when the widget is not a window.
Task-number: QTBUG-50490
Change-Id: Icf02e2316bbad0794bd5ac6dccd857bfb28a498b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-20 13:25:57 +00:00
Kevin Funk
8dad3bf212 Fix toDisplayString(QUrl::PreferLocalFile) on Win
When using QUrl::PreferLocalFile we do want to strip the leading slash,
as toLocalFile() would do as well.

Behavior change by means of an example:
  QUrl url(QUrl::fromLocalFile("C:/file.txt")
  url.toLocalFile() --> "C:/file.txt"

Before:
  url.toDisplayString(QUrl::PreferLocalFile) --> "/C:/file.txt"

After:
  url.toDisplayString(QUrl::PreferLocalFile) --> "C:/file.txt"

Task-number: QTBUG-41729
Change-Id: I7d425541f6077ebcf3fcf46feeb7e0f03a0d7fe2
Reviewed-by: Dominik Haumann <dhaumann@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 13:24:53 +00:00
Robert Loehning
49a61f35f3 Add manual test for shortcut using implicit shift
In German layout, "Ctrl+/" is "Ctrl+Shift+7".

Change-Id: I50f3d77c4c76e7eb7cffe31283a3b73074324fea
Task-number: QTBUG-47122
Task-number: QTBUG-50360
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-01-20 12:50:11 +00:00
Eskil Abrahamsen Blomfeldt
4de1d0cb28 Android: Fix some QGraphicsScene tests
1. Use qrc for test data so that it can be found on all platforms.

2. Skip a test which does not work on platforms where show() implies
showMaximized(), as it depends on the window size being 150x150.

3. Skip test for hover event which depends on having a valid
mouse cursor position.

4. Skip a couple of tests that fail on some Android devices.
It's not worth spending a lot of time investigating this at the
moment.

Change-Id: Icb2b7f1d82981546a2154a76535b95606d7f40da
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-01-20 07:48:34 +00:00
Marc Mutz
a63a506d54 QSslContext: provide sharedFromConfiguration()
It's a version of fromConfiguration() that returns the QSslContext
instance in a shared instead of a naked pointer.

Use it in QSslSocketBackend.

The idea here, of course, is to use QSharedPointer<T>::create(),
which co-locates the refcount with the payload in a single memory
allocation, instead of QSharedPointer<T>(new T), which causes
two allocations.

Change-Id: Ia5396fb3b291f2912fca5cd97e0aa1e45e065e55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-20 07:44:08 +00:00
Thiago Macieira
d6bb01e177 Force inclusion of <atomic> on QNX systems.
It's documented to exist in QNX 6.6, which is the minimum required
version for Qt 5.7 anyway.

http://www.qnx.com/developers/docs/660/index.jsp?topic=/com.qnx.doc.dinkum/topic/cpp11/index.html

Change-Id: I7e6338336dd6468ead24ffff141133a2d524f148
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-19 23:41:55 +00:00
Thiago Macieira
7ffcafd1b5 Remove all the atomic code besides MSVC and std::atomic
[ChangeLog][Important Behavior Changes] Starting with Qt 5.7, Qt
requires a C++11 compiler with support for C++11 atomics. This affects
user code too: Qt headers no longer compile with a C++98 compiler. The
minimum compiler versions for this release are:
 * Clang 3.4 (found in XCode 5.1)
 * GCC 4.7
 * Microsoft Visual Studio 2012

Change-Id: Ib056b47dde3341ef9a52ffff13ef1f496ea9363f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
2016-01-19 23:41:52 +00:00
Marc Mutz
57671bebbc QGraphicsAnchorLayout: remove a misguided use of QLinkedList
QSimplexConstraints are held in QList everywhere, yet one
single function, getGraphParts(), used a temporary
QLinkedList. It did so because the function repeatedly
walks the list, erasing elements from it until no more
elements have been removed.

Thus, in O-terms, QLinkedList is the correct choice here.
Sadly, O-notation completely ignores the per-element cost,
and this is where QLinkedList suffers. By the time a QList
has shifted all of its elements left once, the QLinkedList
probably has just finished allocating its first node.

So, use a QList instead.

That, however, turns the it = erase(it) loop quadratic, so
re-formulate the processing part as a lambda and use
std::remove_if. Don't even erase until we know how many
items to erase.

As a benefit, we save the final conversion of the remaining
items back to a QList, and we can use QList::op+ to build
the initial list, reducing the number of allocations
performed by that container to one.

Also saves ~770b in text size on optimized GCC 5.3 Linux
AMD64 builds.

Change-Id: Iecf9e7961dd2b6b20039b9b0d472e32b3fae6994
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-19 21:38:24 +00:00
Marc Mutz
7a17340636 QSslContext: separate creation and initialization
This is in preparation of providing a named constructor that returns
a shared instead of a naked pointer.

Change-Id: I23aed950facac9d0b053321e75b61df7df8a6605
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-19 21:38:19 +00:00
Timur Pocheptsov
b530ca770f tst_qtextcocumentlayout::blockVisibility - make the test more robust
The test inserts strings "0" ... "9" into the text document,
takes the half of resulting document's size, makes half of
lines invisible and compares sizes. On OS X 10.11 after inserting
"4" the width changes, so making "4" invisible also reduces the width
and QCOMPARE(currentSize, previosHalfSize) fails. Instead of digits,
insert the same string "A" 10 times.

Change-Id: Ie88a0442703f98949cea9bcdb694cecee59695f3
Task-number: QTBUG-49848
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-01-19 14:48:47 +00:00
Stephen Kelly
71be92c1d0 CMake: Pass -std=gnu++0x to generated tests in CI.
Add -stdlib=libc++ when using AppleClang.  If CMP0025 is OLD,
the compiler id is 'Clang' for backward compatibility.  So, if on a
CI machine running 'Clang', and on APPLE, use the -stdlib=libc++ flag
too.

Change-Id: I4910000ce08bae1201f7fa0e0eb46622bedd5c4f
Reviewed-by: Kevin Funk <kfunk@kde.org>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-19 14:40:04 +00:00
Topi Reinio
3d82b74c3a Doc: Fix return type of QWeakPointer assignment operators
Imprementation of QWeakPointer assign operators have return types
that are references. However, in qsharedpointer.h where separate
declarations are held for documentation purposes, the reference
qualifiers were missing. This led to incorrect documentation being
generated.

Task-number: QTBUG-49862
Change-Id: I32727762826feb15a3f4f22446e51d2df16e605f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-01-19 14:14:57 +00:00
Liang Qi
8f569c740a Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
	config.tests/common/atomic64/atomic64.cpp
	configure
	src/3rdparty/forkfd/forkfd.c
	src/corelib/io/forkfd_qt.cpp
	src/widgets/kernel/qwidgetwindow.cpp
	tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
	tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
	tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
	tools/configure/configureapp.cpp

Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
2016-01-19 10:03:01 +01:00
Eskil Abrahamsen Blomfeldt
b9bd83c9c2 Fix transformed text with DirectWrite engine
This is a port of f54c5d9133d7aa7636988db36fa6cc51d26434b6
from Qt 4.8 which was lost in the transition to Qt 5. It makes sure
we use the correct bounding box for the transformed glyph by
getting from DirectWrite itself.

[ChangeLog][Windows] Fixed transformed text when using the
DirectWrite font engine.

Task-number: QTBUG-50009
Change-Id: I416ab64253165b878af6b9837348134fede8092e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-19 08:29:55 +00:00
Tobias Koenig
c5f7d15765 Replace ffsll with new qCountTrailingZeroBits
Change-Id: I44898909181e25247bf96cf4462971ac23c2a3ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-19 08:25:02 +00:00
Tor Arne Vestbø
30bff91c39 OS X: Ensure system tray icon is prepared even when menu bar is hidden
On OS X 10.11 (El Capitan) the system menu bar can be automatically
hidden, in which case the menu bar height is reported to be 0 when
using the menuBarHeight API.

This resulted in failing to prepare an image for the system tray
icon item, making the tray item "invisible".

Instead we now use the [[NSStatusBar systemStatusBar] thickness]
API, which returns the correct height regardless of the menu bar
being hidden or not.

Task-number: QTBUG-48960
Change-Id: I208fb8df13754964a6f254cadfbff06dd56c6bab
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2016-01-19 07:22:35 +00:00
Błażej Szczygieł
465e93aa95 QtWidgets: Improve native and top-level OpenGL widget performance
Since 7c6625b105 native OpenGL widgets
are able to render, but performance is very low.  It also slows down
rendering for top-level OpenGL widgets.

Render-to-texture widgets prevent triggering unnecessary backingstore
painting when only the OpenGL content changes.
This patch makes possible to use that feature for native and top-level
widgets by calling "markDirtyOnScreen()" function only when necessary.

This patch also prevents native and top-level OpenGL widgets from
flickering during resizing.

Task-number: QTBUG-50381
Task-number: QTBUG-49620
Change-Id: I0c16ea644fb869a00772fd74e1709611e627bff3
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-18 18:30:23 +00:00
Tobias Koenig
a87dfdb196 WinCE: Build accessibility support on WinCE7
Build the QPlatformAccessibility support on WinCE7, so
that QtQuickControls, which depend on the availability of
QPlatformAccessibility, can be used on WinCE7 as well.

Change-Id: Ice7370b891a2963483bbfe1af8b219717541e64b
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-01-18 16:41:15 +00:00
Joerg Bornemann
c60e06e087 Support precompiled header files without file extension in VS projects
Having a precompiled header file without file extension (or without
common file extension) led to an incorrectly generated Visual
Studio project file. The custom build step for automatically
generating the corresponding source file was missing.
  Remove the file extension check that apparently was yet another
feeble attempt of runtime optimization.

Task-number: QTBUG-50442
Change-Id: I0552f94be12cbb70e2f32c242c7364699979bd81
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-01-18 16:06:46 +00:00
Alexander Volkov
9eba208445 Center QPrintPropertiesDialog on top of its parent
Remove QPrintPropertiesDialog::showEvent(). It just accepts
QShowEvent, it makes no sense. At the same time this method
overrides QDialog::showEvent(), which centers dialogs.

Change-Id: I11510feb4a946f347c19d6ac59874b4cb931020e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-01-18 15:57:59 +00:00
Błażej Szczygieł
e8ad49d6cb xcb: Fallback to Xlib screen when glXGetCurrentDisplay() returns NULL
Change-Id: Ie25b3fac4c0224f847c77c0515894a9df84077a2
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-18 14:34:58 +00:00
Stephen Kelly
99e25dd7d8 CMake: Don't attempt gui-tests if Qt is built with -no-gui
Change-Id: I5f327fa1b0c7827535a4b00ca7d0d4281b1eec7b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-18 13:00:03 +00:00
Morten Johan Sørvig
f634ce3b9a QFocusFrame: Don't crash on null d->widget.
This can happen with a suitably complex use case
(See QTBUG-50263)

Change-Id: Ie8fa7b5872a902e802fda5795ade3369399ddb54
Task-number: QTBUG-50263
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-01-18 12:33:49 +00:00
Giuseppe D'Angelo
5007352164 QOrderedMutexLocker: use std::less to prevent undefined behavior
operator< between pointers is undefined unless the two pointers
point in the same array, which is not what QOrderedMutexLocker does.

Change-Id: Ia6594900cfa807a73f20e157ce896b4321a3d746
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-18 12:20:47 +00:00
Laszlo Agocs
fd6cf5c875 Avoid checking the fb status in every bind
On some drivers (e.g. NVIDIA, tested on Windows) the
status check is apparently expensive. A simple FBO
test app rendering into the FBO on every frame (and
thus calling bind()) shows a 19-21% CPU usage. With
the patch this gets reduced to 0.8-1%.

The check is fairly useless too - whenever creating
attachments, the status is checked, so d->valid is
up-to-date.

Task-number: QTBUG-50496
Change-Id: Ie9f0db34e5c2bc1a1141c734ca0b318419013c0d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-01-18 11:39:24 +00:00
Frederik Gladhorn
bc81a28554 Passing parameters to convertLineOffset by pointer instead of reference
This is aligned with our coding style and it should have been this way from
the start.

Change-Id: I23a00eb220dd9f17d9239c811b556885a2c0186a
Reviewed-by: Fredrik de Vibe <fredrik.devibe@theqtcompany.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-01-18 11:16:57 +00:00
Alex Trotsenko
294111e25a QHttpSocketEngine: ensure pending EOF triggers a notification
When the remote peer closed the connection, a read notification needs
to always be emitted, otherwise the higher layer does not get the
disconnected signal. From the other side, underlying QAbstractSocket
object could temporarily disable notifications from the engine at
any time. To avoid possible blocking of the socket, take a pending EOF
into account when the read notifications are re-enabled.

Change-Id: Iac9d4e2f790530be3500baf5a2000f1f63df5cc2
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-01-18 11:08:34 +00:00
Tobias Koenig
5243696528 Haiku: Fix compilation of corelib
Change-Id: I8f962ac7ee85af50a573a451f54931d6c0dd67eb
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-18 10:47:01 +00:00
Marc Mutz
ea76ab2b2d QtWidgets: replace uses of inefficient QList<QPair>s with QVectors
These QPairs are larger than a void*, so holding them in QLists
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 holding them in QVector instead.

Change-Id: I3c205f5326cfd96482563078bdca1747d718457f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-18 10:34:24 +00:00
Eirik Aavitsland
bfd367c6ec Mirclient: update with upstream changes
Merge in the changes up to revision 306 of the lp:qtubuntu repo.

Change-Id: I55dcb9e06e0a3503d6abe4b0894d5ef5a785b6bb
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-18 08:33:04 +00:00
Shawn Rutledge
b30ea41945 eglfs: use QGenericUnixTheme if requested
We need to have reasonable paths for loading icons and such things, just
as in any other Unix GUI environment.  However there is some concern that
it would be too much of a behavior change if there was a theme by default,
so for now it's required to set the env var: QT_QPA_PLATFORMTHEME=generic
That works because QGuiApplicationPrivate::createPlatformIntegration() reads
the env variable and passes platformThemeName to init_platform().
Step 3 in init_platform() does not find a theme plugin by that name
(because QGenericUnixTheme is statically linked via libQt5PlatformSupport.a).
Then in step 4 it iterates the given platformThemeName plus any which
were returned from QPlatformIntegration::themeNames() (which in our case
will be an empty list) and calls createPlatformTheme() with each of
those, until something is returned.  So,
QEglFSIntegration::createPlatformTheme() will be called with the
value of the QT_QPA_PLATFORMTHEME env var, and
QGenericUnixTheme::createUnixTheme() will create the generic, KDE or Gnome
theme depending on that value.

Change-Id: Id16b881819ba872830b019ab147b32fbc2156520
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-18 08:32:59 +00:00
Marc Mutz
89f9f7cbdf QFileSystemModel: replace inefficient QList<Fetching> with QVector
The type Fetching is larger than a void*, so holding it in 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 holding it in QVector instead.

Also optimize the append site by liberal use of std::move(). This
code would greatly benefit from emplace_back(), but we can neither
assume it's present in std::vector nor do we require the necessary
C++11 features that would allow us to implement it in QVector, yet
(uniform init and, less so, variadic templates).

Change-Id: I50da0ffd557adff57477245d0e8c1fc1fec1ebc1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-17 13:23:15 +00:00
Marc Mutz
d569f37dfd QGraphicsView: Graph: don't allocate QHashes on the heap
... just so you can observe their absence with QHash::value()
returning nullptr.

Instead, use find() + comparison to end() to detect presence
or absence.

Simplifies quite a bit of code.

Change-Id: Ifd7921bfc8102677ea345ae37d38da31b8105426
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-17 13:23:10 +00:00
Marc Mutz
a0cee9916a QGraphicsView: Graph: remove faulty const_iterator::op=
It failed to copy 'g'.

Fix by letting the compiler generate one.

Change-Id: Ie19fdacb8f27aef821be58c0b727c802d71bfe64
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-17 13:23:06 +00:00
Marc Mutz
1ee43b9b24 QGraphicsView: Graph: don't compare pointers with op<
It's undefined behavior. Use std::less, which has
defined behavior.

Change-Id: I990d197590cf535c1cb5c055d0b6798e602446dc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-17 13:23:01 +00:00
Marc Mutz
f48f8ba0bb QHttpThreadDelegate: use default ctor instead of QSharedPointer(0)
Code like this makes it impossible to provide a templated
QSharedPointer<T>(X*) ctor, so proactively rewrite to use
the proper default ctor, which has the same effect.

Change-Id: I2572e92b12804f873fac4927e93db83f796729f5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-17 13:22:56 +00:00
Laszlo Agocs
1172e18c3c Promote backingstore image format to alpha
Like xcb does since 1bcfc3de75.
For TranslucentBackground (ARGB32_Premultiplied) there is no change
in practice. For RGB32 we will promote to ARGB32_Premultiplied
but everything should behave like before, except that we do not rely
on undefined behavior anymore when QOpenGL/QuickWidget is in use. For
RGB16 this will enable QOpenGL/QuickWidget since there the hole
punching mechanism needs an alpha channel always.

Change-Id: Id04ea548cee245ec91642f1358a5e501b62ff64c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-01-17 01:31:55 +00:00
Swen Kooij
5eec43a44f qdbuscpp2xml: Fixed wrong filename being reported in messages
This caused the filename in messages to be one of the other arguments
that were specified instead of the actual filename.

Caused by the fact that mutations are possibly made to `args` in
`parseCmdLine` and thus the amount of items in `args` does not always
match the amount of items in `argv`.

Change-Id: Ief3716dde39dfdc949a5192e7f83d93cf90130f0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-16 22:11:27 +00:00
BogDan Vatra
9bb24615ad Android: fix native libs dir.
On Andorid 64 bit O.S.s the libs are not located anymore on dataDir/lib/
but they are located on dataDir/lib/<arch>/. Using nativeLibraryDir instead
of dataDir we'll get the right folder.

Change-Id: I40ef9513eb5b51f81032bd41f9943ab7b959ad51
Task-number: QTBUG-50394
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-16 08:52:56 +00:00