Commit Graph

31356 Commits

Author SHA1 Message Date
Kimmo Ollila
a0a9e8b2d7 Fix is_iec559 assert on GHS compiler
GHS compiler is not fully compliant with iec559.
Therefore we need to replace is_iec559 assertion
with separate checks to build quint16.

Change-Id: I88c57e394b8d4e7899ee7d4a13cbfbac9436b2fc
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-15 13:52:26 +00:00
Timur Pocheptsov
5542e772d6 tst_qlocale::macDefaultLocale - remove flaky/incorrect test
currencySymbol == "$" does not mean negative currency values will be formatted
as "($value)". With all locales I have on my mac machines (10.11/10.12) the
result is different from what this test expects. Also, the results are very
different for different locales.  Apparently, we never saw this problem before
since in our CI "macs" we never have US Dollar/en_US selected in System Preferences.

Task-number: QTBUG-58784
Change-Id: Ic2c3a3172bf1e715e99092ddee8f461b216d995a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-15 07:43:26 +00:00
Friedemann Kleint
0b30a6e6aa QElfParser: Fix plural form in error message
Amends change dcec1420ea.

Change-Id: I54c7db012d87a55c310141debac19118e7cb284a
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-15 07:18:55 +00:00
Liang Qi
27432d40f2 Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: I2bd2e61bae1eab4fc74fa6accd741ed9ae1f0669
2017-02-14 11:33:02 +01:00
Marc Mutz
10ecbc4041 Blacklist tst_QWaitCondition::wakeOne() on Windows
This test was determined to be flaky on the CI.

Task-number: QTBUG-58741
Change-Id: I43196d3a27f726fb96b427f5071e726b571a0404
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2017-02-14 06:51:52 +00:00
Friedemann Kleint
071a120400 Windows styles/wizard: Do not invoke winId() of desktop windows
Call the Win32 API GetDesktopWindow() to obtain a HWND of the desktop
instead of calling QApplicationPrivate::getHWNDForWidget() for desktop
windows. This allows for lazily creating desktop platform windows.

Observed in some tests where no window is visible.

Change-Id: I97074f69606b3d74f3fbc90acb4a077d52eeb84d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-02-13 21:32:04 +00:00
Julien Gueytat
aa1631d76c Replace gstrip by strip due to ELF corruption
This is an old error of the gstrip binutils. The bug has been corrected
and re-introduced.

The command *elfdump -d xxx* on the ELF does bring lines like those :
.SUNW_syminfo: invalid sh_info: 0

Task-number: QTBUG-58814
Change-Id: I330c4031dcf4ba64297df4b333b41cf0a003914f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-13 20:06:53 +00:00
Tor Arne Vestbø
5c440880ba Respect QWindow::screen() when computing QPlatformWindow::initialGeometry()
Calling setScreen() on a QWindow doesn't move the window to that screen
unless the new screen is a separate virtual desktop, as the window
geometry is what determines the position of the window within each
virtual desktop.

But when mapping a QWindow that doesn't have a position explicitly set by
the user, we try to resolve a reasonable position for it. In that case we
should take the QWindow screen into account, as setting it to a non-primary
screen is a good indication that the user wants the window to end up on
that screen. If that's the case, it should override the logic of using
the transient parent or the cursor position to choose which screen to
place the window on.

Change-Id: I591d872a93913173b20eb3da19aa63118fcf6b12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-02-13 18:30:09 +00:00
Tor Arne Vestbø
09e7a994d1 Don't create platform window for QWindows when calling setVisible(false)
We can defer the creation until the window is shown.

Change-Id: I3d5b45ae59ee0925996cf12cd46dd574c8c6ef95
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-13 18:30:06 +00:00
Marc Mutz
9bf8cc1f18 qimage_conversions.cpp: keep shared copies of gray and alpha color tables
Since QVector is implicitly shared, don't re-generate the same
two color tables all over again, but create them once and keep
them around in a Q_GLOBAL_STATIC.

