Commit Graph

31605 Commits

Author SHA1 Message Date
Liang Qi
71264bae08 Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
2017-03-02 09:04:38 +01:00
Marc Mutz
5e785c0b83 Add a string API symmetry test for mid/left/right
All good.

Change-Id: Iab278c24b4bd462d5e77af0c4f0fefb155d00551
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-03-01 13:40:12 +00:00
Mathias Hasselmann
0d34f0c9df Android: Allow timeout to fade out splash screen
Change-Id: I7b24f4d402da7f74b4c983467008ff4c19fc3b1b
Task-number: QTBUG-59200
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-03-01 09:15:14 +00:00
Jake Petroules
8d0b46c3ae Remove more tight coupling between QMdiSubWindow and QMacStyle
This technically just changes a compile time check to a run time check
and better options should be explored later, but it removes the compile
time dependency for now.

Change-Id: I58c5599baf2c338e88bd558a82093835124d6f67
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-28 19:21:53 +00:00
Jake Petroules
6ed4ff2535 Remove unused references to QMacStyle headers
Change-Id: If7b84e3b8a0a8682d031e7a1ebf066feedf6a97c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-28 19:21:47 +00:00
Kai Koehne
6d10f739cd evdevtouch: Replace LPGL21 with LGPL license header
Also use caonical contact url.

Change-Id: Ic229623b0bcb533a9801890347802469c9c53c59
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-28 15:35:02 +00:00
Kai Koehne
7392985a5c XCB: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: I6976dd6e2898d1c80260b08a8257f2848b4b7b6c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-28 15:34:58 +00:00
Kai Koehne
a244636817 Windows QPA: Replace LGP21 with LGPL license header
Also use canonical contact url.

Change-Id: I58c7f5309883fa775d1bf7b56692e4c237a3f5a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-28 15:34:46 +00:00
Kai Koehne
3ea8102343 Integrity plugin: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: I7faf9b329f4dd2c2a422d02e171bc2d39c359ed3
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-02-28 15:34:40 +00:00
Kai Koehne
5590d84062 bsdfb plugin: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: Iaf22c48d0a548efaccd816132e8730cbb6e0bb5d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-02-28 15:34:35 +00:00
Kai Koehne
2ef1d48be7 IOS: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: Id1d8328e6cc9aab82a30e0ee3a971e6935341b42
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-02-28 15:34:27 +00:00
Kai Koehne
13d3e05e3b pcre2: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: I61bf0990698a7021f1240deaf3eef2aff8f90a7e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-28 15:34:20 +00:00
Kai Koehne
58cf57492c Widgets: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: I59ed3d09d2fee877a577a00e7e1cb09782d26512
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-28 15:34:14 +00:00
Kai Koehne
a64c766a3d Network: Use canonical license headers
Replace outdated LGPL21 with LGPL license header.
Use GPL-EXCEPT for all autotests.
Also use canonical contact url.

Change-Id: I6e5cc8a4285569c4f862730a980f492b8a933a72
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-02-28 15:34:01 +00:00
Kai Koehne
a62d8ab993 Doc: Use canonical contact URL in license header
Change-Id: I34821150f66255df30d12572b27779e0e729ebc8
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-28 15:33:49 +00:00
Olivier Goffart
eadae036f5 QDockWidget: remove dead code
I suppose that once upon a time, the plug function used to return the
rectangle of the new item. But right now, the 'result' is not used
so we can remove all the code that computes it.

Change-Id: I786e1f1ead82ac64a5eed632f3a3836f67c59c10
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2017-02-28 12:10:24 +00:00
Liang Qi
1a4f0deeb4 Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I7d84cfed0b2a122d334b8a920e6e4f18472d2f11
2017-02-28 13:03:36 +01:00
Allan Sandfeld Jensen
6dc7e468df Do not include qfloat16 tables in arm64 builds
The FP16 extension in IEEE mode is mandatory for Aarch64, so there is
no aarch64 configuration where the tables will be needed for conversion.

Change-Id: I9804e55c193cc9b5adcaedb720d8b980624139cc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Glen Mabey <Glen.Mabey@swri.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-28 12:01:18 +00:00
Marc Mutz
49c558eb0d QSizePolicy: inline toControlTypeFieldValue()
The implementation now uses the relaxed-constexpr
qCountTrailingZeroBits() function from QtAlgorithms, making the
QSizePolicy(Policy, Policy, ControlType) constructor constexpr on
C++14 compilers. The explicit check for DefaultType remains to keep
the constructor C++11-constexpr when called with just (Policy,
Policy).

Extend the constExpr tests a bit.

Change-Id: I59690f0921d9bdee08e3615d0d1f4a9b92870c32
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-02-27 23:09:27 +00: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
Marc Mutz
bc641ad9f8 QSizePolicy: simplify implementation
Even though we revoke its Q_COMPILER_UNIFORM_INIT for certain bugs
that affect existing usage in Qt, it turns out that MSVC 2013 supports
enough of braced initialization to make the macro magic in
Bits::transformed() moot.

Change-Id: I824d7fa298a2b95b4ad45c9e259e91c5ececfc0c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-27 21:16:04 +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
Shawn Rutledge
2b2fefb336 xcb: correct conversion of AbsX/AbsY to tablet width and height
This was a mistake in cb37ab8298

Change-Id: I5897ceb34ab4aa1655efd20697d0e761cf7796b1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
2017-02-27 15:45:29 +00:00
Marc Mutz
3fdbba7a7a QSizePolicy: mark as relocatable type
Use Q_RELOCATABLE_TYPE now that we have it.

