Commit Graph

31512 Commits

Author SHA1 Message Date
Liang Qi
1a4f0deeb4 Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I7d84cfed0b2a122d334b8a920e6e4f18472d2f11
2017-02-28 13:03:36 +01:00
Jake Petroules
db0064b767 Speed up QFile::copy on Darwin file systems that support cloning
Recent Darwin system have a new system call that allows cloning the
contents of a file from another one if the underlying file system (for
example, APFS) supports it.

Change-Id: I90ec53b8abd2b1dc4000070f295e226d0fb4c672
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-27 22:25:07 +00:00
Jake Petroules
be74da81df Define QT_*_PLATFORM_SDK_EQUAL_OR_ABOVE macros on all platforms
Use of these macros implies defined(Q_OS_DARWIN) so don't complicate the
usage point (since the preprocessor cannot handle, for example
defined(Q_OS_DARWIN) && QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE when the
latter macro is not defined).

Change-Id: I47995351f0e46d8a1d07708117f8eed63d87ba0f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-27 22:23:55 +00:00
Laszlo Agocs
2c9acfbec6 Enable QWindowContainer on Android
[ChangeLog][Platform Specific Changes][Android] QWidget::createWindowContainer()
is now supported on Android for embedding OpenGL-based QWindows into widget UIs.

Task-number: QTBUG-59175
Change-Id: I84d3703bcd44c63b1fdfe6772b7f3de9d5c18ddf
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-02-27 18:32:36 +00:00
Robin Burchell
7a717aaf45 QImageWriter: Detect failure due to trying to write a QImage()
This is not a bug in QImageWriter, but caller code. We should be
explicit about what the problem was so it can be fixed.

[ChangeLog][QtGui][QImageWriter] Add QImageWriter::InvalidImageError to
communicate invalid attempts to write a bad QImage (for instance, a null
QImage).

Change-Id: I0333b8263f1da1c672bed17dab48bfd6cafe41a2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-02-27 18:03:33 +00:00
Edward Welbourne
1631384c27 tst_QWMatrix: use lambdas to duplicate messy code less
The cumbersome complex calls to QMatrix were surely easy to write
thanks to copy-and-paste; but this left the reader to either
laboriously check or guess that all the copies were the same (and
notice that there were two, in fact).  DRY.

Since QMatrix wants qreal data, change the float deg angle to a qreal
and work in qreal throughout.  Passing the angle to a function instead
of repeating it obviates the need for a local variable in the calling
code, to hold its value.

Change-Id: I6bb4adf438a893083ca19f27942502c1e5c518aa
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-27 17:45:28 +00:00
Jeremy Katz
2b339cd3e4 remove duplicate init check in xcb GLX threading support
Change-Id: Ifdaadcb26acfccb9625df23e6526c341cf7ebde0
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-02-27 09:16:16 +00:00
Laszlo Agocs
ffa578faf0 Add sRGB capable default framebuffer support for WGL
Not that it changes much since one tyically gets sRGB capable by default
on AMD and NVIDIA at least, but let's handle the QSurfaceFormat flag
correctly via WGL_EXT_framebuffer_sRGB.

Task-number: QTBUG-50987
Change-Id: I898c3757ab6fea51323d6c041b2511bea780c3fb
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-02-26 20:06:15 +00:00
Laszlo Agocs
f9f9bea370 Compose renderToTexture widgets with sRGB when needed
Just requesting an sRGB texture for a QOpenGLWidget does not lead to
anything useful when it comes to the end result, the content will just get
darkened. For proper operation the target window's default framebuffer
must be sRGB capable and linearization during blending must be enabled.

Task-number: QTBUG-50987
Change-Id: Ibad0657c29a720590fa22c84c4bc303302de6dc0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-02-26 20:06:11 +00:00
Laszlo Agocs
5bb4d06494 Add support for custom texture format in QOpenGLWidget
...in order to support sRGB framebuffers.

Add a --srgb option to the qopenglwidget example to allow testing.

[ChangeLog][QtWidgets][QOpenGLWidget] Added support for specifying
custom internal texture formats in QOpenGLWidget in order to make it
possible to have the widget backed by an sRGB-capable framebuffer.