Change-Id: I9a8d32021d8cc327264f2818a23beaae67fe3ee8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-13 18:27:17 +00:00
Nico Vertriest
6fe386ac42 Doc: Updated doc QSqlDatabase
Change-Id: I914e9bdbf6137f0e3858a57b0f59fc550fc7e317
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-02-13 15:45:06 +00:00
Joerg Bornemann
1b46872cde qmake/nmake: Prevent overlong lines in link and lib response files
Linking with too many object files could lead to "LNK1170: line in
command file contains 131071 or more characters". Do not write all .obj
files into one line but respect a limit of 1000 characters. If the limit
is reached the object files are separated by newlines instead of spaces.

Task-number: QTBUG-58710
Change-Id: Ibae1f737d6b614a9624b4e00cdd21d3722d341e3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-13 14:48:15 +00:00
Friedemann Kleint
e8a2a9bf30 Windows QPA: Include GL header depending on presence of dynamic GL
Amends change 7780ee9e5f.

Task-number: QTBUG-58178
Change-Id: I0b6e064dfdbdafb7fba9c20c56cfd873fa594c44
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-02-13 12:04:39 +00:00
Oswald Buddenhagen
e3e2bc2109 announce 'temporaryfile' feature in bootstrap library
qmldevtools refers to it.

Task-number: QTBUG-58819
Change-Id: Id88265bb17e4d2e9c61f77409c4163eacc4a13f3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-13 09:20:07 +00:00
Dominik Holland
088bf1fb3d Add the new NVIDIA specific calls to qeglstreamconvenience
NVIDIA 370 introduced new calls needed to work with eglstreams in the
wayland window system

Task-number: QTBUG-58299
Change-Id: I606b143d3016f365b0d5ca4bc163b99289afbea1
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-02-13 09:17:39 +00:00
Marc Mutz
0d2791c5f6 QCollatorSortKey: add some std::move
All implementations of QCollator::sortKey() can benefit from
moving their CollatorKeyType into the QCollatorSortKeyPrivate
on construction.

So make the QCollatorSortKeyPrivate ctor a perfect forwarder
for its m_key member, and add std::move() calls where they
were missing (in all but one case, lvalues were passed).

Make the ctor explicit, as it should have been from the
beginning.

Change-Id: I2a1cdda5fd23990ace019b963df895c621a1fa85
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-13 08:42:46 +00:00
Marc Mutz
a85b4d79db QThreadPool: replace a QSet with a QList
QThreadPool maintains three containers of QThreadPoolThread*:

- allThreads, a QSet
- waitingThreads, a QQueue
- expiredThreads, also a QQueue

None of the operations on allThreads make use of QSets fast lookup.
The only functions called on it are isEmpty(), count(), insert(),
and swap().

Since therefore QSet adds nothing but overhead, causes indeterminism
(e.g. when deleting threads in Private::reset()) and code bloat, use
the same container for allThreads that underlies QQueue: QList.

Port insert() to append(). Add an assert to verify that we're not
running into an ABA problem here (but this should never fire, since
we're never deleting threads except in Private::reset(), where we
do remove them from allThreads), just in case.

Saves ~0.5KiB in text size on optimized Linux AMD64 GCC 7.0 builds.

Change-Id: I53a4d5ef2c204420f7c8852f1e72ab3d6ea43d08
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-13 08:42:41 +00:00
Filipe Azevedo
9db8c171e7 Fix QLibrary::isLibrary on Apple platforms
Add proper support for 'so' and 'bundle' suffixes.  Qt wrongly assumes
.so libraries are not versioned on Apple platforms, which is
wrong. Also, the shared library .bundle which is what Apple recommends
instead of .so, are also versioned (not to be confound with the
different Core Foundation bundles, which are directory hierarchy).

For more info, see http://docstore.mik.ua/orelly/unix3/mac/ch05_03.htm.
Especially the part that reads:

"Loadable modules, called bundles in Mac OS X, have the file type
MH_BUNDLE. Most Unix-based software ports usually produce bundles with a
.so extension, for the sake of consistency across platforms. Although
Apple recommends giving bundles a .bundle extension, it isn't
mandatory."

