Commit Graph

27619 Commits

Author SHA1 Message Date
Oliver Wolff
04db3f28af Check if WINAPI_FAMILY_PC_APP is defined before using it
Not all Windows compilers (e.g. MinGW 4.9.2) have WINAPI_FAMILY_PC_APP
defined in their headers and report build failures in several
Qt modules including QtActiveQt. This is fixed by defining the needed
values before they are used.

Task-number: QTBUG-49971
Change-Id: Ib7bac1fe07eb76c64d66fa152427918ee39a2eef
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2016-03-04 12:15:35 +00:00
Kai Koehne
9a999eb7b0 Remove QT_MOC_COMPAT from deprecated QProcess::error signal
QT_MOC_COMPAT has the unfortunate behavior that it generates a warning
at runtime, which also cannot be disabled. This is too draconic.

Task-number: QTBUG-51517
Change-Id: I80af8b8b482671e4c9567281c3b1c504d737e202
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-03-04 12:07:23 +00:00
Timur Pocheptsov
840831b611 Cocoa integration - do not invalidate backing store on move
If window is only moving, there is no reason to reset a backing store,
otherwise with current expose/flush events machinery it's possible
to have glitches while moving a window programmatically.

Change-Id: Ia4408bd23388e529ae93617a92ae84304b707ca1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-03-04 12:03:24 +00:00
Marc Mutz
7d2c7ca8fa QFontEngine: use RAII for font_, face_ members
Wrap the pairs of (void *ptr, void (*dtor)(void*)) in essentially
a std::unique_ptr. This simplifies code and provides the correct
implicit destruction, so we can drop the explicit glyph-cache
clear()ing in ~QFontEngine(), leaving that job to ~QLinkedList.
A subsequent change will turn the QLinkedList into a C array, the
clearing of which would otherwise cause excessive code bloat.

Since we can't use std::unique_ptr, yet, provide a hand-rolled
replacement for now, marking it for replacement with unique_ptr
once we can use it. Make that a local type instead of providing
a Qt-wide unique_ptr so we don't accidentally lock ourselves into
a half-baked std clone we can't get rid of anymore.

To prepare unique_ptr use with the same type-erased deleter
(function pointer) as now, replace a nullptr destroy_function
with a no-op function, so ~unique_ptr doesn't crash when we
port to it later.

Because QFreetypeFace contains the same construct and shares
payloads with QFontEngine, use the Holder there, too.

Even saves 150b in text size on optimized GCC 5.3 AMD64 builds.

Change-Id: I5ca11a3e6e1ff9e06199124403d96e1b280f3eb2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-04 10:37:25 +00:00
Marc Mutz
5cd455dca3 QtNetwork: use printf-style qWarning/qDebug where possible (I)
The printf-style version of QDebug expands to a lot less code than the
std::ostream-style version. Of course, you pay in type safety (but
compilers warn about it these days), you cannot stream complex Qt
types and streaming QStrings is awkward, but in many cases you
actually improve on readability.

But the main reason is that something that's not supposed to be
executed under normal operation has no business bloating executable
code size.

This is not an attempt at converting all qWarnings() to printf-style,
only the low-hanging fruit.

In this first part, replace
   qWarning() << ""
with
   qWarning("...").

Saves ~850b in text size on optimized GCC 5.3 AMD64 builds.

Change-Id: Ib1a087795a03b2a6b432e2c499968df779aaea37
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2016-03-04 10:29:19 +00:00
Marc Mutz
600529e07a QtGui: use printf-style qWarning/qDebug where possible (I)
The printf-style version of QDebug expands to a lot less code than the
std::ostream-style version. Of course, you pay in type safety (but
compilers warn about it these days), you cannot stream complex Qt
types and streaming QStrings is awkward, but in many cases you
actually improve on readability.

But the main reason is that something that's not supposed to be
executed under normal operation has no business bloating executable
code size.

This is not an attempt at converting all qWarnings() to printf-style,
only the low-hanging fruit.

In this first part, replace
   qWarning() << "...";
with
   qWarning("...");

In QTransform shared warning strings.

Saves 3KiB in text size on optimized GCC 5.3 AMD64 builds.

