Commit Graph

20063 Commits

Author SHA1 Message Date
Marc Mutz
099f188bc8 xcb: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Ie625d79352fa166e45939ef8f0a5e0cc32f8e801
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-12 09:59:06 +02:00
Marc Mutz
dcb48c6dc6 WinRT: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I73d548ad4e25424fc41722961f527e63632a7b56
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-09-12 09:59:01 +02:00
Marc Mutz
1dce3b7d11 QNX: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I211d6de32da06bf465c4f721f39d73289206745f
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-09-12 09:58:56 +02:00
Marc Mutz
0a94712ad5 QMinimalIntegration: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Idaad6ec1d92d9aa58d61e2d98e136f108be2bb4c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:58:51 +02:00
Marc Mutz
b3b29c2592 QKmsScreen: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Iaaba62396de2d70f611bfa2ba5badb070087fa24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-12 09:58:45 +02:00
Marc Mutz
9b62d37894 eglfs: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I4c43809954ed720de95b3056c13bf520577e3280
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-12 09:58:40 +02:00
Marc Mutz
4aba06aa47 Android: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I6d79852613228658f9093a272edf9b434e60286c
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-12 09:58:34 +02:00
Marc Mutz
6bc9e44433 QEvDevTouch: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I64de0b2644c50469a35fdba9ecde167862975b79
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:58:28 +02:00
Marc Mutz
6d3e9be1d2 QFbVtHandler: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I18c00da9504dd3744e6fbb23ea9b9fb7c6d669c9
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:58:22 +02:00
Marc Mutz
f88c5415ff eglconvenience: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Id50609c1f3511287d99e24b03e48c0a254893194
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:58:15 +02:00
Marc Mutz
9f0d5b3b6c QPainter: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Ie41b95c09f2c6106a6683ba4637513c974555840
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:58:06 +02:00
Marc Mutz
a24566a338 QHash: remove unnecessary #ifdef
There's no need to use a macro here, since we can just store
the pointer value in a qulonglong and have the second shift
operation be done unconditionally. For 32-bit platforms, it
will yield 0, and xor'ing it into 'seed' will have no effect.

Change-Id: I3e63bd504e81c84d13935d5503c3707d40d74d6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 09:57:59 +02:00
Marc Mutz
d04c2fbc1d QPainter: drop a pointless check
There's no need to check for nullptr before invoking delete.