Task-number: QTBUG-50446
Change-Id: Iacd5136397a12d65d83821434f332eb602550b4b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-12 18:25:42 +00:00
Thiago Macieira
b2ffc4d0a0 moc: remember to quote the path to moc_predefs.h
Task-number: QTBUG-58764
Change-Id: I4baef2edf7624ad69d96fffd14a22209a2bb90be
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-12 18:10:36 +00:00
Tor Arne Vestbø
7efd024b92 macOS: Make QMacNativeWidget example more usable
Change-Id: I3948c998dfbc2982a79d597c7ea3bc226df9c125
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-02-12 12:29:55 +00:00
Thiago Macieira
418184c2a0 Update the __xxx__ macros due to MSVC and ICC not defining them all
And if __AES__ or __PCLMUL__ is defined, then we expect wmmintrin.h to
exist.

Change-Id: I445bb15619f6401494e8fffd149db77dc513e071
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-02-12 08:16:05 +00:00
Thiago Macieira
b1b53b7101 Revert "Add tests for QCollatorSortKey"
This reverts commit b0c1e07d64.
The unit tests it introduced trigger errors with the macOS and
Win32 implementations, which means the there's something seriously
wrong with either the API, our implementation or the tests.

Revert for now until this gets fixed. Blacklisting was also the
wrong tool to use. The tests should have used QEXPECT_FAIL.

Change-Id: Ida20c6bbe0c019835a22464535029585e8e1e367
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-12 08:15:48 +00:00
Tor Arne Vestbø
b5068a2831 macOS: Don't try to cast foreign windows to QNSView
Change-Id: I08a4d76310a689c3c855d4c8306f9d7aa5cecadc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-02-11 21:49:14 +00:00
Tor Arne Vestbø
0b18d51b89 macOS: Handle window state changes directly in QCocoaWindow
Now that notification callbacks are delivered directly to QCocoaWindow,
it doesn't make sense to then send them to QPA via QNSView. By skipping
the QNSView roundtrip we also enable window state notifications for
foreign windows.

As an optimization we no longer flush all window system events, but use
the new synchronous API to deliver the window state change event.

Change-Id: I529b625fbe22e664c34a51bcd4448d1bf0392e6b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-02-11 21:48:45 +00:00
Marc Mutz
b0c1e07d64 Add tests for QCollatorSortKey
There weren't any, at all.

Testing on the CI showed that the implementation is broken on
macOS, and, to a lesser extent, on Windows, so blacklist the
failing tests until the implementation can be fixed. No need
to hold back testing the other implementations.

Task-number: QTBUG-58737
Change-Id: I9ae16ab778dbe2e95a6ca5e0bae00df4bad65cb2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-11 07:37:22 +00:00
Thiago Macieira
68b21690e2 Use QBasicMutex in qthread_win.cpp
It's QtCore, so we're fine.

Change-Id: Ifaee7464122d402991b6fffd14a0d7ad9c09e2f2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-11 05:06:33 +00:00
Laszlo Agocs
fa3dca176e evdevtouch: Add missing we mean it note
Change-Id: If703a4d8542cb98fd1966f8ca959938709731452
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-02-10 19:41:34 +00:00
Laszlo Agocs
52094e2520 egl: Expose direct function pointers on INTEGRITY
Change-Id: I4f7df9abcd580297a40fd9dd16a26f5f93e1c4c7
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-02-10 19:41:26 +00:00
Marc Mutz
44d5fb33be Blacklist tst_QSemaphore::tryAcquireWithTimeout(0.2s) on Windows
This test was determined to be flaky on the CI, depite attempts
to stabilize it (b750a3786f).

Task-number: QTBUG-58745
Change-Id: I933199cd537002699906147d172bb797f1dc90c1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-02-10 14:15:16 +00:00
Eskil Abrahamsen Blomfeldt
eca1933bb7 Fix compilation on iOS
The function is only used from inside the #ifndef ES2 blocks,
causing it to fail compilation with a default configuration
on iOS (where warnings are errors).

