Commit Graph

19977 Commits

Author SHA1 Message Date
Paul Olav Tvete
d98df9e929 Android: don't recreate surface on shutdown
When we suspend the app, we destroy the surface to save resources.
We don't want to create it again just as we are shutting down.

Task-number: QTBUG-41072
Change-Id: I7a616249bee869b92716d0911201a80d73c2f8da
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-09-05 14:04:27 +02:00
Maks Naumov
9c4c044338 GraphicsView: Fix resolvePalette() for QGraphicsItem's children
Use a proper function for that.

Change-Id: I166ce44b8987d522cb01bae57009b2b862851b92
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-09-05 13:12:21 +02:00
Jeremy Lainé
863f598b65 ssl: make peerVerifyError test agnostic of error order
Currently the peerVerifyError test for QSslSocket makes an assumption
about the order in which SSL errors are emitted by peerVerifyError. This
assumption does not necessarily hold for non-OpenSSL backends.

This change fixes this assumption, and also checks that HostNameMismatch
was found both in the errors emitted by peerVerifyError and by sslErrors.

Change-Id: I856d1ea43b36332db0f178d35fc14a4bb18ad673
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-05 12:20:25 +02:00
Jeremy Lainé
7b1dad8021 ssl: enable non-OpenSSL backends to compile QSslSocket tests
Some of the QSslSocket tests use OpenSSL-specific symbols. This
change fixes this issue.

Change-Id: Ib67efa42a15facaf0ad34fc0466341a37d945d1e
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-05 12:20:02 +02:00
Friedemann Kleint
585cef5f90 Windows styles: Scale hardcoded-values according to DPI.
Factor out functions to return the fixed values and scale those.

Task-number: QTBUG-38993
Task-number: QTBUG-38858
Change-Id: I59c70a206eae76bf08bc2aeb5cda5a740cd3d6dc
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-05 12:14:34 +02:00
Friedemann Kleint
176bd1edfa Windows styles: Add device pixel scaling for system metrics.
Metrics obtained from the system must be scaled down
when device pixel ration scaling is in effect. Factor out
functions to return the device pixel values which might still
be used for drawing.

Task-number: QTBUG-38993
Task-number: QTBUG-38858
Change-Id: I6b90629e4979436bbb46f8c1fa1ee2253ada7ece
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-05 12:14:23 +02:00
Andrew Knight
b858e7af4f windows: Enable ANGLE D3D11 renderer by default
Also, remove the -angle-d3d11 configure option, as it no longer is
necessary to select the renderer at build time.

The D3D11 renderer is the default renderer in upstream ANGLE, and has
been shown to be a more reliable solution for developers running over
remote desktop and inside virtual machines. It also provides more features
to the OpenGL ES implementation.

This configuration switch does not disable the D3D9 render; if the GPU
does not support D3D11, D3D9 is used instead.

[ChangeLog][QtGui][Windows] The ANGLE D3D11 renderer was enabled by
default. Systems which cannot use the new renderer will automatically fall
back to the D3D9 renderer at runtime.

Task-number: QTBUG-41031
Change-Id: If894309c07d9309c236b63c36f37679f74375133
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-09-05 07:39:53 +02:00
David Faure
2eb61feb9b Doc: QRect::isEmpty's documentation didn't match the code.
The code says
bool QRect::isValid() const { return x1 <= x2 && y1 <= y2; }
so the documentation should say <= as well, rather than <.

Change-Id: If52005879d2a758b5d1d64b552e6cd96341fae76
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-05 01:28:32 +02:00
Marc Mutz
e4fb59c0af QCommonStyle: replace a QPolygon with a QPoint[] (IV)
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.

This one is a bit more complicated, as the QPolygon was returned
from a helper function, so I wrapped the array in a minimal
std::array-like StaticPolygonF.

Together, these four QPolygon -> QPoint[] changes result in
ca. 4.5K text size reduction for libQtWidgets.

Change-Id: I082f199d5edb7a7782173fe3748220f373edac8a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-09-04 21:27:56 +02:00
Marc Mutz
8478fc4e59 QCommonStyle: replace a QPolygon with a QPoint[] (III)
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.

