Commit Graph

26726 Commits

Author SHA1 Message Date
Alex Trotsenko
41e59ae0fa QIODevice: make the read/write chunk sizes configurable
By default, the read chunk size is QIODEVICE_BUFFERSIZE and the write
chunk size is 0 (which means that we don't use the internal write buffer).
Derived classes may override these values to define the size of
QIODevice's write buffer or to optimize the read buffer use.

Bump the TypeInformationVersion field in qtHookData, to notify the
Qt Creator developers that the offset of QFilePrivate::fileName was
changed and dumpers should be adapted.

Change-Id: Ib732bc94be8da8a5514a6e5dcc04445895f130d8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-01-27 06:32:49 +00:00
Alex Trotsenko
1c0494e63b QIODevice: add infrastructure for multistreaming
Some sequential devices allow data to be partitioned into several
channels that have the property of independently sequenced delivery.
Supporting such devices uniformly requires a unified API which provides
the user with a uniform concept of multistreaming.

This patch is based on QProcess's multiplexing model and introduces
the following features:

 - ability to get the number of channels;
 - multiple internal read/write buffers;
 - channel selection functions;
 - notification signals on channel activity.

To keep the source code compatible with single-channel implementations,
introduce a private class that references the current read buffer and
hides multistreaming internals from the user.

Bump the TypeInformationVersion field in qtHookData, to notify the
Qt Creator developers that the offset of QFilePrivate::fileName was
changed and dumpers should be adapted.

[ChangeLog][QtCore] Added multistreaming to QIODevice.

Change-Id: Idcaa6a618927c101c4c7284d2a633913be6a6ee2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-01-27 06:32:30 +00:00
Louai Al-Khanji
acbd79996d QEventDispatcherUNIX: Use poll instead of select
This allows us to support file descriptors >= FD_SETSIZE.

Change-Id: I7e4a35333446a587cfd13c077fa5e19fa3d1abc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-26 19:41:45 +00:00
Liang Qi
f3060312c8 Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 19:40:45 +00:00
Marc Mutz
c29d3692d7 uic: optimize generateMultiDirectiveBegin()
Instead of building a QMap with dummy values, just to sort the
elements of the QSet, build a QList, and sort that.

Also use QStringList::join() instead of rolling our own loop.

Change-Id: Iebb7faac8e4b72d6f71b3ab3feba7865b1a102f3
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 17:49:13 +00:00
Brad Stanton
1ac6644dda Fixed rendering of translucent CSS borders to prevent visible overlap
This fixes the rendering of translucent borders on CSS-styled widgets to
prevent visible overlapping at the corners. This is done by using a
miter joint (45 degree angle) if either of the adjacent edges are
translucent. Previously, adjacent edges would be drawn at full length
and overlap at the corners if both edges are BorderStyle_Solid and have
identical QBrush objects. This works if both QBrush objects are opaque
but causes visible overlap if one or both of them are translucent.

Change-Id: I99d46c8634cb314e642c635439ed2f7819fcba6a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-26 16:20:53 +00:00
Liang Qi
a15c3d086d Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
	src/dbus/qdbusconnection_p.h
	src/dbus/qdbusintegrator.cpp
	src/dbus/qdbusintegrator_p.h
	tests/auto/corelib/io/qdir/qdir.pro
	tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp

Change-Id: I3d3fd07aed015c74b1f545f1327aa73d5f365fcc
2016-01-26 16:27:28 +01:00
Laszlo Agocs
c5e44920ba Add user friendly warning to basic fontdb when there are no fonts
Qt 5.7 no longer contains lib/fonts. This is a regression for users
relying on Qt's own fonts when running on Embedded Linux systems without
fontconfig. To alleviate the pain, show a friendly message about this.
The old "is Qt installed correctly" note is out-of-date anyhow now.

Change-Id: Idcb732fb65ed9c45529a0bcc3168227e0969bea0
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
2016-01-26 15:10:55 +00:00
Alex Trotsenko
3713764099 QAbstractSocket: do not use internal buffer for discarding the data
Instead, allocate a temporary buffer on the stack. This prevents the
internal read buffer from being allocated if the device is opened only
for writing.

Change-Id: Ib91c58299206e92006589807527e7b71a5555c8f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-01-26 14:44:46 +00:00
Timur Pocheptsov
1272bd4d4a qabstractnetworkcache - enable several tests
Remove several test from black-list - they do not seem to fail anymore.

Change-Id: Idb7d6925a4fdea9b47d963e33a455af0afb7b432
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-01-26 13:12:03 +00:00
Liang Qi
87abfd351a xcb: remove compressExposeEvent() from handleMapNotifyEvent()
It's a workaround for Mesa drivers.

This partially reverts commit a9c0a83207.

Change-Id: Idea2ebdb5e9bdb899f2e105c4a161e74933f0484
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-01-26 11:27:43 +00:00
Liang Qi
0c3ce60c99 tst_qcombobox: Don't use the deprecated QTest::qWaitForWindowShown()
Change-Id: I9a7a5f87e67e6d01d571097e8955d22bc86ca8d6
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-26 11:27:40 +00:00
Liang Qi
0a1af55a9b Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 11:27:37 +00:00
Marc Mutz
b8fb0ee999 uic: eradicate all Q_FOREACH loops [generated code]
... by replacing them with C++11 range-for loops.

Change-Id: I0561174d9981ee2171c23644b5e7aebeb8c25665
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 11:23:42 +00:00
Marc Mutz
364e3eb680 rcc: eradicate all Q_FOREACH loops
... by replacing them with C++11 ramge-for loops.

Change-Id: I95a91ac36c2b2bef17bf12cf7f1676653a2d807d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 11:21:48 +00:00
Marc Mutz
956021dbfc qlalr: eradicate all Q_FOREACH loops
... by replacing them with C++11 range-for, or, for loops
over .values(), with explicit iterator loops over the result
of equal_range().

Some fixes here and there to get to mark containers const for
iteration, without having to resort to qAsConst(). Didn't work
everywhere.

Change-Id: Ibc0e71d3b208d118f06e16741af47261ef4b9e15
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 11:21:43 +00:00
Marc Mutz
cf9d112d7a qlalr: remove uses of inefficient QLists
For QList<QLinkedList<T>::iterator>, mark the iterator Q_PRIMITIVE_TYPE.
This should be done in Qt itself, but would be binary incompatible.

For two other types that are used as values in QMultiMap, replaced
   foreach (x, map.values(y))
with
   auto range = map.equal_range(y);
   for (auto it = range.first; it != ramge.second; ++it)
       x = *it;
which doesn't require a temporary QList.

Change-Id: I9ddd15dd9b1d5bb3000833d14ed911451a272328
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 11:21:37 +00:00
Marc Mutz
18597b2ae2 qdbuscpp2xml: eradicate all Q_FOREACH loops
... replacing them with C++11 range-for loops.

Change-Id: I0233bcf874cdadcd7461e11b89f752dabde086c0
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 11:21:25 +00:00
Marc Mutz
3ef7f1615a qdbusxml2cpp: eradicate all Q_FOREACH loops
... replacing them with C++11 range-for loops.

Change-Id: I13825a444dee30b56b08f3ad8a7a0e15bf324678
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 11:21:20 +00:00
Marc Mutz
4d3e1cb2b2 qdbusxml2cpp: port classNameForInterface() to QStringRef
... and QStringBuilder.

Found while fixing Q_FOREACH/foreach use in src/tools,
thus contains port to range-for as a drive-by.

Change-Id: I221bb8cb1f0fc3edeabfdb37d5d5a17551ee8d36
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 11:21:15 +00:00
Marc Mutz
cf51e2f33f QStringRef: add missing op[]
[ChangeLog][QtCore][QStringRef] Added subscript operator.

Change-Id: Ia85d5efcb7747d2961ba55922ddabe6a46bdf20b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 11:21:09 +00:00
Marc Mutz
1c470f3af0 moc: eradicate all Q_FOREACH loops
... by replacing them with C++11 range-for, or, for loops
over .keys() or .uniqueKeys(), with explicit iterator loops.

Saves 2300b in text size on optimized GCC 5.3 Linux AMD64 builds.

Change-Id: I6e1d4f5e56895dfd74aba21a3d4e913b5825645c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-26 11:21:03 +00:00
Marc Mutz
2c26d519e2 moc: simplify finding required Qt containers
The old code searched for any Qt containers by looking at
- each class definition
  - each property's type
  - each function (signal, slot, method)
    - each argument type
and matching each against "Container<", building
the pattern string each time through the loop.

It would then collect hits in a QSet to be converted
to a QList and sorted at the very end.

The new code pulls the iteration over the candidates
out of all other loops. By doing so, it can stop
looking at classes, properties, functions etc when
it finds the first hit, and it inserts every candidate
at most once.

By iterating over the statically-known list of
candidates, the result is not a sorted set of Qt
containers, as before, but it still has s fixed order
across runs, which was the purpose of the sorting in
the original code.

In the implementation, make liberal use of C++11
range-for, which is safe, as we're passing everything
around as const.

Change-Id: If76dd3f57aa1b544a9cf1de2dca94ca7999220f0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 11:20:58 +00:00
Marc Mutz
b8c32f5efc [docs] Gently discourage use of Q_FOREACH/foreach
... and suggest to use C++11 range-for instead.

Change-Id: If4d4dec1a0cbbc2307ee7d2635f0a8fc3a1ec353
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-26 11:20:51 +00:00
Nico Vertriest
397061a6a9 Doc: Added brief statement to XML examples
Task-number: QTBUG-50261
Change-Id: I0ba4bd630746612d0f1f1632e87c6fdd6aef160f
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-01-26 09:39:33 +00:00
Nico Vertriest
149c659dc1 Doc: removed double occurrence of systray.qdoc
Task-number: QTBUG-50287
Change-Id: Iaf8602fc338dadcc0998f33d41ad9fbc827589e2
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-01-26 09:39:21 +00:00
Nico Vertriest
d9bbf610a4 Doc: Added brief statement for examples overview page
Task-number: QTBUG-50261
Change-Id: Ia0daf0c5c7fc0b2e54904f0b7fe6ebe1220e5c4d
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-01-26 09:32:49 +00:00
Anton Kudryavtsev
520afea6b7 QTzTimeZonePrivate: optimize container usage in init().
Iteration over node-based containers is so slow that the number of passes
should be minimized.

Replace QList with QVector. Saves ~0.2 KBytes in text size with gcc 4.9.

Change-Id: I93298b29b06e4a38a6f716d85f127e0af4385461
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-26 09:24:29 +00:00
BogDan Vatra
63c88ae809 Android: Probe for virtual keyboard height
Knowing the real virtual keyboard height will be easier for us to
decide if we pan or resize the current view.
The virtual keyboard is re-shown if current virtual keyboard height
is different from previous one.

Task-number: QTBUG-43739
Change-Id: I1bb41a70cced4c1d0e5f05a6c554831459b7a917
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-26 09:01:28 +00:00
Lars Knoll
5550e310f9 Remove support for old/deprecated gl function names
These are nowadays standardized.

Change-Id: I3931859bba0b4c34a9336c7f537e3093e07d9b2d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-26 07:50:49 +00:00
Anton Kudryavtsev
6ca81d1fd1 QTranslator: don't re-create QString each time through a loop
Just cache it.

Also port to QStringLiteral, because the string is never modified.

Since the string literal is used in more than one function, to
avoid duplication of .rodata, wrap the QStringLiteral in an
inline function.

Change-Id: Ib5aede9f129610c80d122939afc343c938cc8e48
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-26 07:34:06 +00:00
Anton Kudryavtsev
037e58fff6 QVariant: replace QLatin1String with QStringLiteral
... in convert() to optimize string creation.

Change-Id: Id012f2f52606c026ed216655ff3ce63bd5154da6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-25 08:36:39 +00:00
Anton Kudryavtsev
7ee1fc4c29 QMimeData: use reserve in formats()
... to optimize memory allocation.

Change-Id: I039a6de6f97858f339b83ca7e3e361963eaa61ee
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-25 08:36:36 +00:00
Anton Kudryavtsev
451273523d QMimeData: replace QLatin1String with QStringLiteral
... wherever it allocates memory.

Change-Id: Ice17e39a138ff05b49eb23eecc693d368d0b349e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-25 08:36:34 +00:00
Thiago Macieira
a1ba281a26 Call out to QtDBus message spies in the main thread
Whenever there are spies installed, we call out to the main thread to
call to the kded/kiod message spies. This allows the spy code to do just
about anything, where previously it was restricted in what it could do
to avoid deadlocking or triggering assertions if it recursed back into
QDBusConnection code in the manager thread. After the spies are done,
the message is re-inserted into the QDBusConnection processing pipeline.

This commit moves the spy handling to after the check for disabled
dispatching, as doing otherwise would mean the message could get
postponed again for no good reason. It's also possible that the main
thread isn't done installing the hooks, so waiting until the dispatching
is enabled is a good idea.

For simplicity, this commit also restricts spying to method calls
only. Signals are no longer spyable.

Change-Id: I3d11545be52c43119f0fffff142b0e9d447415c2
Reviewed-by: David Faure <david.faure@kdab.com>
2016-01-25 07:32:04 +00:00
Dyami Caliri
5cac511908 Repaint QOpenGLWidget when screen changes
Commit 5c7f000cd4 greatly reduces the
number of repaints for QOpenGLWidget. Unfortunately, this included when
the widget changes screens.

Change-Id: Iaabcb94925e4519cb5d8561b47aaddcfdc7b01ac
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-24 18:26:27 +00:00
Dyami Caliri
c820692fc0 Fix tlw source rect transformation for backingstore blit.
The srcRect is already in device window coordinates. Converting it
again via deviceRect(QRect, QWindow) causes it to be overly large.

Task-number: QTBUG-50613
Change-Id: Iaae390499c0d1add842bde6eec22fb07c8de663b
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-24 18:26:20 +00:00
Borgar Ovsthus
fbd6acedac Add TeamCity logging feature to testlib
This allows TeamCity to parse realtime test-results instead of using
post-build XML Report Processing. This does not support logging of
benchmarks.

[ChangeLog][QTest] Added a new logging mode that allow test-results to
be parsed on-the-fly when using Jetbrains TeamCity as CI-server. This
mode is enabled by using the -teamcity option on the command-line.

Change-Id: Ie730beb643043eb0f448f99abe6c0b5ac48aaf03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-23 18:30:58 +00:00
Marc Mutz
2fed43d843 Q*Application: don't allocate memory just to compare C strings
Instead of creating a QByteArray, possibly normalizing a leading
'--' (one allocation, plus possibly one copy), simply use the
old 'ol str(n)cmp, skipping the first character if the argument
starts with '--'.

It also fixes parsing of -stylesheet and other options which
were erroneously parsed using indexOf() != -1, when they
should have used startsWith().

Also saves 504/742/522b in text size for QtCore/QtGui/QtWidgets,
resp., on optimized GCC 5.3 Linux AMD64 builds.

Change-Id: Ida868badac3fb9b77285417ee537c861ccc4fc06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-23 11:44:06 +00:00
BogDan Vatra
81d6906ad9 Android: Fix compile on arm64
Workaround Bionic bug.
Check https://code.google.com/p/android/issues/detail?id=194631 for more info.

Change-Id: Ib1abae37c94d4e76bb3bd633985c84128659bf4c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-23 09:09:22 +00:00
Thiago Macieira
9eda09f511 Uppercase the verbosity setting enums.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b9996fd77cb10
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-01-22 23:28:14 +00:00
Simon Hausmann
e782501532 Speed up QObject::connect with function pointers
When resolving the signal/slot of connect(&Foo::bar, ...) we place a meta-call
to map the address to the method index. Once we have found the index, we don't
need to continue but can return the result right away.

Change-Id: I67bb22df394d7c22dc1731367c0961b958ed77b3
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-22 21:50:01 +00:00
Rafael Roquetto
684e5587d5 QNX: Fix -developer-build
-developer-build enables -Werror=undef, which uncovered a bug inside
qcompilerdetection.h.

According to the Dinkum headers, it is necessary to account for three different states
concerning the values of the _HAS_* macros:

    1. undefined
    2. 0
    3. 1

Therefore, it is necessary to check both whether it is defined and if it is
not 0. Only checking whether a given macro is 0 will generate a trap by
-Werror=undef.

(__GLIBCXX__ is the sole exception).

Change-Id: Ib95e485698ee38858a1671d930d7e960b75bb041
Reviewed-by: James McDonnell <jmcdonnell@qnx.com>
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-22 18:06:39 +00:00
Morten Johan Sørvig
db2675d6fd Cocoa: Update QWindow::screen() on expose/show.
This is needed to correctly handle show on non-primary
screens.

Change-Id: I80b13372b3a92786987a66f0da385af6b4a6a863
Task-number: QTBUG-47950
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-01-22 13:16:59 +00:00
Anton Kudryavtsev
0f51686a69 QVariant: use reserve in convert()
... to optimize memory allocation.

Change-Id: I7f644955be779c3651683401a7985a265b69ca6f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-22 10:18:34 +00:00
Tony Sarajärvi
720d1792f2 Remove insignificant from qabstracttextdocumentlayout test
Task-number: QTBUG-28593
Change-Id: If5a102cd1c8cdad6d77cc8dbcece3ac983a8010b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2016-01-22 09:13:27 +00:00
Tony Sarajärvi
870e68cd75 Remove insignificant flag from qglyphrun test
Task-number: QTBUG-28593
Change-Id: I04e73947c7f131bdb4341c224fb008b26be22c22
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2016-01-22 09:13:20 +00:00
Thiago Macieira
7dceb22748 Autotest: make tst_QDateTime pass when LC_TIME != en_US
QDateTime::toString for Qt::TextDate unconditionally uses the system
locale (because QDate::shortDayName and QDate::shortMonthName do).
Setting the default QLocale has no effect. If you ask me, those two
QDate methods are buggy, but they are documented that way.

Change-Id: I408dcb81ba654c929f25ffff1427366b04da5a43
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-22 03:37:54 +00:00
Thiago Macieira
d921a9bd15 Hide better the private API QTextCursor constructors
Both constructors were taking a pointer, so they participated in
overload resolution along with QTextDocument and QTextFrame pointers.

Instead, make them take references and move them to the private section
of QTextCursor. That necessitated adding a method to QTextCursorPrivate
to access that private constructor from non-friend classes.

Change-Id: I7e6338336dd6468ead24ffff1410e3bc534d77dd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-01-22 03:36:16 +00:00
Thiago Macieira
cfe891eeb8 Add Intel copyright to files that Intel has had non-trivial contribution
I wrote a script to help find the files, but I reviewed the
contributions manually to be sure I wasn't claiming copyright for search
& replace, adding Q_DECL_NOTHROW or adding "We mean it" headers.

Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-21 22:44:21 +00:00