Change-Id: I142a8020eaab043d78465178192f2c8c6d1cc4f9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2016-03-04 10:29:08 +00:00
Allan Sandfeld Jensen
b6b3803b21 Optimized fetchUntransformed RGB888
Reuses the optimized routines from qimage to make painting RGB888
images faster on SSSE3 and NEON.

Change-Id: I99116b318322ba4cb0ddc2cb90bcf17a0350ef99
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-03-04 10:14:37 +00:00
Marc Mutz
fd941ebb6f QHttpNetworkConnection: fix expensive iteration over QMultiMap::values()
Just iterate over the container instead, saving one
iteration and the creation of a temporary QList.

Change-Id: I564e3e83cb247a12c413fc5a9dc17299ae089e30
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-04 09:38:23 +00:00
Gabriel de Dietrich
5a56bf4104 QXcbNativeIntegration: Add query for compositing enabled
Task-number: QTBUG-41195
Change-Id: I4f37c82f6757283ed58b38c7fd47849fb4810bce
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-03-04 09:37:23 +00:00
Fredrik de Vibe
48f25caac4 Check if socketEngine is set before accessing it.
QTcpServer::addPendingConnection() is protected, so it is possible to
add pending connections from a class derived from QTcpServer. This
derived class can get a QTcpSocket from somewhere else, in which case
d->socketEngine will not be set (or used). Given that it is possible to
add pending connections in this scenario, it would make sense to be able
to retrieve them as well.

[ChangeLog][QtNetwork][QTcpServer] Permit using a QTcpServer with
externally created QTcpSocket.

Task-number: QTBUG-51288
Change-Id: I830c10f1a881e2bca4e4ad716d8be865e1c27a9f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-04 08:11:54 +00:00
Anton Kudryavtsev
089ed1525e QtNetwork: optimize container usage
Don't perform lookup twice. Just cache iterator
or position.

Change-Id: I454fd292614dee62167ff248fc3ddec0f79435b0
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-03-03 20:21:17 +00:00
Anton Kudryavtsev
37d89fd8fb QBearerEngine: break out repeated loops as methods.
Three hashes are handled similarly; so extract the loops over them as
methods hasUsedConfiguration() and cleanUpConfigurations() to avoid
duplicate loop code.

Change-Id: I1040724c4fc98caa48913fac339c03e60b04bae2
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-03-03 20:21:05 +00:00
Marc Mutz
53abb8267b QtGui: mark some more types as movable/primitive
These are already held in QVectors.

Public API types need to wait until Qt 6, for BC reasons. Even
though Q_RELOCATABLE_TYPE deals with most of them, we lack a way
to mark a type as primitive, but still isStatic - for QList.

Change-Id: I91392b01ae6f94cc847007636e12d4e64c43b2bc
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-03-03 16:22:27 +00:00
Anton Kudryavtsev
e2a7d18564 QHostAddress: enable (N)RVO in toString() for gcc
Change-Id: I5f8d72742cc4199bfa73df6037b851c58632ff86
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
2016-03-03 15:52:33 +00:00
Louai Al-Khanji
99b2223406 xcb: Be smarter about how we flush
For the remote X case the backing store previously always reuploaded
image data for every expose event. Instead of doing that create a remote
X pixmap and only flush repainted regions. For regular expose just copy
from the pixmap.

Additionally, atomically update the window by setting a clip mask and
flushing the entire region at once instead of doing it rect by rect.

Change-Id: I26bb1834b159e309c7ad93287dd297769f7e2633
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-03 14:46:10 +00:00
Anton Kudryavtsev
0fb7e910a9 QLocalServer, QLocalSocket: simpler use of startsWith()
It has a variant accepting QL1S directly, so
no need to go via a QString.

Change-Id: Ia8f1198ef2af7027bc9f7c2e1dad3a5f78a12eb4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
2016-03-03 11:48:39 +00:00
Anton Kudryavtsev
06e27b6ef9 QtNetwork: optimize if-else conditions.
De-duplicate calls by caching results.
Reorder conditions: call cheap methods first.

Change-Id: I27715b935247c6c21bd02f9cc40655d3f9371264
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-03-03 11:48:22 +00:00
Thiago Macieira
d0cdc7ad1e DirectFB: Fix build in C++98 mode
Many DirectFB types have constructors in C++, so we can't initialize
them with = {...}, like we would be able to if they had been regular POD
types.