Change-Id: Ie1eecd376a52b73572998ba253a032deaa0daaf9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-04 21:27:50 +02:00
Marc Mutz
e192643c2d QCommonStyle: replace a QPolygon with a QPoint[] (II)
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.

Change-Id: Ifdf8224ddffe06ef7848562023e372e2c32b9ad6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-04 21:27:43 +02:00
Marc Mutz
32a0e0cc61 QCommonStyle: replace a QPolygon with a QPoint[] (I)
No need to allocate dynamic memory for a fixed-size point array
when QPainter has a (QPoint*,int) overload.

Change-Id: I50c69103bba47e9f6de4f5616e8f40fee522ddc2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-04 21:27:37 +02:00
Alex Trotsenko
e35841e374 Fix endianness part of QSysInfo::buildAbi() string
Both Q_LITTLE_ENDIAN and Q_BIG_ENDIAN macros are always defined
on all architectures. So, byte order detection results in
"little_endian" value for big endian systems. Test the system
endianness in a right way, according to Q_BYTE_ORDER macro
documentation.

Change-Id: I5523f90567e78d679a3ff2902a8f5377ed39ceb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-04 18:31:50 +02:00
Tor Arne Vestbø
59385ff2ca iOS: Update QIOSScreen::nativeOrientation() for iOS8
For iOS8 and up [UIScreen bounds] changes based on the interface orientation,
so we need to use [UIScreen nativeBounds] instead.

Change-Id: I3fc12cfa417df26ca94c803e970bc2dc18a94378
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-04 18:15:51 +02:00
Louai Al-Khanji
2f0fa59d59 Add KMS hooks for EGLFS plugin
Change-Id: Ic703334e52726cdd815cccf152d9d01aa63c803c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-04 15:23:30 +02:00
Andrew Knight
8f88cc2c0f ANGLE: Fix compilation with MinGW + D3D11
Provide workarounds for things GCC doesn't like, and define a number
of macros not found in the MinGW headers.

Change-Id: I254c208209c0071fae5efb6727f2b3cfd5542da6
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-09-04 15:09:34 +02:00
Frederik Gladhorn
68206db907 Improve accelerator stripping in accessible widgets
When we strip the & we should also report the hotkey.
In addition only strip labels when they are buddys and try not to remove
ampersands from all kinds of random text.

This fixes https://bugs.kde.org/show_bug.cgi?id=338282

Change-Id: I401281cd9ff43b23a3923ad9909ca9c469b59506
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-09-04 14:50:36 +02:00
Frederik Gladhorn
52f859604d Accessibility: Improve line boundary helper functions
These functions are supposed to make it easy for third parties (and
QLineEdit) to implement the textAt/Before/AfterOffset functions.
Before the functions were ignoring newlines completely and thus only somewhat
useful.
Change-Id: I7136b9502a7fa6f8ad9ad7236761a34c1a7fd4da
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-09-04 14:50:32 +02:00
Laszlo Agocs
f4ae4f41b0 hellowindow: Set all the state for each frame
Trying to be smart and minimizing the amount of GL calls per frame
to provide a good example was a mistake (in a way): There are
components, like the eglfs mouse cursor, that change the context state.
To make sure the example work in these cases, set the state upon
each frame.

Change-Id: Ief1fd7bbb0fb1955a64dac97a071b7a3d9d506d4
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-09-04 14:06:42 +02:00
Samuel Nevala
105fa5b5d9 Respect android:windowSoftInputMode in manifest.
Read and store softInputMode set at AndroidManifest.xml on QtActivityDelegate.
When showSoftwareKeyboard is requested setSoftInputMode for main window if
softInputMode is not defined fall back to old behavior.

Change-Id: I71cb27d4bdb4ae4e3c2a0706560173703a2f5a50
Task-number: QTBUG-34401
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-04 14:04:44 +02:00
Friedemann Kleint
b9e3f59551 QMdiSubWindow: Keep event filter on system menu over its lifetime.
QMdiSubWindow::eventFilter() is supposed to close the sub window on a
double click on the menu icon. However, it did not receive the double
click event since it removed itself when the menu was hidden, which
happened before the double click was delivered.

