Commit Graph

20017 Commits

Author SHA1 Message Date
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
Tor Arne Vestbø
fea21655a8 iOS: Add support for QWindow::setOpacity()
Change-Id: I027154aef35d219f08915e195f2baf8595ef7343
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-09-02 16:13:06 +02:00
Friedemann Kleint
552639c359 Windows XP, Vista styles: Share dynamically resolved theme functions.
Extract a struct containing the function pointers and derive
QWindowsXPStylePrivate from it, so that both styles can use them.
Remove duplicated variables.

Task-number: QTBUG-38858
Change-Id: I7c2c665b5930c56ffdf33c5185720f71517d146c
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-02 10:26:13 +02:00
Jeremy Lainé
31938846ae qasn1element: add QAsn1Element::toInteger
This change adds the ability to decode ASN.1 INTEGER fields,
provided they represent a positive number of less than 64-bit.

This is needed for PKCS#12 decoding.

Change-Id: Iafb76f22383278d6773b9e879a8f3ef43c8d2c8f
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-09-02 09:52:08 +02:00
Laszlo Agocs
b366d0d016 Make the EGL platform cursor reset the array buffer
Otherwise bad things happen if the application leaves a buffer bound.

[ChangeLog] The eglfs mouse cursor properly resets the array buffer
to prevent rendering issues. This, just like with vertex attributes and
textures, requires applications to be aware of such state changes in
swapBuffers().

Change-Id: I8b383cc867d8d0d0572773eacfa650e7b33b9680
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-02 09:47:55 +02:00
Maks Naumov
09754d218a QTextEngine: remove unnecessary assignment in LayoutData::reallocate()
Change-Id: I82e34d5525354fc20ca9aba6df3767e3fee51bf8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-02 08:05:10 +02:00
Marc Mutz
de068472f1 QIconLoader: enable an easy case of transactional processing
It's easy to do the work on the side and then commit. This is strongly
exception safe, but in Qt, we don't care. But transactional code, when
this easy to achieve, is also clearer.

Change-Id: I30f1badec7745d62a09af4eede234cb312b373aa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-02 00:43:50 +02:00
Maks Naumov
97a32c8440 Fix radioButton height for Windows style
Change-Id: I755ed32f7458fec0fcbc5243d25fb1f6ecf46492
Task-number: QTBUG-32420
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
2014-09-02 00:27:03 +02:00
Andrew Knight
1cdcf64ad5 direct2d: Fix translucent/frameless window rendering
When using WA_TranslucentBackground/FramelessWindowHint, the backing
store must paint to an offscreen texture instead of the swap chain in
order to achieve the desired results. This texture is then presented to
the screen using UpdateLayeredWindowIndirect().

As the swap chain is not needed in this mode, its construction is skipped
if indirect rendering is active.

Furthermore, the layering options were updated to fix an issue with
transparent layers overpainting the background. The layer options were
switched to D2D1_LAYER_OPTIONS1_NONE, which appears to work for both
translucent and non-translucent rendering modes.

Task-number: QTBUG-40601
Change-Id: I656f7cdfb424d1eda6f82c2c69500e78d8c1726a
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-01 18:08:43 +02:00
Andrew Knight
fc3acdd9d2 winrt: Fix mouse coordinates on high-DPI displays
The scale factor was only being applied to touch coordinates.

Change-Id: I7fc2793b1514c73986a574a95478306c1eb54c5e
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-09-01 18:08:27 +02:00
Laszlo Agocs
6ae01c72e1 Fix no-opengl build
Change-Id: I577bd5d10e52571c95c9e646327264cf95ac6eb1
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-01 14:29:36 +02:00