Commit Graph

23240 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
60e8519544 Solid and gradients in high color accuracy
This patch updates the internal color precisions of solids and
gradients to 16bit per color. This makes it possible to render
at higher precision on non-premultiplied ARGB32, the RGB30
formats and any other hi-color formats if more are added.

[ChangeLog][QtGui][Painting] Internal precision of solids and gradients
is now up to 16bit per color.

Change-Id: Ieae5468bd6de1f56adfa4cb9fa966faf2ed824fd
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-10 09:15:59 +00:00
Alex Trotsenko
853cba729b QRingBuffer: allow to peek bytes from any position
Add an ordinary peek() function which also allows retrieving data from
a specified position. We need this functionality in several places.

Change-Id: Ia4a1b6fe1d7f76cb8f6f1ea34b3e4b89e05a2a68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-10 05:37:11 +00:00
Kai Uwe Broulik
921b22e5ce qiostextresponder: Add support for ReturnKeyType
Change-Id: Ic9212468fb41d8042a345267ae69c95e0d9b4cf2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-04-09 08:25:33 +00:00
Kai Uwe Broulik
d47294bec7 Add ReturnKeyType enum to Qt namespace
This will allow to utilize the native return keys provided by most mobile
platforms, to indicate what kind of action pressing it will result in,
such as performing a search, a navigation, moving on to the next input
field or just closing the keyboard.

[ChangeLog][QtCore][Global] Added ReturnKeyType enum allowing for fine-grained
control of the platform's on screen keyboard return key

Change-Id: I6a691045ad6970e6893f23773b2449a7bafd98fc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-04-09 08:25:20 +00:00
Liang Qi
65fdde30d0 Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev 2015-04-09 06:35:26 +00:00
Liang Qi
4973786f0d Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I04f9f2749f68c0cb5a427b8d84e43b44bb143e4d
2015-04-08 21:24:26 +02:00
Marc Mutz
91b44afdcb Split qHash()-related code into separate header
The reduces the amount of code the compiler has to parse when all
the header does is implement its own qHash().

I left the implementation in qhash.cpp, as it doesn't influence
qHash*() users.

Change-Id: Id320d690a33769bae78b03ccc3b08f7124123459
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-04-08 16:52:15 +00:00
Jake Petroules
00540a8345 Remove special handling for (DY)LD_LIBRARY_PATH in QProcess.
This provides the ability to pass a *real* clear environment to a
QProcess, rather than (DY)LD_LIBRARY_PATH always being copied over
from the current environment behind-the-scenes. This is important
to users because passing a truly clear environment is now possible.

[ChangeLog][Important Behavior Changes] (DY)LD_LIBRARY_PATH will
no longer "stick" in the process environment when starting a
QProcess. This means that if a QProcess is started with a clear
environment, it will not specially inherit (DY)LD_LIBRARY_PATH
from the parent process. This should not affect most applications,
but if the old behavior is desired, one can simply pass a clear
QProcessEnvironment with the (DY)LD_LIBRARY_PATH values added, to
the QProcess.

Change-Id: I51d1bc14905c5cc126fb02d91dddc2faade41a3c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-08 15:13:27 +00:00
Friedemann Kleint
a21a24ee48 [QFontEngineFT::loadGlyph] Fix reversed condition.
Introduced by 237cb0d082
(Consolidate paths for fetchMetricsOnly cases).

Task-number: QTBUG-45444
Change-Id: Icd642c09490f1cfc5804313d60d467290ae599ba
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-04-08 12:10:12 +00:00
Martin Smith
0b17d23285 qdoc: Data member name changes
In preparation for refactoring the Node class hierarchy,
several data member names and some getter and setter names
in the Node hierarchy have been changed to make them more
readable.

Change-Id: Id76ce21c960e4033673f5cf0684aa70e701957b1
Task-number: QTBUG-45450
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-04-08 11:23:49 +00:00
Kai Koehne
a60571b370 QSaveFile: Fix permissions on creation
QSaveFile is intended to be a replacement for QFile, and should use the
same permissions for newly created files. QTemporaryFile however creates
new files with 0600 mask by default.

Fix this by making the mode_t argument QTemporaryFileEngine uses
configurable, and using 0666 for QSaveFile (like we do in QFile).

[ChangeLog][Important behavior changes] Files created by QSaveFile do
now have the same rights as files created by QFile. This also fixes a
regression in QSettings: In the Qt 5.4 series, new files created by
QSettings were only readable by the current user.

Task-number: QTBUG-44086
Change-Id: Ie1cc20e9f25c6e72e1bc9176490c419c27c5fc82
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-08 07:48:17 +00:00
Ursache Vladimir
e18111c1a3 Optimize QApplication startup time by caching the Compose file
Please find the explanation at the top of qtablegenerator.cpp.