Task-number: QTBUG-25179
Change-Id: I5e7fb02dda26ceab12e8b7554fc604066a0a3136
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-04 08:58:06 +02:00
Laszlo Agocs
0bb2b62135 windows: Fix dynamic opengl build
Cannot call WGL or EGL functions directly anymore.

Change-Id: I0d5c6217679d87a2092c945a9b841dfd7b6c299a
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-03 18:13:51 +02:00
Laszlo Agocs
38ea5428c4 Enable QT_ANGLE_PLATFORM selection in dynamic builds
Change-Id: I8ebe62ec1e024e8a0a0f9e8aeac6fb81b1095e72
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-03 18:13:47 +02:00
Andrew Knight
20ea0cbaba direct2d: Work around ClearType rendering bug in translucent mode
This switches the font rendering to use gray scale antialiasing when in
translucent rendering mode. It does so by adding a flags argument to the
paint engine, allowing for future expansion in communicating render hints
from the device to the engine.

Task-number: QTBUG-41002
Change-Id: I0265154716a12060e851b603a109e9c693f5e843
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-03 17:50:11 +02:00
Jeremy Lainé
bdb30abcd2 ssl: add support for ASN.1 boolean values
This adds support for reading and writing ASN.1 boolean
values. It also adds an operator to test two ASN.1 elements
for equality.

Change-Id: I4a22cbf9808533d593fc59d27b63caaf650b1f57
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-03 17:28:02 +02:00
Andy Nichols
c68ef6d2c0 DirectFB: Add QT_DIRECTFB_BLITTER_DEBUGPAINT environment variable
This environment variable will paint an overlay on each paint command
that is using the accelerated blitter path for DirectFB.  This is useful
when you want to assure that you are taking advantage of the DirectFB
blitter.

Change-Id: I6e374754825794daf9c1bf40bee2b963e752a8e9
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-03 17:07:52 +02:00
Dimitar Asenov
633647334c Speed up the removal of items from a QGraphicsScene
When using a linear index, all items in a scene are stored in a QList.
While adding new items is a constant operation, removal requires a
traversal through the entire list. This is especially problematic
when the scene contains millions of items and many of them are removed,
which requires a linear search for each item, resulting in a very slow
operation. Moreover, this behavior is actually inconsistent with the
current documentation which states for the linear index:
"Adding, moving and removing items, however, is done in constant time."

With this change, the list is sorted once an item needs to be removed.
The item to be removed is then found using binary search. To reduce
the overhead of sorting the list is not sorted from scratch. First the
newly inserted items are sorted and then the two parts of the list
are merged.

[ChangeLog][QtWidgets][QGraphicsScene] Speed up the removal of items
when using the linear index.

Change-Id: I28708622605d7fb0fac656df1f9b2f2fa3136759
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-09-03 16:52:17 +02:00
Laszlo Agocs
5b2f77c598 eglfs: Fix regression in config selection
During the introduction of context adoption support the config choosing got
broken for context creation, at least for hooks that return a customized
format in surfaceFormatFor(). The returned format is the one that needs
to be passed to chooseConfig(), not the original.

Change-Id: Iae203cbbf7b39c462386611dd3744f048116df13
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-09-03 16:27:52 +02:00
Dimitar Asenov
ed418f91d5 Revert "Speed up the removal of items from a QGraphicsScene"
This reverts commit bf2ec0183c.

That patch changed the way the linear index works in QGraphicsScene
in order to speed up item removal. That patch occasionally rebuilt
the index by recursively exploring all items in the scene, starting
with the top level. Further testing revealved that in some
circumstances, rebuilding the index in this way can be slow, thereby
significantly slowing down the index compared to the unpatched
version.

The original patch only exists in the qt 5.4 branch and has not been
released.

Change-Id: I081dbcdcc86196ef382466c3e800a33eab9a5b79
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-09-03 16:11:41 +02:00
Jeremy Lainé
f750979b70 ssl: check critical certificate extensions
This adds a test for a QSslCertificate containing extensions which
are marked as critical.