Change-Id: I4f76c6371bd9125c7d1c919685df4a870eeb62f0
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
2017-02-10 12:43:09 +00:00
Olivier Goffart
0e20635c39 moc: error out when the Q_PLUGIN_METADATA file can't be opened
Task-number: QTBUG-56045
Change-Id: Ib058791036a2728dcd6215009a4ff206278bed14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-10 06:55:48 +00:00
Thiago Macieira
8a410f60ae Don't include qfloat.h in the QtCore master include
We have observed that MSVC 2013 gets lost with the overloads that this
header adds, causing compilation bugs. This is believed to be a compiler
bug, but it's not something we can work around.

Task-number: QTBUG-58555
Change-Id: I536c32a88bff44dab37afffd14a1bad1d31dc16d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Glen Mabey <Glen.Mabey@swri.org>
2017-02-09 21:23:31 +00:00
Alex Trotsenko
6e8fcab7e0 Improve QIODevice::peek() performance on buffered devices
Since 5.7, QIODevice::peek() implementation is based on transaction
mechanism. While technically it's correct, seeking backward on a
buffered random-access device clears the internal buffer that affects
the performance of reading.

To solve the problem, this patch implements peek mode directly inside
the reading procedure.

Task-number: QTBUG-56032
Change-Id: Ic5269f76e44c491a0309e13aba87fa7cf7b9259f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-09 18:46:24 +00:00
Alex Trotsenko
60563855e5 Refactor QIODevice::read()
Move device-dependent part of the code into the private function for
further reusing by peek() procedure.

Task-number: QTBUG-56032
Change-Id: Iedceafe4b0bab109ca5c64ad274d779efe87c27b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-09 18:46:15 +00:00
Thiago Macieira
7314c53d31 Add QDataStream streaming operator for QFlags
We're already using it, for example in qpaintengine_pic.cpp:502:
         d->s << p << ti.text() << fnt << ti.renderFlags() << [...]
                                             ^

[ChangeLog][QtCore][QFlags] Added operator<< and operator>> for
streaming QFlags into and out of QDataStreams.

Change-Id: I33dc971f005a4848bb8ffffd1478e79d6102d1bc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-09 17:46:11 +00:00
Oswald Buddenhagen
b052d0cffd rename qvector.cpp => qvector.qdoc
the file contains no code.

this avoids complaints from ar/ranlib in static/bootstrapped builds.

Change-Id: Iee22ffc61a5f9ea8c25f5455b7e8e017ac521624
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-09 14:56:01 +00:00
Oswald Buddenhagen
2a48f7b189 make libinput axis api feature depend on libinput
amends b4085e56.

Change-Id: Id18a7de6496e8e9164cb247426aba1293aa4ea2e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-02-09 14:55:47 +00:00
Oswald Buddenhagen
559bfa09e4 refuse to build EGLFS on android, darwin, and windows
... instead of merely defaulting it to off on android and windows.
this reflects actual reality.

Change-Id: I880254138bedd07124aa00096a06dd6e1803feb9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-02-09 14:55:23 +00:00
Andy Nichols
dee16fe491 Blacklist Intel HD Graphics IronLake (Arrandale) on Windows
More poor quality Intel OpenGL drivers causing issues when using OpenGL
in Qt.

Change-Id: I76ad023a1f1e92d57dc0b081c665a3b066206068
Task-number: QTBUG-53888
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-02-09 14:15:34 +00:00
Tor Arne Vestbø
92dc1752d4 windowflags test: Don't assume window states can not be compound
The controls need to reflect the facts that e.g. maximized and fullscreen
can both be set at the same time, the same way a window can be minimized
and fullscreen.

Change-Id: I7f3e354a5efaefb9f51e6b1f24fa35980fe35899
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-09 14:11:00 +00:00
Tor Arne Vestbø
2aa62dad1d windowflags test: Don't hide windows unconditionally when applying new state
Makes operations like minimizing a window happen "behind the scenes"
because the window is hidden during the state change.

