Commit Graph

27466 Commits

Author SHA1 Message Date
Oswald Buddenhagen
867357235e delay application of configure -D/-I/-L/-l/-R flags
it is important that the flags coming from the current qt build appear
first, as otherwise a pre-existing qt installation may interfere with
the build.

the windows configure does not have any of this magic to start with.

Task-number: QTBUG-6351
Change-Id: Iacc1d9b5aa9eed9a5f0513baef9f6c6ffcef0735
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-03-16 15:08:23 +00:00
Oswald Buddenhagen
c27d4eeac6 don't force our runpath upon user projects anymore
now that we rely on consistently sane runpath semantics everywhere
(--enable-new-dtags on linux; the default elsewhere), there is no use
in forcing our runpath downstream: our libraries will find their
dependencies due to their embedded runpath.

this does not affect qt.prf adding qt's own library path to the user
projects' runpath.

this effectively reverts 42a7eb8df6, and some more.

Change-Id: If7af7be7b7a894bebb9b146ccb0035452223c7ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-03-16 15:07:43 +00:00
Oswald Buddenhagen
523c7e3fd5 build with explicitlib after all
unlike speculated in 2fe363514, this is not a workaround at all: it
causes that libraries' public link interfaces (LIBS) are exported in the
first place. unlike with staticlib, this does not export LIBS_PRIVATE,
so it wouldn't even be a particularly effective workaround for rpath
brokenness anyway.

the problem was pretty well hidden by the qt module system, which at the
level of libraries is pretty redundant with the .prl file handling,
which shows just how stupid the whole "design" is.

unlike before, we now enable explicitlib for all libraries, not just qt
modules - we enable create_prl for all of them as well, after all.

an immediate effect of this change is that it fixes linking on RaspPI:
the qtcore headers make the user code require linking libatomic, so we
must add it to our public link interface.

Task-number: QTBUG-51621
Change-Id: I5742c88694db8e8a9b79d17222dc6df2b38e5ab2
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-03-16 15:07:09 +00:00
Jochen Seemann
b8e8c6ad5c winrt: enable cross-platform high DPI scaling
Task-number: QTBUG-46615
Change-Id: I7f75bc7da35b9330753130338a06feb49533061c
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2016-03-16 14:41:58 +00:00
Friedemann Kleint
ca4c33a886 Manual High DPI test: Create Dnd pixmap with device pixel ratio.
Apply the device pixel ratio from the widget unless Shift is pressed.

Task-number: QTBUG-46068
Task-number: QTBUG-50938
Change-Id: Ib806b7e545fa228043566800d22d1002728732bf
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-03-16 14:40:15 +00:00
Eirik Aavitsland
714cb4020e Update bundled libpng to version 1.6.20
Merged in the upstream version. The remaining diff to clean 1.6.20 is
archived in the qtpatches.diff file.

Change-Id: I56f557bfe04ac1aa0e2c090826bbb144ae93cbb7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2016-03-16 14:32:49 +00:00
Mitch Curtis
10a4151e83 Fix link to sched_setscheduler in QThread documentation
Change-Id: I38412a119d2a91685b3fd2e4a459d33a60b154b0
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-03-16 11:57:05 +00:00
Allan Sandfeld Jensen
f8f3f0fbd4 Correct qt_defaultDpi X/Y with just a QCoreApplication
Makes the 96DPI attribute check avoid undefined behavior by using
QCoreApplication::instance() directly, instead of calling through
qApp, which performs an invalid cast to QGuiApplication.

Change-Id: Ib86e7d2461b462a2d623f1364414f7d4d2293f22
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-03-16 10:37:39 +00:00
Maurice Kalinowski
e7cd32274e WinRT: Fix QTimeZone transitions by switching backend
Previously WinRT was using the UTC backend which fails on all platforms
for some QDateTime autotests related to timezone items. Hence switch to
the Windows implementation for WinRT as well.

However, the windows backend does query the registry heavily, which is
not supported on WinRT. Instead use the API version provided by the SDK.

Long-term we might want to switch to this version on desktop windows as
well, as direct registry access would not be required and we could
harmonize the codepaths for both platforms.