Change-Id: I314e1f5c9943bcad5d43129a97f9f834882dc6fb
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-03 16:10:45 +02:00
Paul Olav Tvete
7e1e42cbf2 Android: Avoid deadlocks on suspend
Get rid of the rendezvous at shutdown: the android thread does not
need to wait for the GUI thread. Since the GUI thread frequently does
blocking calls to the android thread, this fixes several known and
potential deadlocks.

Task-number: QTBUG-41072
Change-Id: Ia6fa8da026b1727e7352b22f4df4d72b63b8c847
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-09-03 15:18:49 +02:00
Jeremy Lainé
a02d798bbd ssl: tighten QSslCertificateExtension tests
This tightens tests performed on a certificate's extensions by checking
isCritical() and isSupported() for all extensions. It also explicitly
checks the keys when value() returns a QVariantMap.

Change-Id: If51c55be25bbcd09cc3a6712ddfea2bf9a01360f
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-03 15:07:49 +02:00
Lars Knoll
5cb21215c9 Change a qFatal to a qWarning
There are valid uses cases how to use Qt without installing
any fonts (e.g. by using an application font), so let's
make the warning non fatal.

Task-number: QTBUG-29192
Change-Id: I5684331b687bef4b8a54be1f68303c80aa8d4372
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-09-03 14:38:18 +02:00
Maks Naumov
7af329fdf2 Widgets: remove pointless assignments
Assignment of a value was two times successively for same variable while
the variable itself is not used between these assignments.

Change-Id: I3c457e3af0505d32a64f6c8576b458cd15a951e5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-03 13:30:12 +02:00
Albert Astals Cid
4dae1a685c Use QPlatformTheme::SystemIconFallbackThemeName in static QString fallbackTheme()
Instead of QPlatformTheme::SystemIconThemeName

Change-Id: Id318944730cd1b8014380a972eb28fd8aab1f382
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-03 13:24:25 +02:00
Friedemann Kleint
74303ad497 QSwipeGestureRecognizer: Use qAbs() to check distances.
Task-number: QTBUG-15768
Change-Id: Idc6c6687430365a015fb2c15f4e4dcae6a687f9f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-03 13:23:42 +02:00
Robin Burchell
3006bd2d44 Make QElapsedTimer default to invalid (and now non-POD).
The practical uses of a POD QElapsedTimer are not really that clear, and the
number of misuses of this API are quite high. Default the state to invalid to
prevent against mistakes.

[ChangeLog][QtCore][QElapsedTimer] Is no longer a POD.

Change-Id: I267292acf2bfca7404e3e449dd04410441d7ce26
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-03 13:19:35 +02:00
Oliver Wolff
8d0e6000cb WinRT: Fixed initialization of udp socket
udpSocket() can only be called after the socket descriptor is set.

Change-Id: If651ff58507cd66c98de4b699a80149913d9ffcf
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-03 13:17:00 +02:00
Topi Reinio
1ce0acfb14 Doc: Do not include the external sites by default
Move the line that adds the external page definions into its own
separate include file.

This prevents the files from being included in every Qt
documentation module by default, needlessly duplicating the
information. Currently only the QtDoc module (and modules that
depend on QtDoc) need it.

Task-number: QTBUG-41003
Change-Id: Ie2ddd3a645ea731787daacfffb3068cb36c79c9a
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2014-09-03 09:40:59 +02:00
Oliver Wolff
365c6e81be WinRT: Fixed construction of QNativeSocketEngine without parent
Change-Id: If55a8049224a7dceca33a3cf3089d541a3a97b8e
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-03 09:33:23 +02:00
Jeremy Lainé
cd3dece750 ssl: common key parser support for encrypted keys
This adds the infrastructure for reading and writing encrypted private keys
when using non-OpenSSL backends. Each platform must provide its cryptographic
encrypt / decrypt functions.

As WinRT already uses the common parser, this commit includes an
implementation for that platform.