Task-number: QTBUG-50987
Change-Id: I112e2f0ab0b1478c69e601031aa0bafaa87fa847
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-02-26 20:06:07 +00:00
Laszlo Agocs
931e4ae665 Support windows with sRGB-capable default framebuffers in QSurfaceFormat
Backend implementation is done for GLX for now. WGL and EGL may follow
later on.

[ChangeLog][QtGui] Added support for requesting OpenGL windows with
sRGB-capable default framebuffers. While this is implicit on some
platforms, QSurfaceFormat now has the necessary flags to request
such windows in a cross-platform manner.

Task-number: QTBUG-50987
Change-Id: I4df1f786e41e63396f46920a81afdf5ecb5eedea
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-02-26 20:06:03 +00:00
Simon Hausmann
d5078161aa Speed up QFile::copy on Linux file systems that support cloning
Originally inherited from Btrfs, recent Linux kernels have a system call
that allows cloning the contents of a file from another one if the
underlying file system supports it.

Change-Id: I9df66b65faef99f3bbed8a88fb6b6009baeef32e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-24 11:35:25 +00:00
Cédric Cabessa
f971a0d65c Fix proxy when changing only the password
QHttpThreadDelegate doesn't take into account the password to compute the
key of the networkconnection hash. So if only the password for a proxy has
changed, the wrong data gets used for the connection.

This patch simply adds proxy->password() to the key.

Here are the steps to reproduce the bug:
 * Use an authentified proxy and provide the correct username but a wrong
password

```
 QNetworkAccessManager networkAccessManager;
 QNetworkProxy proxy(QNetworkProxy::HttpProxy, PROXY_HOST, PROXY_PORT,
                     "goodusername", "badpassword");
 networkAccessManager.setProxy(proxy);
``

 * As expected, the reply returns ProxyAuthenticationRequiredError

 * Using the same QNetworkAccessManager, setup a new proxy with the
correct credential:

```
 QNetworkProxy proxy(QNetworkProxy::HttpProxy, PROXY_HOST, PROXY_PORT,
                     "goodusername", "goodpassword");
 networkAccessManager.setProxy(proxy);