Change-Id: I620b614e9994aa77b531e5c34c9be1da7e272a30
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-03-16 10:30:26 +00:00
Oliver Wolff
7e72a5e11e winrt: process all triggered timers in processEvents
If only one timer is processed in there it is possible that a reoccuring
timer which has a very low timeout blocks all the other timers from
being triggered. This high frequency timer might be the only one to
be triggered in every processEvents call.

Task-number: QTBUG-51888
Change-Id: I8a0026d1e8519171ab60d1b47c494a15d30328b3
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2016-03-16 10:26:16 +00:00
Friedemann Kleint
9c3c350627 Manual High DPI test: Add test for window masks.
Add a toggle for setting a triangular mask on the main window.

Task-number: QTBUG-50938
Change-Id: Id4a3ee0b80e170f4ee1d195e60ce7bfa8e524359
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-03-16 09:19:59 +00:00
Maurice Kalinowski
e830fa8fc2 tst_QXmlStream::writerHangs(): Create file in temporary directory
A test should not write to its directory.

Change-Id: I34dfc36387cf5a637b325be29c8a19ff51d9b9c3
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-03-16 08:15:59 +00:00
Maurice Kalinowski
eef3afaa97 QTextStream test: Change current directory
For platforms with builtin testdata/sandboxed platforms we need to
change the current directory to be able to create files.

Change-Id: I440205c95dd6df1308c6bf24b1b0f67fd697feab
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-03-16 08:16:03 +00:00
Milla Pohjanheimo
e363817498 tst_qtabbar sizeHints fix
tst_qtabbar uses fixed values to check the minimumSizeHint and it fails
with screens that have a higher resolution. The test still uses the
default values, but now in the beginning it creates enough tabs so that
it goes over the default.

Change-Id: I3f891d2661288d7fad50ad522d73f634b3e91958
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2016-03-16 07:39:22 +00:00
Joerg Bornemann
5393ba970b Remove handle duplication code from QWindowsPipeWriter
There is no apparent reason why the handle should be duplicated.

Change-Id: I8ff2cde2f050934ed0dd9ab2d39a1b1efa327a17
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-03-15 20:15:11 +00:00
Shawn Rutledge
6c53f2528c xcb: Initialize all xcb_client_message_event_t members before use
Change-Id: I01e4b69b138fd19fc7e67751d93adebc1326b2f9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-03-15 19:58:40 +00:00
Sean Harmer
ad9726d99c Dedupe QMetaObject::cast
By implementing in terms of QMetaObject::inherits().

Change-Id: I39a039539b05a20bc1713bd450d8a998c78433aa
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-03-15 16:36:25 +00:00
Sean Harmer
aa21ac1043 Add a function to QMetaObject to check for inheritance
This is analogous to QObject::inherits() but only requires the
metaobjects rather than pointers to a QObject instances. This is needed
for type checking on the backend of Qt 3D where we do not have access
to QObject pointers.

Change-Id: I14d26c4cbb5cc3fbecb57725f2c14ee0ffda4a11
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-15 16:36:22 +00:00
Marc Mutz
e4c6d73f92 QRect: fix UB (int overflow) in center()
QRect::center() should be defined for any
  QRect(x1,y1,x2,x2), INT_MIN <= x1, x2, y1, y2 <= INT_MAX
because the average of two signed integers is always
representable as a signed integer.

But not when it's calculated as (x1+x2)/2, since that
expression overflows when x1 > INT_MAX - x2.

Instead of playing games with Hacker's Delight-style
expressions, or use Google's patented algorithm, which
requires two divisions, take advantage of the fact that
int is not intmax_t and perform the calculation in the
qint64 domain. The cast back to int is always well-
defined since, as mentioned, the result is always
representable in an int.

Fix a test-case that expected a nonsensical result due
to overflow.

[ChangeLog][QtCore][QRect] Fixed integer overflow in
center(). This fixes the result for some corner-cases
like a 1x1 rectangle at (INT_MIN, INT_MIN), for which
the previous implementation could return anything
(due to invoking undefined behavior), but commonly
returned (0, 0).

Change-Id: I1a885ca6dff770327dd31655c3eb473fcfeb8878
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-15 11:23:46 +00:00
Morten Johan Sørvig
1dcc53f6fa Compile with -no-opengl
QCocoaBackingstore::toImage() can only be Q_DECL_OVERRIDE
if QPlatformBackingStore::toImage() is present, which
it isn’t for NO_OPENGL builds.