Done-with: Andrew Knight <andrew.knight@digia.com>
Task-number: QTBUG-40688
Change-Id: I0d153425ce63601ff03b784a111e13962061025f
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-02 23:16:25 +02:00
Friedemann Kleint
b17365cda9 Fix drawing of QLineEdit's actions when Qt::AA_UseHighDpiPixmaps is set.
Task-number: QTBUG-40525
Change-Id: Iff3c1e16d9c44e1d36b8f83ca96b48bff05ab1f0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-09-02 22:57:24 +02:00
Paul Olav Tvete
d450eb5e6d Android: Guard against invalid surfaceID
Do not try to resize or destroy invalid surfaces.

This caused update problems with all GL apps after suspend,
since we would forget the dummy view that we always keep
around so we get proper transitions on shutdown.

Also make sure that we don't mess this up even if we try to destroy a
non-existing surface. This would have fixed the bug by itself, but
then we would still be stuck with the annoying warning message.

Task-number: QTBUG-41093
Change-Id: I83299e93eb9ac5357b98ca47014789b56c91b35a
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-09-02 22:00:02 +02:00
Andrew Knight
a8b243b42e windows: Allow selection of ANGLE's renderer
The default behavior of ANGLE is to use D3D11 before falling back to D3D9.
This change improves flexibility the platform plugin to explicitly create
a D3D11, D3D9, or D3D11 software (WARP) context by setting the
QT_ANGLE_PLATFORM to "d3d11", "d3d9", or "warp", respectively.

Task-number: QTBUG-41031
Change-Id: Ie1d399c1cb0e360e5b3a6d9f2a4b28745d86cc71
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-02 21:55:48 +02:00
Andrew Knight
efdabc4b0e Remove vestiges of d3dcompiler_qt
Change-Id: I2a233cb0bfec27a7535a31818568955f8bf85c15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-02 21:55:41 +02:00
Marc Mutz
5b9e566b4d QImage: add a qMove()
The color table is passed by value (good for C++11), so when
the argument is assigned to the member variable, that's a good
spot for a move assignment.

However, the argument is also declared const.

The standard says that top-level const is ignored, but some
compilers (I know about SunCC) think differently, so we cannot
remove it.

Instead, we do a const_cast. It is well-defined: Even though
apparently the argument was declared as const, the standard
says the const is not there, and no sane compiler would put
the argument copy into read-only memory.

Add a reminder to remove the top-level const from the
signature come Qt 6.

Change-Id: Iac18846ba669de0a30da620685ad1438c267e193
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-09-02 20:43:07 +02:00
Marc Mutz
b04c144297 QOpenGL2GradientCache::getBuffer: calculate hash value outside critical section
The code doesn't touch any member variables, so it doesn't need mutex
protection. Reducing the time spent under the mutex allows a higher
speedup (Amdahl's Law), so do it.

Also made the mutex locker const to indicate it is never unlock()ed
again.

Change-Id: Ic50b827c0e34d39cbddc7ec83675b568a9c33f6d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-09-02 20:42:51 +02:00
Adam Strzelecki
1a9992c1f2 Fix bash syntax error in configure
Fixes missing space before `]` in test condition introduced in 8d57725338.

Change-Id: I741c291677f32056a0a0bec12cb4d9fd293a2021
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-02 20:37:27 +02:00
Tor Arne Vestbø
8a7fcf0a7d iOS: Don't store UIViewAnimationOptions value as UIViewAnimationCurve
We pull out the magic UIViewAnimationCurve of the keyboard animation
when the keyboard is about to show, but we need to defer the shifting
of the value 16 bits, as that turns it into a UIViewAnimationOptions,
which we can't store in a UIViewAnimationCurve member.

Change-Id: Id35dae1ec487951df749dfffb6118b572c28b103
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-02 16:13:18 +02:00
Tor Arne Vestbø
942c6910d1 iOS: Get rid of markedTextFormat global static variable in IME
Preperation for IME refactor.

Change-Id: I0832c174d05d019d69ef7c01c45aaedc6e4d9468
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-02 16:13:12 +02:00