Change-Id: I01a00661e57f2dcfa6aef78ee0cfa36fbed1bb03
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-09 14:10:51 +00:00
Tor Arne Vestbø
7e98eb5f5f Prevent Qt::ForeignWindow from propagating into QWidget for non-toplevels
Qt::ForeignWindow implies Qt::Window, which QtWidgets interprets as a top
level window, but this is not the case on a QtGui level. A foreign window
can be a child window as well, so we have to make sure the QWindow state
is not propagated to QWidget, which would result in the QWidget becoming
top level.

Change-Id: Ie0c2d769ce92e6988a4d62da46f5fc2da74bdf08
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-09 14:10:36 +00:00
Tor Arne Vestbø
0c6911e5cd QWindow: don't destroy foreign windows
Calling QWindow::destroy() is documented to "release the native platform
resources associated with this window.", but in the case of foreign windows
we do not control the native platform resource, so we shouldn't destroy
the platform window until the QWindow is destroyed.

This also allows code paths to defer to the platform window to answer
questions like winId() instead of having to duplicate the ID on the
QWindow side in _q_foreignWinId.

Change-Id: Ie00ee570bdddde958d97d49edcba2bc1bf519a99
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-09 14:10:28 +00:00
Tor Arne Vestbø
a57f2128b1 Add QPlatformWindow::isForeignWindow()
Simplifies code at call sites and allows for refactoring how to decide
if a window is foreign or not at a later point.

Change-Id: Icc51a83bac187f4975535366b53b4990832b6c82
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-09 14:10:17 +00:00
Marc Mutz
0f2638c994 Blacklist tst_QElapsedTimer::elapsed() on Windows
This test was determined to be flaky on the CI.

Task-number: QTBUG-58713
Change-Id: Ie6e6a69b8ea625e3a3102c88d52f1f0fbec242aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-09 10:01:08 +00:00
Friedemann Kleint
ee8b61bcf5 QRegularExpression example: Handle empty patterns
Previously, when clearing the pattern by clicking the clear
button, the result match list would display a list of empty
matches since apparently an empty pattern matches as many
times as the subject is long. This is confusing when using the
tool.

Restructure RegularExpressionDialog::refresh() so that it bails
out if the pattern is empty or invalid.

Change-Id: I8119a75db50cead3f64394016e3390a9bf7d0bf7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-02-09 08:16:43 +00:00
Jani Heikkinen
c1e7d0795b Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9 2017-02-09 04:11:53 +00:00
Thiago Macieira
136c5b9338 Merge several Q_GLOBAL_STATICs in qresource.cpp into one
Since they are all used in a typical application, this reduces the
number of memory allocations (thus, the overhead) as well as the
state-keeping in the libc atexit() functions.

Change-Id: Ifaee7464122d402991b6fffd14a0e59457ad9cb7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-09 01:22:54 +00:00
Thiago Macieira
4f3ea30922 Avoid unnecessary creation of some Q_GLOBAL_STATIC
If these lists weren't created in the first place, then they are empty.
We don't need to create it in order to conclude that. Unlike most
Q_GLOBAL_STATICS, these are almost never used and yet they were
always created due to where they were checked.

Since we're calling exists() before, there are two consequences: first,
since the list already exists, we're not allocating memory so it cannot
throw std::bad_alloc when being accessed. Second, since we've just
checked it exists, we can use QGlobalStatic's operator*(), which is
slightly faster than operator()(). The weird &(*list) syntax is only to
avoid changing the rest of the code that used a pointer

Change-Id: Ifaee7464122d402991b6fffd14a0e44f533dc3d9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-09 01:22:12 +00:00
Julien Gueytat
6c8aabbe52 Remove out of date comments related to Xorg and GCC
Task-number: QTBUG-56293
Change-Id: I8d2245755d08b528e2041a16aabb390f3796e545
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-08 23:41:35 +00:00