Change-Id: Ib116f40fd26defb29a8d520d3e3fb104d8da8d57
Task-number: QTBUG-51694
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-03-15 10:55:41 +00:00
Marc Mutz
5784c064a9 tst_QRect: drop a test that depends on int overflow
The compiler can statically check that this is undefined
behavior:

  tst_qrect.cpp:3173:52: warning: integer overflow in expression [-Woverflow]
               << QRect(QPoint(0,0), QPoint(INT_MAX+(0-INT_MIN),INT_MAX+(0-INT_MIN)));
                                                   ~^~
  tst_qrect.cpp:3173:72: warning: integer overflow in expression [-Woverflow]
               << QRect(QPoint(0,0), QPoint(INT_MAX+(0-INT_MIN),INT_MAX+(0-INT_MIN)));
                                                                       ~^~

Fix by skipping the test (like most of the others are
in the block).

Change-Id: I359a5e16db6c660c9f11d7dd8fbb40730bd63887
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-15 10:39:38 +00:00
Marc Mutz
b4fa18a996 Revert "Handle the QWidgetPrivate::mapper structure"
This reverts commit 90de48493be283b9afb249f6a0fd8dbd8958517d.

The call isn't necessary, but invokes undefined behavior.

It invokes undefined behavior because deleteTLSysExtra() is called
from deleteExtra(), which is called from ~QWidgetPrivate(), which is
called from ~QObject(). Thus, by the time we call q->windowType()
within setWinId(), q is no longer a QWidget, but only a QObject, and
calling a QWidget member function then is UB.

UBSan confirms:

  qwidget_p.h:300:5: runtime error: downcast of address 0x2afdd4053620 which does not point to an object of type 'QWidget' (the Q_Q macro)
  0x2afdd4053620: note: object is of type 'QObject'
  qwidget.cpp:1712:93: runtime error: member call on address 0x2afdd4053620 which does not point to an object of type 'QWidget'
  0x2afdd4053620: note: object is of type 'QObject'

It is also unnecessary:

deleteTLSysExtra() is called from two places: QWidget::destroy() and
deleteExtra(). deleteExtra() is only called from ~QWidgetPrivate()
which is only called from ~QObject() called by ~QWidget(), which,
however, already calls QWidget::destroy(). QWidget::destroy(), in
turn, unconditionally (for non-desktop widgets, at least) calls
setWinId(0) itself.

So fix the UB by removing the call without replacement.

Conflicts:
	src/gui/kernel/qwidget_qpa.cpp

Change-Id: Ib3a8cc9d28a096183f1d3dfd1941ea5fdc6a4aac
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-03-15 10:39:31 +00:00
Marc Mutz
9739cae4c8 QRawFont: fix UB (misaligned load) in fontTable()
Found by UBSan:

  qrawfont.cpp:618:60: runtime error: load of misaligned address 0x2acee92a5569 for type 'const quint32', which requires 4 byte alignment

Fix by using MAKE_TAG(), like everywhere else, instead
of a load through a type-punned and misaligned pointer.

Change-Id: I52b88ca05a57f7d8c5e5bce953384de49514079b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-15 10:39:24 +00:00
Marc Mutz
add95c5510 tst_QSqlQuery: fix UBs (invalid downcasts, member calls)
The existing code derived a helper class from QSqlResult and
overloaded two protected functions as public ones so the test
could call them after casting QSqlResults to that helper class.

Both the cast (which is a C-style cast, but with combined
static_cast and const_cast semanics) and the following member
function call are undefined behavior.

Fix by making the test class a friend of QSqlResult, and
dropping the casts.

Change-Id: I09de2e2b46976d01cfce25892aec6ad36881d3eb
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-03-15 10:39:20 +00:00
Marc Mutz
52a599bb56 QCosmeticStroker: fix several UBs involving << with a negative LHS
Left-shifts of negative values are undefined in C++. In particular,
they don't behave arithmetically.