```

 * The reply still returns ProxyAuthenticationRequiredError

[ChangeLog][QtNetwork] Fix proxy-authentication issue, after a wrong password
has been used, when supplying the right password.

Change-Id: Id3b5a2ce71fda81780f3ef2568a73d0022b38815
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-02-24 11:28:29 +00:00
Pier Luigi Fiorini
30b829a5a9 eglfs_kms: Mode support
Add support for reporting available modes.

[ChangeLog][QPA][eglfs][kms] List screen modes, current and preferred mode.

Change-Id: If64c1512271fadbafbb8c9fd715e64663d598599
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-02-24 10:08:09 +00:00
Jesus Fernandez
78236be8d7 Fix infinite loop
CID 176641:  Control flow issues  (STRAY_SEMICOLON)
A "while" statement with no block followed by a stand-alone block
is suspicious.

CID 176639:  Program hangs  (INFINITE_LOOP)
If "dx > 64L" is initially true then it will remain true.

Fixes a bug introduced in 8c31f75fd3.

Coverity-Id: 176641
Coverity-Id: 176639
Change-Id: I5daa563fe94316633f9525583d8addb8864c42c0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-02-24 09:43:23 +00:00
J-P Nurmi
08a84a8af8 Export QIconLoaderEngine::entryForSize() for QQuickIconImage
Let QQuickIconImage re-use entryForSize() so it can easily choose
the appropriate icon without re-inventing the wheel.

Change-Id: I88c7e058113b2fb5a864578d8c66f99f61b4eac3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-02-23 21:28:56 +00:00
Giuseppe D'Angelo
f526aa725d Sprinkle Q_DECLARE_TYPEINFO on types used in containers
Change-Id: I6c71ed8c20cd5e785037ad25c2d3da8994e8e3a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 17:43:23 +00:00
Daniel Vrátil
30da659af5 Introduce QMetaType::PointerToGadget flag for pointers to gadgets
A Q_GADGET class can be used both as a value class and a pointer, but
right now QMetaType::IsGadget is only set for value types. This change
introduces PointerToGadget metatype flag which is set for pointers.

This allow for better handling of gadgets in code as well as
disambiguating between value types and pointers to value types.

Change-Id: Id3bd9e18a8eec7ca1cc6b1c25ed03cdc8c0a75a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-23 16:58:47 +00:00
Edward Welbourne
0b822c2209 Examples: use std::atan2 for simper angle calculations
Using std::atan2 gets the right answer directly from dy and dx,
without having to fix up quadrant as we needed to with acos (albeit we
have to negate dy in some cases, to match prior sense of angles).  In
the process, it avoids explicit division, which would be an error when
the line's length is zero.

Change-Id: Ia2923159d38834e08e6f15cbff6766ed419fa804
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-23 16:43:35 +00:00
Alexander Volkov
89870a35bd xcb: Wrap xcb callings in macros
... to improve readability and reliability.

This change introduces macros Q_XCB_REPLY and Q_XCB_REPLY_UNCHECKED
that allow to replace couples of xcb cookie/reply callings by
a single "calling" of a macro. The macros wrap the reply in
std::unique_ptr thus preventing the need to free it manually.

The following C++11 features are used:
  - variadic macros
  - std::unique_ptr
  - auto type deduction

Change-Id: Icf9b93353404a39bf5f4a4562b9234db18cac696
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-02-23 13:05:36 +00:00
Friedemann Kleint
35fa30e65d Revert "testlib: Add qWaitFor to wait for predicate"
This reverts commit 3b38392844.

The change caused test compile failures with MSVC2015 in qqmlsettings;
a variable was not captured in the lambda expression. This appears
to be a compiler bug of MSVC.

Task-number: QTBUG-59096
Change-Id: I3bf5288eb005b2e1661819bb33bc54fb944d0150
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-23 10:07:57 +00:00
Jarek Kobus
21298aad45 Enable FTS5, will be used by Assistant instead of clucene
Change-Id: Ifd1d7128c6080650b5ad43f87410c7058d8c5a74
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2017-02-23 09:18:55 +00:00
Marc Mutz
4d92712a2c QTimeZonePrivate: make clone() const, use covariant return types
There's nothing wrong with cloning a const QTimeZonePrivate, so make
clone() const.

Also, if you're cloning a QTzTimeZonePrivate, you already know that
you get a QTzTimeZonePrivate back. C++ supports covariant return types
for this reason, so use them.

Change-Id: I60e19e89b1b7bad080c552f1baca314ab0a6295e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 05:45:53 +00:00
Marc Mutz
4cd002402f Simplify QTzTimeZonePrivate implementation
- Don't init m_icu with 0. It's a QSharedDataPointer, which inits to
  nullptr anyway.
- The copy ctor didn't do anything out of the ordinary, so = default it.
  It's also only used in the implementation of clone(), so make it private.

Removes three #if QT_CONFIG blocks.

We can't use ctor delegation here, because systemTimeZoneId() is a
virtual function.

Change-Id: I2cd06c3349686b6f21c897acb5c12185a36d5b9f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 05:45:49 +00:00
Marc Mutz
2cda991ab1 QStaticByteArrayMatcher: fix MSVC warning
MSVC 2013 complained:

  src/corelib/tools/qbytearraymatcher.h(143) : warning C4351: new behavior: elements of array 'QStaticByteArrayMatcher<6>::m_pattern' will be default initialized

Fix the same way as 9a07ab9234: by suppressing
the warning.

Change-Id: Ic41f7eabe7e39709d76e6062f5891cdcfaa6e1ed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-23 05:44:58 +00:00
Marc Mutz
b952bd3605 QSizePolicy: make (Policy,Policy) ctor constexpr
Unfortunately, that ctor also takes a ControlType argument (defaulted),
and calls the non-constexpr, non-inline function setControlType().

In order to make at least the two-arg version constexpr, I added
a use of the ternary operator to check for type == DefaultType,
making all calls of the ctor that use type == DefaultType
constexpr. For init'ing an aggregate type without ctor in the
ctor-init-list, I needed to require uniform initialization, too.

C++11-style constexpr cannot call void functions, so I needed
to extract the transformation part of setControlType() into a
new function that returns the result instead of storing it directly.

Saves a surprising 2K in QtWidgets text size on GCC 4.9, AMD64 Linux
stripped release builds.

Change-Id: Ib4adf5fd6e54d5345dbfe1c298554278faf13c58
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-02-23 05:44:51 +00:00
Marc Mutz
3ac8b8c696 QTypeInfo: record whether it was specialized
This is one of the pillars of my static container checking toolbox,
one of the main checks being that every type put into a Qt container
has been marked up with Q_DECLARE_TYPEINFO.

Obviously, we cannot upstream such a checker and inflict it upon the
world, but we can put some foundations in. This is the most central
one.

Change-Id: I9185facb2f37ba9fcc12c9aae5675eed454d755c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 05:44:47 +00:00
Lorenz Haas
2a3297c726 REGEXP for SQLite
Since SQLite does not define a regexp function by default, provide a Qt
based implementation which can be enabled using QSQLITE_ENABLE_REGEXP as
an connect option. This way statements like

SELECT * FROM table WHERE col REGEXP '^[a-d]';

work out of the box.

[ChangeLog][QtSql] Add QSQLITE_ENABLE_REGEXP connect option for
QSQLiteDriver. If set a Qt based regexp() implementation is provided
allowing to use REGEXP in SQL statements.

Task-number: QTBUG-18084
Change-Id: I7f0e926fe4c5d6baea509f75497f46a61ca86679
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Sebastian Sauer <sebastian.sauer@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-02-22 21:14:23 +00:00
Giuseppe D'Angelo
56723c6e91 QTypeInfo: make long double primitive in Qt 6 on Darwin
I don't know the historical reasons for that, but C++11 mandates
long double as a type. On Darwin this means that long double
was a complex type, so the best for now is to mark it relocatable.

Change-Id: Ic933947a282ad963d5d0168c2768cc98fdd456bc
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 20:39:06 +00:00
Marc Mutz
9fbe3a9262 QErrorMessage: replace a QPair with a struct
Instead of the incomprehensible "names" .first and .second, the code
can now use .content and .type.

Change-Id: I7fe320ded33a07fb8ff77ac96c17fc5ee1079da3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-22 16:42:29 +00:00
Marc Mutz
494ee2aa8d QThreadPool: supersede cancel() with tryTake()
The cancel() function added in 5b11e43e for Qt 5.5 suffers from a
number of problems:

First, if runnable->autoDelete() is true, then the function suffers
from the ABA problem (see documentation written for trytake()).

Second, if runnable->autoDelete() is false, due to cancel() throwing
away crucial information instead of returning it, the caller cannot
know whether the runnable was canceled (and thus has to be deleted),
wasn't found or is currently executing (and thus mustn't be deleted),
or has finished executing (and can be used to extract the result).

Deprecate this dangerous API and replace it with the much more useful
Private::stealRunnable(), promoted to public API and renamed to
tryTake() for consistency with the rest of Qt.

Described the various caveats in the function's documentation.

[ChangeLog][QtCore][QThreadPool] The cancel() function suffers from
several subtle issues and has been replaced with a new tryTake()
function.

Change-Id: I93125935614087efa24b3e3969dd6718aeabaa4f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-22 16:37:07 +00:00
Allan Sandfeld Jensen
beaf33983e Fix wrong access to qMemRotateFunctions
Since this table was restructured in 7c401397a4 and changed to
being indexed bitwidth and not format, NEON-enabled builds have
been writing to an undefined place after the table.

Discovered by compiler warnings on CI.

Change-Id: I109cd19a8dd703bdafdf13afd3f96ebeaa0e6de5
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2017-02-22 14:36:56 +00:00
Marc Mutz
dbfde461ed tst_QProgressBar: add a case for INT_MIN/INT_MAX to setValueRepaint()
Convert the function to be data-driven, then add cases for ranges with
limits INT_MIN, INT_MAX and zero to check for overflows in the
painting code. Speed up the function by removing the per-iteration
qWait() call and rely solely on the existing QTRY_VERIFY() to do the
right thing.

Change-Id: I6d2a2c2b7637fca7ddb2a9adc5f6550f8255da14
Reviewed-by: David Faure <david.faure@kdab.com>
2017-02-22 13:55:51 +00:00
Alexander Volkov
d4ae7d39c8 xcb: Move QXcbConnection::xi2*() methods() to qxcbconnection_xi2.cpp
Change-Id: I7af7bd7590b95f6092fcca718931b1f1462c0ae5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-02-22 13:40:05 +00:00
Marc Mutz
7c647edae9 QTypeInfo: don't treat enums and (extended) integral types as complex
We fully specialize QTypeInfo for most C++ built-in types,
but enums and extended integral types (like GCC's int128_t)
were not covered.

Now that we depend on <type_traits>, we can stop pessimizing
enums and extended integral types in QVector and QVLA by
defaulting QTypeInfo::isComplex to true for such types.

Fix a test that checked that enums were complex types. This should
have been a XFAIL test. Enums are not complex types.

Change-Id: Ibb0fb38cc83e980a428b5573d1db5666593418ae
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-22 09:21:57 +00:00
Edward Welbourne
8012f38379 Tidy the long lists of files in Makefile.unix
In the source list, put one file on each line, sort alphabetically
within each of several blocks (preserving the order of those blocks),
add missing entries for which we have rules.  Document where QTSRC and
friends come from, eliminate duplication between their entries and
DEPEND_SRC (which pulls them in anyway).  Document strays not in OBJS
or QOBJS, fix qmake.pri to add to SOURCES not OBJECTIVE_SOURCES.
Put OBJS and QOBJS entries in the order that matches DEPEND_SRC.

Change-Id: Id38cccd9b1f849a865a265bc0e6ce4c426c42eea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-22 08:38:58 +00:00
Marc Mutz
19085350fb Do not use QTypeInfo::isStatic anymore
... except in QList.

When dafa3618 introduced isRelocatable and QTypeInfoQuery, the
intention was to decouple the memory layout of QList from the
reallocation optimizations in QVector. This never happened, as
QVector (and QVarLengthArray) continue to use isStatic to this
day.

Fix by porting both QVector and QVLA to QTypeInfoQuery and
isRelocatable.

Change-Id: I6951f2cf21f0cbb24e2dbd38f80f1bd82007d394
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 08:04:12 +00:00
Marc Mutz
4df229ce50 QArrayDataOps: don't use value-initialization
... but default-initialization instead.

This bug may have rendered the diverse Qt::Uninitialized ctors
we have in Qt containers ineffective.

Change-Id: I5a369fa8527f19b6f8cc1a9f36512f6a0058839a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 08:03:46 +00:00
Tor Arne Vestbø
53c0568924 macOS: Make sure NSResizableWindowMask is set when toggling fullscreen
Instead of setting the mask in toggleFullScreen(), which is only hit
when going to fullscreen via our own API, we do it in the window
notification callbacks, which also includes going to full screen via
the native macOS title bar buttons. This allows making customized
windows without Qt::WindowMaximizeButtonHint full screen with the
full geometry of the screen.

Change-Id: I63c3e4582ea7c4fe8c0008265793c5f656b830b2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-02-22 07:58:20 +00:00
Marc Mutz
adca47cbc1 QTzTimeZonePrivate: introduce PosixZone class
... as a replacement for QPair<QString, int>, and move some
repsonsibilities into it.

This avoids the repeated use of the magic number INT_MIN to indicate
absence of an offset and does away with the confusing .first and
.second, replacing them instead with proper names, .name and .offset.

Change-Id: I0f6906467b8efa16bed2bf5677f2bbbd534da1ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 07:58:19 +00:00
Tor Arne Vestbø
c585802e94 QWindow: Remove "_q_foreignWinId" dynamic property
The platform plugins reading this out of the QWindow was a layering
violation, and propagates the notion that a window can shape shift
into representing a new native handle, while none of the platform
plugins support this.

A foreign QWindow is created via the factory function fromWinId(),
at which point we can pass the WId all the way to the platform
plugin as function arguments, where the platform will create a
corresponding platform-window.

The platform window can then answer the question of whether or
not it's representing a foreign window, which determines a few
behavioral changes here and there, as well as supplying the
native window handle back for QWindow::winId();

[ChangeLog][QtGui][QWindow] The "_q_foreignWinId" dynamic property
is no longer set nor read.

[ChangeLog][QtGui][QPA] The function createForeignWindow() has been
added to QPlatormIntegration and is now responsible for creating
foreign windows. The function isForeignWindow() in QPlatformWindow
has been added, and platforms should implement this to return true
for windows created by createForeignWindow().

Task-number: QTBUG-58383
Change-Id: If84142f95172f62b9377eb5d2a4d792cad36010b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-02-22 07:58:07 +00:00
Olivier Goffart
5426e689f9 Fix a race condition between QObject::connect and qRegisterMetaType
QObject::connect will extract the QArgumentType for first the signal,
then the slot. The QArgumentType with a string constructor will query
the metatype system to get the meta type id. But it might happen that
between the extraction of the signal's argument and the slot's argument,
qRegisterMetaType was called in another thread. For this reason, it's
possible that one QArgumentType has a type id while the other does not.
For this reason, we should fall back to compare the string if any of
the argument's type is 0.

Task-number: QTBUG-50901
Change-Id: I260ca662ff00a773ae519f78bb633e05fde0ea81
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 07:37:51 +00:00
Marc Mutz
7de8745eaa QSizePolicy: add C++14-style constexpr where possible
This is straight-forward, since, unlike with transposed(), we can
assume that every compiler that supports C++14 constexpr also supports
C++11 uniform initialization. For Clang and GCC, this is clear. For
MSVC, we might need to reconsider this, as, according to
qcompilerdetection.h, 2015 still does not support uniform
initialization (but not C++14 constexpr, either), and we don't know
what 2017 will support.

Change-Id: Idac7aa929d275645478a926896dca0dff166e114
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 07:12:25 +00:00
Marc Mutz
e0a9a0e217 QArrayDataOps: do not use QTypeInfo::isStatic anymore
These days, QTypeInfoQuery and isRelocatable should be used.

Change-Id: Ieac2d7fcef6b1d5466b14bbd1066901d6e751a55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 07:12:13 +00:00
Thiago Macieira
0f1b6acab7 x86: Add detection of the AES and SHA New Instructions
The AES instructions were first introduced with the Westmere shrink
(22nm) of the Nehalem architecture. The SHA instructions are still
pending on Intel architecture, but is available on AMD family 17h (gcc
argument -march=znver1).

Both features operate on SSE registers, so that's why the MSVC command-
line argument is the SSE2 one and the configure-time tests depend on
features.sse2.

The qmake feature names end in "ni" because "aes" and "sha" are too
simple and could clash with other uses. The QT_COMPILER_SUPPORTS_ macro
doesn't have the "NI" suffix because it has to match the GCC/Clang
predefined macro.

Change-Id: I445bb15619f6401494e8fffd149dbd1f862ff51c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-02-21 23:48:30 +00:00
Marc Mutz
db1c8553a1 QMimeTypeParser: remove unused QPair include
Change-Id: Idd75cc4f9e9bfb675ba973498321d0d7884a591d
Reviewed-by: David Faure <david.faure@kdab.com>
2017-02-21 22:46:13 +00:00
Tor Arne Vestbø
3b38392844 testlib: Add qWaitFor to wait for predicate
Reduces duplication of logic and allows other primitives to be
built on top.

Change-Id: Ia100014cfb0c09ac2f47c3a156d0c76f0fddafa8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-21 14:32:28 +00:00
Robert Mancoast
b5a7746571 linux-icc-k1om build
Change-Id: I6262b14640118482621c95c3988c068cf72271d8
Reviewed-by: Robert Pancoast <RobertPancoast77@gmail.com>
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
2017-02-21 14:27:16 +00:00
Edward Welbourne
d345429967 Join two else/if lines that were left split
Probably after-effects of some #if-ery we removed long ago ...

Change-Id: I8bf7a97dc5fda615bf20c37ccd9c1de0ba9194e5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-02-21 13:40:21 +00:00
Alexander Volkov
538b9f504c xcb: Remove XIproto.h include from qxcbxsettings.cpp
It indirectly includes X.h with LSBFirst and MSBFirst macros.
Use XCB_IMAGE_ORDER_LSB_FIRST and XCB_IMAGE_ORDER_MSB_FIRST
macros instead and remove unneeded XCB_USE_XLIB guards.

Change-Id: Ic24c9605d0a627253f2793f9feab6c6e19dcda08
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-02-21 13:05:50 +00:00