Change-Id: Ic747cc2ab45e4dc6bb70ffff143840e5780ac2bc
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2016-03-03 11:35:22 +00:00
Milian Wolff
fdd2ab58ae Fix compile with clang and -Werror.
Fixes the following warning/error:

src/sql/drivers/sqlite2/qsql_sqlite2.cpp:142:19: error: unused variable
  'initial_cache_size'
      [-Werror,-Wunused-const-variable]
static const uint initial_cache_size = 128;
                  ^
1 error generated.

Change-Id: I4ed7f789561dd9b68dd374c122f4db3813e63e05
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
2016-03-03 10:33:43 +00:00
Milian Wolff
954bd06bc5 Use local result metric instead of global result metric.
This is required for a follow-up commit which adds support for reporting
multiple results in a single benchmark interation.

Change-Id: I8dd7f37ce046cc0f9556be5d0df76f84b82ec1a7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-03-03 09:56:08 +00:00
Milian Wolff
8619214c5e Optimize QMetaObject::activate.
The code is restructured to only loop over the non-empty connection
lists. This can be checked early while the mutex is locked already,
thus removing mutex lock/unlock calls that were done previously just
to realize the allsignals list is empty and can be skipped.

Additionally, at the very end of the loop over the last signal
connection list, the mutex was acquired even though it doesn't need
to be as we will quit the loop anyways.

This patch leverages these facts to remove the mutex locks which alone
has a considerable impact on the corresponding signal/slot benchmark.
The instruction count goes down by ca. 13%, while cycle count and
runtime drop by about 29%.

Before:

********* Start testing of QObjectBenchmark *********
Config: Using QtTest library 5.7.0, Qt 5.7.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.0)
PASS   : QObjectBenchmark::initTestCase()
PASS   : QObjectBenchmark::signal_slot_benchmark(simple function)
RESULT : QObjectBenchmark::signal_slot_benchmark():"simple function":
     0.00000362 msecs per iteration (total: 362, iterations: 100000000)
     14.05652884 CPU cycles per iteration (total: 1,405,652,884, iterations: 100000000)
     21.00585673 instructions per iteration (total: 2,100,585,673, iterations: 100000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(single signal/slot)
RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/slot":
     0.00004709 msecs per iteration (total: 4,709, iterations: 100000000)
     183.75943370 CPU cycles per iteration (total: 18,375,943,371, iterations: 100000000)
     362.08604759 instructions per iteration (total: 36,208,604,760, iterations: 100000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(multi signal/slot)
RESULT : QObjectBenchmark::signal_slot_benchmark():"multi signal/slot":
     0.00004965 msecs per iteration (total: 4,965, iterations: 100000000)
     183.54556242 CPU cycles per iteration (total: 18,354,556,243, iterations: 100000000)
     362.07734835 instructions per iteration (total: 36,207,734,835, iterations: 100000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(unconnected signal)
RESULT : QObjectBenchmark::signal_slot_benchmark():"unconnected signal":
     0.00000752 msecs per iteration (total: 752, iterations: 100000000)
     30.08781366 CPU cycles per iteration (total: 3,008,781,367, iterations: 100000000)
     92.01520465 instructions per iteration (total: 9,201,520,466, iterations: 100000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(single signal/ptr)
RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/ptr":
     0.00005620 msecs per iteration (total: 5,620, iterations: 100000000)
     219.24739264 CPU cycles per iteration (total: 21,924,739,265, iterations: 100000000)
     327.08675555 instructions per iteration (total: 32,708,675,556, iterations: 100000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(functor)
RESULT : QObjectBenchmark::signal_slot_benchmark():"functor":
     0.00005852 msecs per iteration (total: 5,852, iterations: 100000000)
     218.45401359 CPU cycles per iteration (total: 21,845,401,360, iterations: 100000000)
     328.08472410 instructions per iteration (total: 32,808,472,410, iterations: 100000000)
PASS   : QObjectBenchmark::cleanupTestCase()
Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted, 44469ms
********* Finished testing of QObjectBenchmark *********

After:

********* Start testing of QObjectBenchmark *********
Config: Using QtTest library 5.7.0, Qt 5.7.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.0)
PASS   : QObjectBenchmark::initTestCase()
PASS   : QObjectBenchmark::signal_slot_benchmark(simple function)
RESULT : QObjectBenchmark::signal_slot_benchmark():"simple function":
     0.00000361 msecs per iteration (total: 361, iterations: 100000000)
     14.01854817 CPU cycles per iteration (total: 1,401,854,818, iterations: 100000000)
     21.00532932 instructions per iteration (total: 2,100,532,933, iterations: 100000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(single signal/slot)
RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/slot":
     0.00003398 msecs per iteration (total: 3,398, iterations: 100000000)
     132.52735104 CPU cycles per iteration (total: 13,252,735,104, iterations: 100000000)
     314.04965106 instructions per iteration (total: 31,404,965,107, iterations: 100000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(multi signal/slot)
RESULT : QObjectBenchmark::signal_slot_benchmark():"multi signal/slot":
     0.00003448 msecs per iteration (total: 3,448, iterations: 100000000)
     133.63623046 CPU cycles per iteration (total: 13,363,623,046, iterations: 100000000)
     314.04952237 instructions per iteration (total: 31,404,952,238, iterations: 100000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(unconnected signal)
RESULT : QObjectBenchmark::signal_slot_benchmark():"unconnected signal":
     0.00000747 msecs per iteration (total: 747, iterations: 100000000)
     29.02349389 CPU cycles per iteration (total: 2,902,349,390, iterations: 100000000)
     92.01088221 instructions per iteration (total: 9,201,088,222, iterations: 100000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(single signal/ptr)
RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/ptr":
     0.00004350 msecs per iteration (total: 4,350, iterations: 100000000)
     167.83581885 CPU cycles per iteration (total: 16,783,581,885, iterations: 100000000)
     279.06426656 instructions per iteration (total: 27,906,426,657, iterations: 100000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(functor)
RESULT : QObjectBenchmark::signal_slot_benchmark():"functor":
     0.00004337 msecs per iteration (total: 4,337, iterations: 100000000)
     170.45074743 CPU cycles per iteration (total: 17,045,074,743, iterations: 100000000)
     280.06267229 instructions per iteration (total: 28,006,267,229, iterations: 100000000)
PASS   : QObjectBenchmark::cleanupTestCase()
Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted, 33228ms
********* Finished testing of QObjectBenchmark *********

Change-Id: I6f79fd68ae7a07d9b439ca047bf1f53c83751d45
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-03-03 09:55:56 +00:00
Milian Wolff
fe04aba46d Enable support for ref-cycles perf counter in QtTestLib.
The ref-cycles counter corresponds to the monotonic timestamp counter
that can be read using the RDTSC assembler instruction. Using it
instead of the default cycles counter is useful as it removes the
effect of dynamic frequency scaling on the measurement.

[ChangeLog][QtTest] The ref-cycles perf counter can now be used.

Change-Id: Id7d56576db362706c20f9a399e5acea35ee799f2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-03-03 09:55:22 +00:00
Tony Sarajärvi
43e535dd6f Blacklist tst_qnetworkreply tests that fail in RHEL 7.1
Task-number: QTBUG-51545
Change-Id: I0f5fdef315f87401ca5e638bce5dd2dbe85bcb83
Reviewed-by: Akseli Salovaara <akseli.salovaara@theqtcompany.com>
2016-03-03 09:17:44 +00:00
Joerg Bornemann
2b2232b5ea Speed up tst_QLocalSocket::sendData
The data function for this test re-used listenAndConnect_data that
has an additional column "connections" which was never used in sendData.
Thus sendData executed three times the same code which is just uselessly
burned CI time.
Copied the actually needed code of listenAndConnect_data to sendData_data.

Change-Id: I6cdb1c1b72cb4ce7be7c13e90eea30ac09a14914
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-03-03 08:25:04 +00:00
Marc Mutz
1bd24e5b0c QtGui: Mark some more types as shared for Qt 6.
Marking them shared (which implies movable) now
would make QLists of these BiC.

Change-Id: If5638e8d9f43e0ad549aedf08934de31e1e189f1
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-03-03 07:53:12 +00:00
Marc Mutz
0077435897 QMainWindowLayout: eradicate Q_FOREACH loops: Extract Method allMyDockWidgets()
Extract a loop repeated four times in the code into a
separate function. Port to use C++11 range-for loops
and not create temporary QLists.

Saves 2.4KiB in text size on optimized GCC 5.3 Linux
AMD64 builds.

Change-Id: I7eb78ffaac33627b595e35cafb6ce0769fb760a8
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-03 07:53:09 +00:00
Marc Mutz
fb591c7366 QStringBuilder: don't allocate memory in convertFromAscii()
Use new QUtf8::convertToUnicode(QChar*, const char*, int)
overload instead of QString::fromUtf8(). The QUtf8 overload
allocates no memory, and is therefore marked as nothrow.

Using this function in convertFromAscii() allows to mark
this function nothrow, too.

All functions of QAbstractConcatenable can now be marked as
nothrow.

Since QUtf8::convertToUnicode() does not deal with lengths
of -1, insert a strlen() call when the len == -1 ASCII fast
path fails due to non-ASCII chars.

Saves 1.1KiB in text size on optimized GCC 5.3 Linux AMD64
builds of QtCore (other libraries are compiled without
exceptions, so this change should not have an effect on
those).

Change-Id: I7333e35844033831eae2a04203d13d9792c5d460
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-03-03 07:53:01 +00:00
Joerg Bornemann
007039eae9 Don't include <windows.h> in the Windows CE qplatformdefs.h
This header defines "interface" which will break compilation of dbus.

Change-Id: I16fa35f822adca14304aa827b047358409d4a150
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-03-03 04:47:26 +00:00
Robin Burchell
76f6ceec36 mkspecs: Add a benchmark "feature".
Testcases and benchmarks are rather different entities. You won't usually want
to run benchmarks in the same environment you are wanting to run tests in,
so this feature allows to differentiate between the two.

We also add a "benchmark" make target (similar to check), which runs all
configured benchmarks.

Change-Id: I33759ce44c34e42a6a3a88f34e7b9c4372380721
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-03-02 21:24:54 +00:00
Marc Mutz
9c1d3bc253 QtOpenGL/plugins/platformsupport: use new QRegion::begin()/end() instead of rect()
Saves e.g. ~900b and ~2900b in text size in QtOpenGL and
XcbQpa libs, resp., on optimized GCC 5.3 Linux AMD64 builds.

Change-Id: Id904689164ca32df41118a23747c70048d8e6604
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-02 21:01:00 +00:00
Marc Mutz
9d3a415562 QtWidgets: use new QRegion::begin()/end() instead of rect()
Saves ~600b in text size on optimized GCC 5.3 Linux AMD64 builds.

Change-Id: Ib542a128982fc53638780945014d903f2cbee9c3
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-02 21:00:50 +00:00
Gabriel de Dietrich
afe3c30759 Don't create accessible interface for QWidgets being destroyed
Change-Id: I975ee556913707e8595b2a89f1bba4299187bcfb
Reviewed-by: Wayne Arnold <wayne.arnold@autodesk.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-03-02 19:26:06 +00:00
Anton Kudryavtsev
3ec093a758 QOpenGLTexture: de-duplicate setBorderColor() code
Change-Id: I6864e227fceb133903979ac8f7a7434fc3e280bf
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-03-02 19:23:44 +00:00
Dan Cape
36ecf2c025 Fix QTextEdit/QQuickTextEdit undo bug - Part #2
If a user selected the text "foo" and typed "bar", upon pressing undo,
the text would change to "b". This is incorrect and does not match the
functionality of QLineEdit or the default behaviours of Windows/OSX/Ubuntu.
This was fixed by a change made to always merge two sequential inserts
if they are not part of the same block. Previously the selection delete
and the "b" were part of one edit block and "ar" was part of another.
With this change, the selection delete and "bar" are part of the same
edit block.

Unit test changes are part of a separate review (Part #1) since they
required changes in qtdeclarative.

[ChangeLog][QtGui][Important Behavior Changes] Fixed QTextEdit to match
undo functionality of QLineEdit to group two sequential inserts into one
undo action.

Task-number: QTBUG-38825
Change-Id: I76bf30e331e3526277c3e0ade58cf95b611fc117
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2016-03-02 16:00:02 +00:00
Friedemann Kleint
0aed4fd941 tst_qimagewriter: Fix leaking temporary files.
Add missing slash to the prefix pointing to the temporary directory.

Change-Id: I0d00f706af58214a9922758a60d097cab7d6bc9d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-03-02 14:53:08 +00:00
Friedemann Kleint
52a5ffb505 QMimeBinaryProvider::loadMimeTypePrivate(): Make name check case insensitive.
RFC 2045 mandates case-insensitive comparison for MIME type and subtype.
Fixes numerous warnings appearing when dumping the database on
Ubuntu 14.04.1 LTS:

Got name "application/vnd.ms-excel.sheet.binary.macroenabled.12" in file "application/vnd.ms-excel.sheet.binary.macroEnabled.12.xml" expected "application/vnd.ms-excel.sheet.binary.macroEnabled.12"
Got name "application/vnd.ms-excel.sheet.macroenabled.12" in file "application/vnd.ms-excel.sheet.macroEnabled.12.xml" expected "application/vnd.ms-excel.sheet.macroEnabled.12"
Got name "application/vnd.ms-excel.template.macroenabled.12" in file "application/vnd.ms-excel.template.macroEnabled.12.xml" expected "application/vnd.ms-excel.template.macroEnabled.12"
Got name "application/vnd.ms-powerpoint.presentation.macroenabled.12" in file "application/vnd.ms-powerpoint.presentation.macroEnabled.12.xml" expected "application/vnd.ms-powerpoint.presentation.macroEnabled.12"
Got name "application/vnd.ms-powerpoint.template.macroenabled.12" in file "application/vnd.ms-powerpoint.template.macroEnabled.12.xml" expected "application/vnd.ms-powerpoint.template.macroEnabled.12"
Got name "application/vnd.ms-word.document.macroenabled.12" in file "application/vnd.ms-word.document.macroEnabled.12.xml" expected "application/vnd.ms-word.document.macroEnabled.12"
Got name "application/vnd.ms-word.template.macroenabled.12" in file "application/vnd.ms-word.template.macroEnabled.12.xml" expected "application/vnd.ms-word.template.macroEnabled.12"

Change-Id: Ie2a427069024080302a95ac46a456288787542c4
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2016-03-02 14:52:59 +00:00
David Weisgerber
acba844c6b Fixed reading REG_SZ without terminating \0 delivers garbage
When reading from the registry, sometimes the string is not null
terminated. In order to fix this, the preallocated QByteArray size
is increased, so that there are guaranteed enough terminating \0

[Windows] Not null terminated strings are now read properly from the
registry

Change-Id: I95fdf42cbbb7074fcf010dd14d0241f02d3c412b
Task-number: QTBUG-51382
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-03-02 14:33:44 +00:00
Andy Shaw
82b8158022 Windows: Extract the suffix from the simple file filter case
Since the filter can either be something like "*.txt" or "Text Files
(*.txt)" then it should have the suffix default to "txt" in both cases.

Change-Id: I36a72f5bf0fb12c84db103f91c4fca94d0d933ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-03-02 14:24:45 +00:00
Laszlo Agocs
752e85947c Restore multisampled FBOs on ANGLE
The function resolving changes remove the special treatment for ES 3.0+
contexts, meaning that now all functions get resolved in the same way
irrespective of the current context.

For blitFramebuffer and renderbufferStorageMultisample this presented an
issue with ANGLE. There these functions are available both as an ANGLE
extension and as standard ES 3.0 functions. The latter are not functional
however in 2.0 contexts. We expect multisampled FBOs to work in 2.0
contexts too by prefering the ANGLE extension with 2.0 contexts.

Change-Id: I0a4b70e6d39c84d4b1f61f8fd0655d7326419a2a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-02 12:16:27 +00:00
Lars Knoll
696dc4f6df Simplify and speed up code resolving gl functions
Change-Id: I36d8881b658760dde18e4f52742c49f3c0cab7a5
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-02 12:16:23 +00:00
Lars Knoll
69f29b9032 Clean up resolving of OpenGL functions on Windows
Always try both e/wglGetProcAddress and ::GetProcAddress to
resolve the methods. Like this QOpengGLContext::getProcAddress is
able to return any OpenGL entry point, and we can both simplify
the code we have in the QPA backend as well as get rid of windows
specific code paths in Qt Gui.

Task-number: QTBUG-39531
Change-Id: I1ddf1b0974f69b56b219a619655b723eb0134b14
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-02 12:16:15 +00:00
Lars Knoll
6b0a577bf8 Refactor initialization/caching code for versioned opengl functions
Saves around 80k in Qt Gui.

Change-Id: I3f7068ae699136d0edf46a49694ade7e1df3c91d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-02 12:16:05 +00:00
Oswald Buddenhagen
3bcc303711 fix non-git non-prefix shadow builds
turns out we need forwarding .pris in this case: without them,
QT_MODULE_INCLUDE_BASE points into the build dir, so we fail to find the
pre-generated headers.

an alternative would be writing primary module .pris which already take
that into account, but that would just add even more arcane code paths.

Task-number: QTBUG-51521
Change-Id: I59f2a0d3f2095c9dfa0a8d1cabfc007a30bd2d23
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-03-02 11:06:39 +00:00
Alex Trotsenko
0db793fe41 QAbstractSocket: fix a possible crash in waitForReadyRead()
waitForConnected() could return 'true' even when the socket was
disconnected.

Change-Id: I99d9c9730f4e9b6c8a54696eb92c24c3ef36d261
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2016-03-02 11:04:03 +00:00
Jan Arve Sæther
8f1fcb0142 Adjust sizes when snapping layout items to pixel grid
When "importing" the size hints into the cells, make sure that
the cells minimum sizes are ceiled up to the closest integer.

Change-Id: Id00177468e8b1e12bc1231c7351b2136f94f7300
Task-number: QTBUG-41216
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2016-03-02 08:54:11 +00:00
Lars Knoll
d56203436a Use an enum for versioning the opengl function backends
Saves some code, is easier to maintain and will allow for some
more nice refactoring.

Change-Id: Ica7ae8e9d36acbe6586e488bc6aff114336c65bb
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-03-02 08:50:33 +00:00
Friedemann Kleint
235c1c776a Fix test tst_QIcon::fromThemeCache().
Verify that the temporary directory could be created. Check whether
the gtk-update-icon-cache binary exists before running and skip cleanly.
Check successful execution. Fixes Windows warnings:

SKIP   : tst_QIcon::fromThemeCache() gtk-update-icon-cache not run
.\tst_qicon.cpp(707) : failure location
QWARN  : tst_QIcon::fromThemeCache() QTemporaryDir: Unable to remove "D:\\temp\\tst_qicon-DSSn9G" most likely due to the presence of read-only
files.

Change-Id: Ibc8f883121e62b30d71586bc64b42eb6c480925f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-03-02 07:14:47 +00:00
Romain Pokrzywka
359546b069 evdevtouch: ensure touchpoints released with typeB mtdev drivers
This happens in one particular case: when the touchpoint corresponding
to the last slot is reported as released and a new point is reported
as pressed right after, so that both events happens within a same sync.
In this case, there will be two ABS_MT_TRACKING_ID events received,
first with -1 to report the released touchpoint, then with a new id
to report the pressed touchpoint, then the SYN_REPORT afterwards.

This results in m_contacts[m_currentSlot].state being updated to
Qt::TouchPointReleased then Qt::TouchPointPressed, with the former never
being reported during the handling of SYN_REPORT.
To handle this scenario we need to inspect m_lastContacts for a change
in tracking id for a particular slot combined with a non-null state,
indicating that slot has not yet been reported released and processed
in the previous sync. (the state for processed released points is reset
to zero at the end of the SYN_REPORT handler)

Task-number: QTBUG-51563
Change-Id: I01493008cf9f267e758d974dab29556d0a1425ea
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-03-02 06:34:06 +00:00
Vincas Dargis
361142b5fc PostgreSQL: Fix memory leak in subscribeToNotification() and unsubscribeFromNotification()
Both subscribeToNotification() and unsubscribeFromNotification() are missing PQclear calls
to free PGresult.

Task-number: QTBUG-51412
Change-Id: I72ec3438b22bc99205c984b67b922766bcdbed08
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-03-01 22:46:16 +00:00
Alex Trotsenko
6691df5336 QAbstractSocket::flush(): remove manual polymorphism
... by making a function in the private class virtual.

Change-Id: I45c25c6c59511a8e8821ca96b0cf28cbf1b2f267
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2016-03-01 18:32:46 +00:00