Change-Id: Ib1a5ee49d382034520ed0871bb524b7931cf330a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-08 07:37:48 +00:00
Liang Qi
4cee9928f2 Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev 2015-04-08 06:52:22 +00:00
Laszlo Agocs
a715c6ceb8 Use the default fbo in Qt sense in blitFramebuffer
QOpenGLFramebufferObject::blitFramebuffer() passes 0 when no FBO is specified.
This goes against the rest of the framework where the default fbo is what
QOpenGLContext::defaultFramebufferObject() returns. This becomes significant
with QOpenGLWidget and on iOS.

Task-number: QTBUG-45328
Change-Id: Iaeb82cd3786ad395116679c9626bdcb10e93b4e3
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-08 05:58:27 +00:00
Martin Smith
0d4232f531 qdoc: No longer creates empty subdirectories
qdoc was creating the scripts and used-in-examples subdirectories
whether or not there were any scripts or images used in examples.
Now qdoc creates these subdirectories only if there is something
to put in them.

Change-Id: Ied0e1b38ee28973313c68754c821b34edfd5f505
Task-number: QTBUG-44655
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
2015-04-07 19:36:38 +00:00
Alex Richardson
f041757d7a Allow overriding ar binary in configure script by setting AR env var
Unlike all the QMAKE_* command variables it requires the arguments "cqs"
to be part of the variable. This means we need to append the arguments
for compatibility with autoconf.

Change-Id: I961e89d506612873ba1f9cbecff97c448e83a5a2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-07 19:35:13 +00:00
Marc Mutz
7064bf2b9b QErrorMessage: sort statements in ctor
This has no influence on text size, but by executing similar functions
temporally close to each other, we should make better use of the i-cache.

It's also more readable.

Change-Id: Ia211e562d798d4f16f3fd17f87f1e2cad2e0359d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-07 18:52:11 +00:00
Marc Mutz
b6b17c2040 QErrorMessage: streamline conditionals in done()
...to avoid checking the same conditions a second time.

Saves 32B in text size on my machine, too.

Change-Id: I0368408b9f5feb02e811dc15ade79d9796031896
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-07 18:52:04 +00:00
Marc Mutz
bb7b20b446 QErrorMessage: avoid some code duplication
...by using the predicate from nextPending() in the two
showMessage() functions, too, which thus become identical,
when substituting type -> QString().

Also saves around 250B in text size.

Change-Id: Ibf5d081dbec3438b7b1be4e240879e26d0455d6b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-07 18:51:57 +00:00
Marc Mutz
8780381532 QByteArray: begin()/end() are not \internal
Docs copied from corresponding QString functions.

Change-Id: Ia2b0f0521780246d82003a1fda539c132823b294
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-07 16:34:25 +00:00
Marc Mutz
dc6e964f63 docs: QString contains characters, not items
Change-Id: I479a731780dfce81e138d1aca950385437266763
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-07 16:34:06 +00:00
Thiago Macieira
22dbf6111d Remove unnecessary QDateTime::detach() function
Last commit changed QDateTime::d to be a QSharedDataPointer that
implicitly detaches on non-const operator->() calls. That means we no
longer need to explicitly call detach().

More than that, we should not do it, so we avoid checking the ref count
and try to detach on every use. To do that, in functions where the d
pointer was accessed more than once, I detach at the top and shadow the
"d" variable with a local plain pointer. We don't compile our sources
with -Wshadow, so this should not be a problem.

Change-Id: Ic5d393bfd36e48a193fcffff13b969c281c36d0c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 14:48:47 +00:00
Topi Reinio
2a6249c00a Doc: Qt Concurrent: Link to essential usage information
Functions under the QtConcurrent namespace used to be documented
as header files, using the \headerfile command. These documents
have been since converted to standard pages using the \page
command, and the reference documentation for these functions
now live in the namespace page only.

However, the former pages contain useful usage information and
code snippets, but they've not been linked to from anywhere.

This change links to these pages from the module landing page,
as well as from the function reference doc.

Change-Id: Ia750d72d12503cec96ee2c9e202dd561e548cb24
Task-number: QTBUG-28977
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2015-04-07 14:38:29 +00:00
Konstantin Ritt
491b746473 Fix build with -directwrite
There were several issues caught by GCC:
* deleting object of polymorphic class type which has non-virtual
  destructor might cause undefined behaviour
* comparison between signed and unsigned integer expressions
* 'GetUserDefaultLocaleName' was not declared in this scope
  (depends on WINVER >= 0x0600)