Reported by UBSan:

  qcosmeticstroker.cpp: 72:15: runtime error: left shift of negative value -14/-19/-32/-33/-34/-37/-38/-63/-64/-192/-384/-1280
  qcosmeticstroker.cpp:444:20: runtime error: left shift of negative value -64
  qcosmeticstroker.cpp:451:26: runtime error: left shift of negative value -1
  qcosmeticstroker.cpp:483:26: runtime error: left shift of negative value -1
  qcosmeticstroker.cpp:762:20: runtime error: left shift of negative value -64
  qcosmeticstroker.cpp:774:26: runtime error: left shift of negative value -1
  qcosmeticstroker.cpp:813:47: runtime error: left shift of negative value -1
  qcosmeticstroker.cpp:839:20: runtime error: left shift of negative value -64
  qcosmeticstroker.cpp:851:26: runtime error: left shift of negative value -1
  qcosmeticstroker.cpp:889:47: runtime error: left shift of negative value -1
  qcosmeticstroker.cpp:932:27: runtime error: left shift of negative value -64
  qcosmeticstroker.cpp:995:27: runtime error: left shift of negative value -3/-64

Fix by using ordinary multiplication instead, because negative
left-hand-side values don't look like they are an error.

Change-Id: Icbebd41f6ddd3dca4abd385585fc0f82064fe8b6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-03-15 10:39:16 +00:00
Milla Pohjanheimo
1a9e1fbbfc Remove restoreDockWidget from BLACKLIST
Tested on the Ubuntu 14.04 VM. The test didn't fail anymore with
2000 test rounds

Change-Id: Ic12c60e5ebf9c234358a6983bf87fa0a88d7886e
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
2016-03-15 09:41:09 +00:00
Błażej Szczygieł
11836be127 Remove Qt::WA_OutsideWSRange flag even if the widget is not yet visible.
Show the widget when its initial size is 0 and the layout changes the
size during showing.

Task-number: QTBUG-51788
Change-Id: I3251ac27328f9715ff13d96e1b82fbf824d9e79d
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-03-15 09:16:27 +00:00
Marc Mutz
8eb721468e QMimeTypeParser: replace a QString::arg() chain with QString::asprintf()
Saves ~250b in text size on optimized GCC 5.3 Linux AMD64 builds.

Change-Id: Ic92c4ac1bb20230cfbb929bdf5c7f385d7b604e5
Reviewed-by: David Faure <david.faure@kdab.com>
2016-03-15 06:04:20 +00:00
Morten Johan Sørvig
c4886ca427 Cocoa: Fix crash on screen disconnect.
Maintain virtual siblings list on screen deletion.

QCocoaIntegration::updateScreens() has a loop which
will delete all non-current QScreen objects using
QPlatformIntegration::destroyScreen().

destroyScreen() vill eventually call QWindowPrivate::
setTopLevelScreen() which accesses the virtual siblings
list for the deleted screen.

This can cause a stale pointer access if the virtual
screen list is not up to date, especially when disconnecting
two screens at the same time.