Change-Id: Ied751f76f15f390bf86bbba53c14a3e450aa81e8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:57:52 +02:00
Marc Mutz
44f65a0650 QPainter: use qDeleteAll()
Change-Id: I167e4d7a57e92eb5ea7c39b04246ac2f44c91de0
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 09:57:43 +02:00
Marc Mutz
b1a8d48e37 QLibrary: simplify qt_debug_component()
Instead of initializing debug_env to -1 (thus forcing the variable
into the data segment), and then overwriting the -1 with a read
from the env-var, dynamically initialize the variable from the
env-var directly, thus allowing the variable back into the bss
segment (which doesn't occupy storage in the executable).

There may have been a reason to do it this way when the old code
could fail due to the memory allocation involved, but now with
qEnvironmentVariableIntValue(), that is no longer a reason.

Change-Id: I9f21b0783ff348f50b574395fc07f2869a14102e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 09:57:34 +02:00
Marc Mutz
699df74197 QLibrary: use qEnvironmentVariableIntValue()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I8d440619edfbd90045564e1f92676f1e1f87e136
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 09:57:26 +02:00
Marc Mutz
bb56586e32 Add qEnvironmentVariableIntValue()
A lot of code in Qt uses VAR=1 for enabling or disabling some feature
or other, ignoring qEnvironmentVariableIsSet(), which was added for
that purpose. Other code actually reads numerical values from
environment variables. For both use-cases, provide a non-throwing,
non-memory-allocating way to get the numerical (int) value of an
environment variable, complementing qEnvironmentVariableIs{Set,Empty}().

[ChangeLog][QtCore] Added qEnvironmentVariableIntValue().

Change-Id: I81c85287ea10d355c1bbf8d7807ec9a0e477bce0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 09:57:16 +02:00
Giuseppe D'Angelo
6be26d9051 QRegularExpression: more QStringRef tests
So far we've only tested matching against QStringRefs which were
spanning the entire underlying QString. Instead, use the offset
matching to also perform tests using "proper" substrings.

Change-Id: Ia66e23f738b52997311ed2cf869e595079984292
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-12 08:33:12 +02:00
David Faure
de4cad945d QAbstractItemView: add iconSizeChanged signal.
This is useful when writing a generic preview-icon-generator which
should work with different type of views, itemviews and QML views.
A way to be notified of a change of icon size was missing on the itemview side.

[ChangeLog][QtWidgets][QAbstractItemView] Added iconSizeChanged signal.

Change-Id: I19b3049961002ca27d71aefbb6980d1e6f225c79
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-12 02:07:48 +02:00
David Faure
31c6d9f04b QTextStream: add fast path for writing char and QChar.
Avoids allocating a QString for every char being written out.
The benchmark went from 5.5 ms per iteration to 0.8 ms,
and from 40 million instructions to 6 million.

Found using Milian Wolff's heaptrack tool.

Change-Id: I1784c47b944454bc947a607a22c39d249372ed55
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-12 02:07:36 +02:00
Alex Trotsenko
6600804079 Remove incorrect read from QSslSocket::readData()
QIODevice makes readData() call only when its read buffer is empty.
Also data argument points to the user or reserved read buffer area.
So, no need in data transfer from read buffer at this point at all.

Change-Id: Ieb4afdf7eec37fdf288073e4a060e64424f22b9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-11 19:31:51 +02:00
Oswald Buddenhagen
d572ab1bb4 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: Id4997327cc01bd4bb397a463bdffbd15e80398ef
2014-09-10 11:42:50 +02:00
Dyami Caliri
71df09b6cc Fix garbled resize with QOpenGLWidget when using multi-sampling.
If you configure QOpenGLWidget to use sampling, the 'resolvedFbo' isn't
updated during resizing. This leads to garbled views.

Change-Id: I9f9265520134bcf12436778773507df936c5fbb6
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-10 04:49:40 +02:00
Alexander Volkov
3203239bd8 xcb: fix getting a XdndAware property if a proxy window exists
According to the XDND standard (http://www.newplanetsoftware.com/xdnd/)
if the proxy window exists then it should be checked for the XdndAware
property rather than the target window directly.
c3f9de6296 introduced the mistake.
In the old code the proxy window was used.

Change-Id: I83b66d4b1f08a1f44d5c1451d0f1735c084bcf09
Spotted-by: Alexander Smirnov
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-09 20:59:43 +02:00
Maks Naumov
8db7e47699 QNetworkReply: move "State" enum declaration into QNetworkReplyPrivate
Change-Id: If63a029a7a7ef84fc1b4b73f5bab495992ea7e02
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-09-09 19:21:05 +02:00
Mitch Curtis
5042145dd9 Fix typo in QMetaType documentation.
Change-Id: I934b68978fb32a518ed7cf9b47f1600982f58f66
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-09-09 08:16:11 +02:00
Maks Naumov
e5dbef74b4 QRegion: remove check for null ptr after "new" operator
Change-Id: Iebba0b1f024e22cd36a04c53377b3958638b389e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-09 01:13:51 +02:00
Maks Naumov
fefa4dc1f0 Windows styles: Avoid theme.rect recalculation
In both cases theme.rect calculated right after the
"sub & SC_ScrollBarSlider" test.

Change-Id: I9fa0c4e1327e68b4184674a13e7a4bf362f8deff
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-08 22:44:42 +02:00
Adam Strzelecki
af155105a9 qmake: Add QMAKE_SONAME_PREFIX variable
If defined, the value of this variable is prepended to the built shared
library's SONAME identifier.

For more information, see: qmake/doc/src/qmake-manual.qdoc#qmake-soname-prefix

Task-number: QTBUG-31814
Change-Id: I4bceaf0c93162e4fad6bb424af1b82e74d38acdc
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-09-08 22:19:33 +02:00
Laszlo Agocs
935186d76e Improve QOpenGLWidget docs regarding fb preservation
QOpenGLWindow already has some notes regarding this. It must be
mentioned in QOpenGLWidget too.

Change-Id: I0af90c9410a1c44cb9dd9ce58aa0371a58c57f65
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-08 21:47:28 +02:00
Friedemann Kleint
df5db1dfb2 Fix linking of tst_qwindow with dynamic Open GL.
Task-number: QTBUG-40696
Change-Id: If80a5e9b96e2eb7e50e02eefbe6e54d0b028c144
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-08 21:43:06 +02:00
Laszlo Agocs
267eb25151 Enhance the VAO docs
Make it clear that the class is usable regardless of the OpenGL version
the app is targeting. It may just do nothing.

Change-Id: I50e68a46e36ef1f4694016311af93c6f8719ce4f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2014-09-08 20:35:19 +02:00
Alexander Volkov
f3cee50216 Fix a conversion of coordinates of a TouchBegin event
To convert coordinates to a parent's coordinate system one should
translate them by an offset of a child widget relative to it's
parent widget. QRect::moveCenter() doesn't translate, it sets
the coordinates of the touch point's center to this offset.

Change-Id: I9d823784803bd1448c0d665944090674d3ff518b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-08 15:35:40 +02:00
Laszlo Agocs
289e9af668 Define EGL_EGLEXT_PROTOTYPES for ANGLE
Otherwise the protos are not pulled in so the ANGLE-only build cannot
suceed (unless the flag is defined from somewhere else).

Task-number: QTBUG-41164
Change-Id: I959d154da88f7ccc8159ec7e810ffdba0e7f50ea
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-09-06 22:39:48 +02:00
Adam Majer
357f80878d Bump Q_COMPILER_INITIALIZER_LISTS to GCC 4.5
While GCC 4.4 has the required header, it is missing important
typedefs requiring use of pointers instead. This is acceptable if only
used in one or two places, but a quick search through the source code
lists quite a few usages of const_iterator typedef.

$ git grep -c initializer_list\<.\*\>::const_iterator
src/corelib/global/qflags.h:2
src/corelib/json/qjsonarray.h:1
src/corelib/json/qjsonobject.h:1
src/corelib/tools/qhash.h:2
src/corelib/tools/qmap.h:2
src/corelib/tools/qset.h:1

The lesser-evil is to bump Q_COMPILER_INITIALIZER_LISTS to version
GCC 4.5 and retain usage of required (by standard) initializer_list
typedefs.

Change-Id: I38d6fa0ef3dc7d958587b406d33e3e3a7378c026
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-06 04:11:29 +02:00
Robin Burchell
93560de9de kms: Move debug output behind a category.
Change-Id: I5b2bb8631a33b577afca1a0852abe4cabae1e254
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-09-05 22:18:46 +02:00
Maks Naumov
a3421d1ba6 QDateTimeParser: remove unused local variables
Change-Id: Id78fde8a720961c448d1aa3983ad296974796fdf
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-05 20:18:04 +02:00
Gunnar Sletta
0e2c329313 Remove GLdouble and GL_DOUBLE typedefs for OpenGL ES 2.
We have no business defining types which come from another library.
These originally stem from the S60 port without further explanation
and Qt and its examples today compile without them, so remove them.

Change-Id: I683ea897c00ab3a1f7c809c45352fe590ae9a41f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-05 18:14:15 +02:00
Kai Koehne
3cae7dcc5a Use expiry_date field to check for evaluation timespan
Use the new dedicated field instead of just assuming that the evaluation
timespan is buildtime + 30 days.

Change-Id: Ibf4078f030ea609d823fe01889a106a5da345817
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-05 17:19:53 +02:00
Friedemann Kleint
50e1733dfa Bump version of QWidget geometry serialization to 2.0
It was decided not to port the handling of the saved
screen size to Qt 4.8, so, bump the major version to
ensure Qt 4.8 bails out.

Task-number: QTBUG-38858
Change-Id: Ia870519553172cd383830d9a722b0fada180ee1b
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-05 15:25:52 +02:00
Alexander Volkov
f721a85b1e xcb: fix coordinates of touch points
Fix conversion from FP1616 to qreal.
Use 16-bit mask 0xFFFF instead of 8-bit mask 0xFF.

Change-Id: I0ee39b2e298b7ff7d7a67981925374d6a18f1474
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-05 15:23:30 +02:00
Friedemann Kleint
eac2876d55 Windows: Move dock windows automatically when screen is disconnected.
Windows does not automatically move WS_EX_TOOLWINDOW type windows.

Task-number: QTBUG-39320
Change-Id: If9804f32beb534a27ba649abf5eaceb686af8f50
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-09-05 15:21:39 +02:00
Jeremy Lainé
070fcf9ce1 ssl: common certificate parser support for extensions
This makes non-OpenSSL backends able to handle to certificate
extensions.

This also converts the Q_OS_WINRT #ifdef's in the unit test to
QT_NO_OPENSSL as the behavior is the same for any non-OpenSSL
backend.

Change-Id: I6a8306dc5c97a659ec96063d5a59cee2ee9a63a9
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-05 14:20:44 +02:00
Topi Reinio
2e667c9171 qdoc: Highlight selected section / entry in the documentation
This commit adds id tags with the anchor reference as the value
to html entities for documentation section titles and function
signatures, properties etc. for both C++ and QML documentation
pages.

Together with new CSS rules, we can dynamically highlight the
title that the user clicked on. This helps to locate the item
of interest on a crowded page or when the page cannot be
scrolled down enough to place the selected item on top.

Change-Id: I7d1db2ed4e12779e1a9e571996ee65c3befa4e7a
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2014-09-05 14:17:29 +02:00
Paul Olav Tvete
675d354815 Avoid deadlock when suspending device
Don't wait for the GUI thread when it's already waiting for us.

An application that uses the virtual keyboard may get an inputmethod
query just when it is being suspended. If the GUI thread is already
blocking on a semaphore at that point, waiting for the android thread,
we really do not want to wait for the GUI thread...

Task-number: QTBUG-40955
Change-Id: Iea2cf0dd058a41a897d596c4bcf16f0508adb20b
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-09-05 14:04:34 +02:00
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