Change-Id: I39f2cc0d5e158f4d85377edd55e9f74a512c7303
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-04-07 13:10:38 +00:00
Konstantin Ritt
3a845e4b4f Use QT_WARNING_.. instead of #pragma GCC diagnostic ..
Change-Id: I0bb55a7f1074f3b8d6fb681b1d4dab5105ae7569
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-07 13:09:48 +00:00
Konstantin Ritt
237cb0d082 [QFontEngineFT::loadGlyph] Consolidate paths for fetchMetricsOnly cases
Use GlyphInfo as a temporary buffer for storing the glyph metrics
and go through the same code for fetchMetricsOnly and !fetchMetricsOnly.

Change-Id: If8bb85056e5f09588cc3956b43dc51a54d5aecfe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:09:27 +00:00
Konstantin Ritt
550fb85b65 [QFontEngineFT] Move code around to improve readability (no-op)
Move some variables initialization closer to the usage context.

Change-Id: I0f1de0ddc9f0fbe3ec4a56455ccc14f9e8d94e5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:09:00 +00:00
Konstantin Ritt
037ad03182 [QFontEngineFT] Avoid double-negation of info.x
Make it consistent with fetchMetricsOnly path.

Change-Id: I6a2d2568d5579255582217515a4e598722547c60
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:08:02 +00:00
Konstantin Ritt
95d034a14f Introduce QQuaternion::fromDirection()
...which constructs a quaternion using specified forward and upward
directions, so that the resulting Z axis "faces" a given forward direction.

Change-Id: Ib77b8ab5c359a4880b0d946face87026acdc6f0b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Michael Krasnyk <michael.krasnyk@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:07:48 +00:00
Konstantin Ritt
3fb6014ce7 [QFontEngineFT] Guarantee correct metrics for alphamap and its bounding box
...for both cached and non-cached modes, by disabling hinting
for transformed glyphs in loadGlyphFor().

Change-Id: I13766a653ebd72cbed0f5c38ca3536d042aed762
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:07:40 +00:00
Konstantin Ritt
134c6db858 [QFontEngineFT] Consolidate .*lpha.*MapForGlyph() behavior
...and decrease code duplication.

Change-Id: I5eb3c0694dde9030405a3bd3d410ff9784ed7717
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:06:55 +00:00
Marc Mutz
51028d1472 QQueue: unhide QList::swap(int, int)
Task-number: QTBUG-34197
Change-Id: I0b405ab0fabff8852b2705d651848fbff74fc4c2
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-04-07 13:05:50 +00:00
Oliver Wolff
32849f4997 qmake: Rework dll deployment
QT_INSTALL_LIBS is not the right place to check for Qt dlls, as they
cannot be found there in a non-developer build. In order to be able
to find the dlls and make adding dll locations easier for the user,
QMAKE_DLLS_PATHS was added. On Windows, the variable points to Qt's
bin directory by default.

Task-number: QTBUG-44960
Change-Id: Ie4e5beeaadee798a055599387e842d7c0502c27a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-07 12:55:24 +00:00
Marc Mutz
3cb7a1b957 QErrorMessage: add some strategic qMove()s
Saves 56 bytes in text size on my machine.

Change-Id: Ic92943356e0e27620346854e02c129cdfa00f894
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-07 07:45:50 +00:00
Marc Mutz
414dd4bf12 QErrorMessage: replace inefficient QQueue with std::queue
QQueue is-a QList, so it inherits the trait that types larger than
a void* cause a heap-allocation when inserted, which is horribly
inefficient.

Use a std::queue instead, which, by default, is backed by std::deque.

Requires rewriting the API calls, since QQueue uses non-standard
function names.

Text and data size increase negligibly (23 and 8 bytes, respectively),
even though we're instantiating a completely new type (std::deque)
instead of QList<QPair<QString, QString>>, which is probably still
used, despite the inefficiency.

Change-Id: I9bb04a2ec32bb1b9fa2eb83780f0aaa26e872d49
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-07 07:45:39 +00:00
Marc Mutz
2d7128956f QErrorMessage: put local types into the unnamed namespace
Change-Id: I20f8ea7dc95fdecc4bb1190fb8acda19d99cc234
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-04-07 07:44:29 +00:00
Liang Qi
20cac3d9c9 Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: If9fd98525b6b4ca07e5e006fc98bf372a73b8a21
2015-04-06 19:10:25 +02:00
Thiago Macieira
9eb0b09abc Removed unused code on QT_STRING_UCS4 macro
This isn't defined or used anywhere else.