Change-Id: Ia6b9d01edf8e5eea25b64604a2b3b28b173125f7
Task-number: QTBUG-48275
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-03-15 04:25:50 +00:00
Antonio Larrosa
063ad1c8b6 Don't include by default ciphers that are not supported
There could be cases (mostly when compiled on old systems, since modern
openssl versions don't include such insecure ciphers) in which
defaultCiphers included a cipher that wasn't in the supported ciphers
list. With this patch we make sure that defaultCiphers is a subset of
supportedCiphers

Change-Id: I545ea21f5fd3a6ed13b366cdd56a1393233f9fc9
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-03-14 00:00:43 +00:00
Mark Brand
c738e637b8 update bundled sqlite to 3.11.1.0
Since Qt 5.7 has dropped WinCE, including WEC2013, the patch for WinCE
is no longer needed.

The source code for the sqlite3 shell, shell.c, is not required for
building the qsqlite driver or anything else in Qt, so there is no
reason to keep bundling it with Qt sources.

Change-Id: Id0b03945451f9e843a0424c9fe510d79555717fc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Gunnar Roth <gunnar.roth@gmx.net>
2016-03-13 22:15:47 +00:00
Liang Qi
59a3ca679e Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-03-13 19:27:21 +00:00
Anton Kudryavtsev
447a508d00 QHostInfo: optimize container usage
Replace Java-style iterators with STL-style iterators.
Java-style iterators have overhead.

Use std::stable_partition with erase() instead of using remove()
in a loop, with quadratic complexity.

Introduce local template homebrew any_of (analog of std::any_of from C++11)
to simplify current code. Also it's needed for following changes
in this class.

Change-Id: I2b11889ccc7630597c72aa20cdb266ae6ca2471a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-03-13 17:00:44 +00:00
Anton Kudryavtsev
a3def2869d QtGui: de-duplicate calls and cache results
Change-Id: Iaf232c31d6780b49dc6a3d0faafb9717f3c36e65
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-03-13 17:00:31 +00:00
Volker Krause
434f2b8968 Don't quote newlines in multi-line shader linker errors.
Change-Id: I055758b73a9992786b6c4542396dc82fda1444b5
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-03-13 13:28:25 +00:00
Marc Mutz
e5ebf95bba QMimeTypeParser: plaster error paths with Q_UNLIKELY
... when more than a return would be executed, to
prompt the compiler to move it out of the way of
the normal execution path.

Unexpectedly costs ~200b in text size on optimized
GCC 5.3 Linux AMD64 builds.

Change-Id: I0ebfb56af7c2262f64271a1b0ec46533e6000bc9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-03-13 07:02:14 +00:00
Richard J. Moore
5fe0e41e79 Do not send the trailing dot of a hostname as part of the SNI
The SNI extension must not include the trailing dot, even though this
is legitimate for the host header.

Task-number: QTBUG-51821
Change-Id: Ib7a7d8b1f8f98bc99ae745b03d2b97e507adefaf
Reviewed-by: Daniel Molkentin (ownCloud) <danimo@owncloud.com>
2016-03-13 00:05:38 +00:00
Marc Mutz
978804d2c2 QNetworkHeaders: fix UB (invalid enum value) in Private::parseAndSetHeader()
Found by UBSan:

  qnetworkrequest.cpp:1016:19: runtime error: load of value 4294967295, which is not a valid value for type 'KnownHeaders'

KnownHeaders does not contain a failure state, and no negative
values. -1 is therefore not a valid value for an object of type
KnownHeaders, so loading one is considered UB.

Fix by returning the result of parseHeaderName() as an int,
only casting to KnownHeaders after checking for the failure
case.

Change-Id: I6b165fe2b15c747344a9b2750bb753582c5bcbeb
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-03-12 19:04:14 +00:00
Marc Mutz
2379bcac32 QHttpNetworkConnection: fix spelling in qWarning()
Change-Id: I87dcdc1b81e90d4bac180731fd78d0fea38191b6
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2016-03-12 17:29:46 +00:00
Marc Mutz
79c0cbf7a2 QOpenWFDDevice: fix BrE spelling and grammar in qDebug() output
Also print the failing type.

Sanity Bot complained about the spelling and Friedemann about
the grammar and missing type information in the output.

Change-Id: I7f38c56e569312e082e7b6baf9d556f5e7e40f80
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2016-03-12 17:29:41 +00:00
Marc Mutz
6417bbde85 QtBase (remainder): 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("...").

Had to fix broken qImDebug() definition. Instead of defining it as
a nullary macro in the QT_NO_DEBUG case and as a variadic macro in
the other, define it in both cases, as is customary, as a non-function
macro so that overload selection works without requiring variadic
macro support of the compiler.

Saves e.g. ~250b in text size in QtPrintSupport on optimized GCC 5.3
AMD64 builds.

Change-Id: Ie30fe2f7942115d5dbf99fff1750ae0d477c379f
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2016-03-12 17:29:36 +00:00
Olivier Goffart
8c0ae00dd6 Fix documentation of QFlags::setFlag
The function is not const

Change-Id: Ibe6f774058efd5ed5de021ff024d023b3cfc7e04
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-03-11 20:18:01 +00:00
Liang Qi
50d0f57b77 Merge remote-tracking branch 'origin/5.6' into 5.7
This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define
and undef in src/corelib/tools/qsimd_p.h.

This change is also squashed with "Fall back to c++11 standard
compiler flag for host builds" which is done by Peter Seiderer.

Conflicts:
	mkspecs/features/default_post.prf
	src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch
	src/3rdparty/sqlite/sqlite3.c
	src/corelib/tools/qsimd_p.h
	src/gui/kernel/qevent.cpp
	src/gui/kernel/qwindowsysteminterface.cpp
	src/gui/kernel/qwindowsysteminterface_p.h
	src/plugins/bearer/blackberry/blackberry.pro
	src/plugins/platforms/cocoa/qcocoasystemsettings.mm
	src/plugins/platformthemes/gtk2/gtk2.pro
	src/plugins/styles/bb10style/bb10style.pro
	src/sql/drivers/sqlite2/qsql_sqlite2.cpp
	tools/configure/configureapp.cpp

Task-number: QTBUG-51644
Done-with: Peter Seiderer <ps.report@gmx.net>
Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
2016-03-11 20:08:50 +01:00
Friedemann Kleint
514c202da9 Add a manual test for foreign windows.
Add a command line tool that can either take a list of window ids and output
information on them using a verbose debug stream or embed foreign
windows using QWidget::createWindowContainer().

Task-number: QTBUG-41186
Change-Id: I14e436b5d08828f5b78b29e0701daeffe11367d3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-03-11 16:03:34 +00:00
Anton Kudryavtsev
df909d8b1f QItemSelectionModel: refactoring of internal functions
Introduce template helper function qSelectionIndexes().
Template argument is container. Now we have the same code for
QVector and QList.

Also it's needed for a follow-up change in this file:
add method QModelIndex QItemSelection::index().

Change-Id: I7f86a9b96e5feac9873cf0df7a1cbca74f9191ec
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-03-11 13:34:03 +00:00
Olivier Goffart
343e5d066a Optimized implementation of QReadWriteLock
QReadWriteLock is supposed to be a better alternative to QMutex when there
are only a few writers but potentially lots of reads. However, in practice
the previous implementation was much slower, unless you really do a lot of
work with the lock for read and you have lots of contention.
Indeed, the previous implementation was locking a QMutex both for lock, and
unlock (making it already at least twice as slow as QMutex).

This new implementation brings QReadWriteLock back to the same level as QMutex:
 - No memory allocations in the uncontended case (almost no overhead allowing to
   create many of them in classes)
 - Lock-free if there is no contention

Should support up to 2^31 concurrent readers on 64 bit platforms, and 2^28
on 32 bit platforms

Change-Id: Ifa2fc999075cbb971088f4ee8e6fde78ce262da3
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-03-11 13:32:13 +00:00
Friedemann Kleint
a8c72b7671 tst_QTextStream::textModeOnEmptyRead(): Create file in temporary directory.
A test should not write to its directory. Amends change
d0b54cede8.

Task-number: QTBUG-47176
Change-Id: If15258b4aed199792fab422b7ac1d74e22a9e322
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2016-03-11 11:26:14 +00:00
Morten Johan Sørvig
a2d58025b6 Cocoa: Improve native view lifetime accuracy.
Ideally all native NSWindows and NSViews owned by
QCocoaWindow should be deallocated during the QCocoaWindow
destructor. In reality this does not always happen
since Cocoa is free to hold references to the views
after Qt releases its reference.

We can help Cocoa clean up:

- Clear the first responder for the NSWindow under
  the ~QCocoaWndow() autoreleasepool.

- Use an autoreleasepool to clean up temp objects
  from [NSWindow orderFront:] immediately.

Together this makes the QNSView lifetime be contained
by the QCocoaWindow lifetime, at least for simple
QWindow usage. It also fixes the observed memory leak
reported in QTBUG-51766

Change-Id: Idd224f54ebd6f61f274461a204ff30c666b22768
Task-number: QTBUG-51766
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-03-11 11:00:14 +00:00
Marc Mutz
71548ba4a0 ibus: remove some unneeded member init'ing
I was surprised this compiled at all, since I thought
QT_NO_CAST_FROM_ASCII was in effect in Qt, but
apparently it isn't.

Change-Id: Id77743a2ca1b7f865960dc78d169584741f18d43
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-03-11 10:56:35 +00:00
Marc Mutz
134cad32d7 QtCore: 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 ~750b in text size on optimized GCC 5.3 AMD64 builds.

Change-Id: I8bf3e46cd5a6b2cae0ceb3e355a50f61925c63d3
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2016-03-11 10:56:15 +00:00