Commit Graph

20081 Commits

Author SHA1 Message Date
Louai Al-Khanji
0e02f16cea Add presentBuffer method to EGLFS hooks.
Change-Id: Iab5674fe9407d3ab447ef6c16577b24fa60d42aa
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 10:35:25 +02:00
Robin Burchell
46b2c74eaf QFontDatabase: Micro-optimize getFontWeight.
Translation is an expensive thing, and probably quite uncommon - so don't
penalise any common cases by checking for it until we're quite sure they have
failed.

In addition, we avoid repeated string construction when translating (caching the
result) and avoid repeated case-insensitive comparison by toLowering the string
data.

This change either speeds up most runtime cases that were unfairly penalised
(such as "light") by 50-70% or doesn't impact the runtime speed at all (or,
results were within the margin-of-error).

Of course, calling with translated content will be a bit slower now, but the
slowness of the translations should more than dwarf the real change there.

Change-Id: If24685dfd553e4aed07fbf07678b2585e22b0a3a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-15 17:21:11 +02:00
Robin Burchell
1c4786389d QDateTime: Micro-optimize by using QString::fromLatin1 instead of QString::fromUtf8.
This data is clearly not (and will never be) utf8 data, so using fromLatin1
avoids the (slightly more expensive) utf8 mangling.

I didn't see any significant impact on benchmarks, but I also wasn't
specifically collecting data when making this change.

Change-Id: I45190d40b2caccf15b1f9a1ae5b7dcd08cbd541f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-15 12:33:08 +02:00
Robin Burchell
5857809cc5 QDate: Micro-optimize for fromStringIso benchmark.
By using QStringRef instead of QString, we avoid a data copy. This takes the
QDateTime::fromStringIso benchmark from 0.79ms to 0.53ms for me.

Change-Id: Ibb36067491ffc275ce3b667cb0e04941aa9457f0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-15 12:32:52 +02:00
Samuel Gaist
897346604e QTextDocument: code cleanup
Improve code readability using by-pointer rather than
by reference out argument.

Change-Id: Icf2d609f1b63feac7b1674b357fe64473bfa8f3f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-15 09:36:16 +02:00
Samuel Gaist
eb5dc9ed1c QTextDocument: Correct parameter documentation
Change-Id: Ie91aa2731732e4a6a1abdc2fc7ae00876c5d76e2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-15 09:36:05 +02:00
Samuel Gaist
d3a5321e57 QTextDocument: doc and function parameter name cleanup
Change-Id: Idecdf66da0d00cbede6ca5b742d10cf536f366d2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-09-15 09:35:51 +02:00
Samuel Gaist
4066a6a893 Add QRegularExpression support to QTextDocument
Currently QTextDocuement only provides find using QRegExp. This patch
aims to add support for QRegularExpression.

[ChangeLog][QtGui][QTextDocument] Support for searching with a
QRegularExpression in a document has been added.

Change-Id: I6dba10545b83995d093407038a821fe54db3d261
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-15 09:35:47 +02:00
Jake Petroules
4e8720d413 Use new, supported APIs in OS X 10.10 and iOS 8.0 to get the OS version.
Gestalt is deprecated so we can't use it long term. At the same time,
the new API is cross platform, so we'll no longer have to parse strings
in -[UIDevice systemVersion] either.

Change-Id: Ic81797174c1a3d50b47b9b209205a6a506cc75ef
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2014-09-12 22:01:58 +02:00
Allan Sandfeld Jensen
fac71528cc Read and use WheelScrollLines configuration on KDE
Qt supports changing the default lines a scroll wheel click scroll, but
wasn't trying to read the system settings. The patch adds support for
platform themes to set the default.

Change-Id: I53fdcec7984941d1d1285d927d70460356613f81
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-09-12 11:46:59 +02:00
Marc Mutz
2ad5d62f11 Micro-optimize qt_section_chunk ctor
Use C++11 move semantics, and the ctor-init-list.

Change-Id: I1a5faa83ef552e8d98ce994edf967770a73cab0e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 10:00:30 +02:00
Marc Mutz
b53bf377a9 tst_QString: also test section(QChar) overload
Change-Id: I5d631cdd33501ac10e3e4184518d3c70b20984d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-12 10:00:22 +02:00
Marc Mutz
50b34f2a5a QPainter: use qEnvironmentVariableIsEmpty()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I1ac14bb3d262201071025a885633886934f2d74c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 10:00:16 +02:00
Marc Mutz
0a5a41d9a4 QImageReader: use qEnvironmentVariableIsEmpty()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I92805767b55adce478a4bf8eb1cbafaa544f96aa
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 10:00:10 +02:00
Marc Mutz
d2ba9d0962 QIcon: use qEnvironmentVariableIsEmpty()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: I427aa5bf5b8d76aabdd5ce5950e9e6762f79b8d8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-12 10:00:05 +02:00
Marc Mutz
e8aa70c2d6 QFileSelector: use qEnvironmentVariableIsEmpty()
It doesn't allocate memory, so cannot throw and is a lot faster
than qgetenv().

Change-Id: Ib303f00ce45816677ffca0580cc6b91a14a0e5be
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-09-12 09:59:59 +02:00
Marc Mutz
aac6cda804 QWheelEvent: make magic number 120 a symbolic constant
The documentation states that 120 is the value users of
the event should use to determine one full step of the
wheel. Provide that number as a symbolic constant.

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

Change-Id: I774ae9011b855f746b5e3fdf25995d81ec60b82a
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-09-12 09:59:11 +02:00
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