Change-Id: I9a75ad8521ae4e5cbbe5ffff13d2356883b82dbc
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-04-05 19:40:04 +00:00
Marc Mutz
8ce85d74b6 qppdprintdevice.h: Don't rely on indirect includes
Change-Id: Ib8c2c308cf360b2e3c530ef38249af10ededc44c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-05 17:03:19 +00:00
Marc Mutz
274677a3cb qgtk2dialoghelpers.h: Don't rely on indirect includes
Change-Id: I78e519e32bf3f40e742030926f8dd32a9a7e11a2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-05 17:03:11 +00:00
Marc Mutz
b5a3a02d51 QString::section: scope a variable better
Improves code clarity.

Change-Id: If77eb644b1505c84783c907333526a4f08bb75a9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-05 17:02:37 +00:00
Marc Mutz
f1530d0be1 Optimize QString::section(QString)
The port from split() to splitRef() speeds up typical section()
calls (where the separator is included) by ca. 1/3.

The complete truth includes that section() calls where the
separator is not found seem to have gotten twice slower.
But that's a corner-case.

Change-Id: I7e957cb65fccfd095ac522d523aef3464425e4e4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-05 17:02:30 +00:00
Olivier Goffart
f02b849e97 Add Q_DECL_RELAXED_CONSTEXPR to QChar
Change-Id: I7c5a951bcd952ce5c1aaa62e107a800d49038f22
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-04-05 16:58:25 +00:00
Marc Mutz
be67eccc26 QChar: plaster API with Q_DECL_NOTHROW
This is mostly straight-forward, but some things are worth noting:

1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
   not at the contents of the function to determine whether to return true.
   The more conditionally-noexcept functions are used, the more important it
   becomes that low-level classes are correctly marked noexcept. In that, it
   is like constexpr.
2. The decomposition() functions, returning a QString, can throw (bad_alloc).
   Consequently, they're not marked nothrow. they're the only ones.

Change-Id: Iae50283aaa2d0596a265b7e2652c9fb04cedc706
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 16:58:14 +00:00
Marc Mutz
947da471f7 QChar: move definitions of inline methods into the class body
This hopefully prevents buggy compilers from choking on the definitions
outside the class as inconsistent, even though they are consistent.

Also helps developers, as the rather lengthy attribute lists for
C++11 functions does not need to be repeated.

This is in preparation of plastering the QChar API with Q_DECL_NOTHROW.

I had to keep operator== and operator< outside the class because
Clang on OS X 10 didn't find it when called with types implicitly
convertible to QChar.

Change-Id: I8bd634bc756d1bf5d208d7a2ce7e7ded73c4ce56
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 16:58:04 +00:00
Marc Mutz
cc164f9ac7 QVarLengthArray: add {const_,reverse_iterator}, {c,}r{begin,end}()
[ChangeLog][QtCore][QVarLengthArray] Added rbegin(), crbegin(), rend(), crend(),
and reverse_iterator and const_reverse_iterator typedefs.

Task-number: QTBUG-25919
Change-Id: Ifda5d420802a3594c3181f54036279f16a7da16e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 16:57:49 +00:00
Marc Mutz
f276dd5b7f QVarLengthArray: add relational operators <,<=,>,>=
std::vector has them, too.

[ChangeLog][QtCore][QVarLengthArray] Added relational operators <, <=, >, >= if the element
type supports operator<.

Change-Id: I69e16d361fd4738a56b292ebfa78316d28871eda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 16:57:44 +00:00
Marc Mutz
f7b5f0cfd2 QList: add {const_,reverse_iterator}, {c,}r{begin,end}()
[ChangeLog][QtCore][QList] Added rbegin(), crbegin(), rend(), crend(),
and reverse_iterator and const_reverse_iterator typedefs.

Task-number: QTBUG-25919
Change-Id: Icce870c22931e68cdcedd1519651bfa374ac44af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 16:57:41 +00:00
Marc Mutz
dfb00bd479 QList: add relational operators <,<=,>,>=
std::vector has them, too.

[ChangeLog][QtCore][QList] Added relational operators <, <=, >, >= if the element
type supports operator<.

Change-Id: Id2bd905e92c0365ad9f439d49908045c8df309c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 16:57:37 +00:00
Alex Trotsenko
a03c633e4f Virtualize options setting on TCP server socket
Currently, socket options setting is hardcoded in QTcpServer::listen()
function after the engine initialization and before a binding to the
address. This disallows a socket tuning in further QTcpServer inheritance.

Add a private virtual configureCreatedSocket() method that gives an
ability to set the socket options before listening.

Change-Id: Ice9b477e64f21daee96c0ec6d27a8408f9e1aa93
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-05 15:00:01 +00:00