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>
... 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
[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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Merge in the changes up to revision 306 of the lp:qtubuntu repo.
Change-Id: I55dcb9e06e0a3503d6abe4b0894d5ef5a785b6bb
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
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>
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>
... 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>
It failed to copy 'g'.
Fix by letting the compiler generate one.
Change-Id: Ie19fdacb8f27aef821be58c0b727c802d71bfe64
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It's undefined behavior. Use std::less, which has
defined behavior.
Change-Id: I990d197590cf535c1cb5c055d0b6798e602446dc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
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>
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>
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>
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>