Change-Id: I04bb946695ebb9f0899bb73becbef301805389ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-27 15:36:12 +00:00
Giuseppe D'Angelo
9d82b1586d QEasingCurve: mark as shared
Requires no further changes.

Change-Id: Ib280fa69a752aefa1c29fc5f0eb292e99b96270a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-27 15:35:59 +00:00
Laszlo Agocs
dfc338613e Make QPlatformSurface events work with QWindowContainer
Embeddeding a QWindow via QWidget::createWindowContainer() fails to
deliver the SurfaceAboutToBeDestroyed event. This breaks any OpenGL
or Vulkan based QWindow that releases resources upon this event, and
is particularly critical with Vulkan where the only way to do properly
ordered swapchain - surface cleanup is via this event.

In the non-embedded case close() eventually ends up in an explicit
destroy() in QWindow. In the embedded case destroy() only gets called
from ~QWindow. This then silently breaks since the subclass' reimplemented
event() virtual is not getting called anymore.

To remedy the problem, simply add an explicit destroy() to
QWindowContainer.

Task-number: QTBUG-55166
Change-Id: I1671e8f4d39f6c44e19eca7b9387f55fe3788294
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-02-27 12:38:08 +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
Stephan Binner
e39e4bfc0f System tray icon requires -feature-temporaryfile
Change-Id: I28039dd566c774b5844f4617c4dfb8bbce6673f7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-27 07:46:58 +00:00
Stephan Binner
204251e8f4 Fix build for -no-feature-systemtrayicon
Change-Id: If85cf995c5eefa2c4d648c9ad4b02922a13f682a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-27 07:46:51 +00:00
Stephan Binner
f85f21edbc Fix build for -no-feature-textdate
Change-Id: I31ad3fdde293759f04a136d7c7212288cafdc840
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-27 07:46:41 +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
Marc Mutz
1d31f23ce9 QVarLengthArray: add rvalue overload of append/push_back
Improves performance when appending temporaries, esp. since
the aliasing fix in the lvalue overload in 0f730ef made that
overload correct, but a bit slower across reallocs.

The unit tests already also pass rvalues, so the function is
covered in the existing tests.

[ChangeLog][QtCore][QVarLengthArray] Added rvalue overloads
of append() and push_back().

Change-Id: If3a6970f03a160cba5b42d33d32d3d18948f6ce3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-25 21:04:01 +00:00
Simon Hausmann
63856135da Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9 2017-02-24 23:32:33 +00:00
Timur Pocheptsov
14db1d5560 HSTS policy - fix API
API-review follow-up:

1. make a ctor explicit
2. add swap member-function
3. make move-assignment inlined
4. make comparison operators non-members
5. make d_ptr QSharedDataPointer (and private implementation - QSharedData).

Change-Id: I3257ca03cccd0f1254c9b95461752911359352a5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-02-24 21:16:09 +00:00
Gabriel de Dietrich
e6d23860f0 QApplication: Remove code duplication
We always send mouse move events through the application event filters
even if the widget has no mouse tracking enabled. This code portion is
an almost verbatim copy of QCoreApplicationPrivate::sendThroughApplicationEventFilters().

The only difference is that previously the filter and the widget had
to be in the same thread. Now, we compare the filter's thread to the
application's. This is without consequence since widgets must live in
the application thread.

Change-Id: Ifee9c041e06d80ea0c2d2a947231e58ee4dfa24d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-24 19:51:54 +00:00
Liang Qi
de49839df8 Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	mkspecs/features/moc.prf

Change-Id: Ia71c8e3b3185f7c999bf226d0675051b10b8740b
2017-02-24 20:01:42 +01:00
Olivier Goffart
4d3781b640 QDockWidget: Fix memory leak when dragging a tab outside of a floating tab window
A QDockWidgetItem will be leaked if a QDockWidget is dragged out of a
floating tab window, and then plugged back somewhere.

The problem is that QMainWindowLayout::unplug was not returning the
QDockWidgetItem* from the floating tab's layout. When that's the case,
a new QDockWidgetItem is created in QDockWidgetPrivate::startDrag
and will be put into the layout, leaking the old QDockWidgetItem.

Change-Id: Ifb9c1c562cb74383ebff1df0f91ee225c5cdb296
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2017-02-24 15:00: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
Marc Mutz
e623453592 QImageReader: remove some unneeded relocations
Replace an array of pairs of pointers with an array of pairs of
arrays. Remove the unused end marker. Add a static_assert to
verify that the size of the array matches the constant all loops
use.

Also extract the common part of the mime-type name and append it when
building a QByteArray from it. This is free, as both the new
QStringBuilder expression as well as the old construction from a const
char * incur one memory allocation each.

Replace one indexed loop with ranged-for.

Results on optimized GCC 6.1.1 Linux AMD64 builds:
 text   -96B
 data  -160B
 relocs -16

Change-Id: Ic23eb06bacbf70afb6f60e2fb8a140bdd3880aca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-24 08:23:38 +00:00
Marc Mutz
5a7165f2ea QtGui: kill some unneeded relocations
Turn arrays of pointers into arrays of arrays.

Results on optimized GCC 6.1.1 Linux AMD64 builds:
  text  -264B
  data  -512B
  relocs -43

Change-Id: I0b64615913d50c286596e66675e89758ce1ec2ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-24 08:03:51 +00:00
Marc Mutz
f4495d29e5 Clean up QByteArrayLiteral definition
Remove the dead QByteArray(data, size) fall-back. We've been
requiring lambdas since Qt 5.7.

Change-Id: I4d9023ab4583f2ee80a74a828fba0d95c2fdb0df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-24 08:03:32 +00:00