Commit Graph

36373 Commits

Author SHA1 Message Date
Tor Arne Vestbø
2071d26a34 macOS: Deliver screen changes synchronously
Change-Id: Iea8fcb69b6c05c4f81fedb4ec423aed89d9d2d3c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-06-05 13:44:21 +00:00
Kari Oikarinen
eb5c9a1f2a testlib: Mark unused member variable for future removal
inLoop is only set, never read and it is private. Since the class is public, it
can't be removed yet, but add a comment so that it will be removed when
possible.

Change-Id: I5e212194cb65626fce2b4c7b68801a73dbe3f500
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-06-05 06:00:32 +00:00
Milla Pohjanheimo
2b8287b666 Add binary compatibility files for 5.11 for QtBase
Binary compatibility files for bic test added

Change-Id: Ie540ea0084c72a6a0ae7c47831ecbcc0dd7030b9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-05 06:00:28 +00:00
Gabriel de Dietrich
23ae05cf68 QMacStyle: Fix clipped arrow in QToolButton
A quick and reasonable fix is to make sure the arrow fits in
SC_ToolButtonMenu returns. In the future, we should keep the
arrow's actual size and offset the icon accordingly.

Change-Id: I218fa7726efbe4576a72889c41685de87ac14ac1
Task-number: QTBUG-68517
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-06-04 16:44:25 +00:00
Gabriel de Dietrich
0866fe2079 QMacStyle: Fix QComboBox left contents margin
Change-Id: I89a5e0c271bdaced8440e123c63c5435fa725856
Task-number: QTBUG-68518
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-06-04 16:44:16 +00:00
Timur Pocheptsov
a217188fe0 tst_Http2 auto-test: stop sending DATA frames if test failed
Unlike QNAM, our toy http2 server sends payload as one big chunk as soon as
it fits in the receive window's size. Internally, 'frame writer' splits this
payload into many DATA frames of the appropriate size (imposed either by the
default value or the one from the client's SETTINGS frame). If some test fails,
we can end up with a server waiting for the writer to send all the DATA frames
though it is not needed anymore - there is nobody to receive them after a failure.
This patch moves such a loop into the test server instead and stops the loop early
if needed.

Change-Id: Iea2dcd718d8f83386fd16004807f6447bf999435
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-04 13:38:04 +00:00
Joni Poikelin
092630cbf9 Fix building with -no-feature-dirmodel -no-feature-filesystemmodel
Change-Id: I7ab90043b2bf6ee41412480f72eb701230cecb38
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-06-04 09:19:02 +00:00
Mårten Nordheim
b1bd2021d2 Doc: Remove outdated info and linkify value
No reason to duplicate the info there in a paranthesis.

Change-Id: Ie01be382d36bbc8e7f2eff4cc7ae0df207869c25
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-06-04 07:08:17 +00:00
Andre Hartmann
41ae28e1b7 QAbstractSpinBox: Add more documentation cross links
stepUp() and stepDown() already linked to stepBy(), so add the
reverse too.

keyPressEvent() talks about stepBy() too, so add it to the cross
reference.

Change-Id: I22c841821331eaed9607cfb2807dcf0e2886d952
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-06-04 07:04:59 +00:00
Samuel Gaist
abe3373489 Doc: Add information about QThread own methods thread affinity
This patch improves the documentation regarding the thread affinity of
QThread's own methods. It's not always clear for people new to threading
that a QThread object lives in the old thread were it was instantiated
and that calling the methods of said objects will also happen there.

Change-Id: I3599851ebc97a33602ca6499da254a08aec59b2b
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2018-06-03 20:26:47 +00:00
Samuel Gaist
04b180f7f2 Improve std::tuple handling in tests
Currently when doing comparison with std::tuple the fallback toString
method is called which returns a Q_NULLPTR thus not allowing proper
diagnostic of the values that triggered an error. This patch
adds support for std::tuple to improve the tests output readability.

[ChangeLog][QtTest][QCOMPARE] Now outputs contents of std::tuple on
failure.

Change-Id: I046a55e2ce44c3f7728d51e4745120d38aa5e007
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-03 20:26:38 +00:00
Thiago Macieira
9998654eac Examples: use CBOR in the network-chat broadcast message
Instead of sending one @-separated message, send one CBOR message. The
message structure is, using the CBOR Data Definition Language:

  broadcast = [
    username: tstr,
    port: 0..65535
  ]

Change-Id: Ic38ec929fc3f4bb795dafffd150ac2614d18c6bf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-06-02 03:11:33 +00:00
Thiago Macieira
bfcb8c6dca Examples: change the main network-chat protocol to CBOR
This complements the previous commit, which changed the broadcast
datagram to CBOR. This commit changes the TCP protocol too. The protocol
is an infinite array of commands, each of which is a map from an integer
(the DataType enum) to either a string or null.

The entire state machine for the connection is rewritten, relying on
QCborStreamReader's ability to deal with incomplete data.

Change-Id: Ic38ec929fc3f4bb795dafffd150ac674c32fac87
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-02 03:11:30 +00:00
Andy Shaw
c901cdadc0 QLineEdit: Add an inputRejected() signal for when a key is not allowed
[ChangeLog][QtWidgets][QLineEdit] Added inputRejected() signal for when
a key press is not accepted by the QLineEdit. For instance, when an
invalid key is pressed for a validator set.

Task-number: QTBUG-57448
Change-Id: I39182a78b07b37c6da01905b8da4c57930e3454b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-01 21:34:03 +00:00
Martin Smith
e3e0a6d6d6 doc: Document Qt namespace in multiple modules
qdoc didn't handle this. This update fixes most of what was wrong,
but tuning the details of the namespace reference pages might follw.
We have namespace Qt as an exaqmple. Most of the elements in the Qt
namespace are in QtCore, but a few functions are declared in QtGui.
Before this update, qdoc used the hack of using #ifdef to remove the
declarations from qtextdocument.h in QtGui and .cpp and then added
them back into qtnamespace.h and .cpp in QtCore.

Now that hack is no longer necessary. The functions in the Qt namespace
that are declared in QtGui are documented there, but the documentation
is linked to from the namespace reference page, which remains in QtCore.
That is, only one \namespace command is used to document the Qt namespace,
and it appears in qnamespace.qdoc where it always did, but the documentation
for the Qt namespace functions declared in QtGui is now appears in
qtextdocument.cpp where it belongs.

Change-Id: Ic5888875c3b8310a3dba244475e2a6c3bc0c1808
Task-number: QTBUG-67267
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-01 16:38:01 +00:00
Oswald Buddenhagen
73a991cbc3 Bump version
Change-Id: I49f92ea9315bf13245a054fe8fbfbf9ebeb53cc0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-06-01 10:37:15 +00:00
Oswald Buddenhagen
a15de936d0 configure: permit multiple repos to use the same directory names
otherwise, names like "core" are too likely to clash.

note that the directories (which contain configure files) still need to
have unique names within one repository. that's unlikely to be a
problem.

Task-number: QTBUG-68385
Change-Id: I01c60479a6a45494ba60e798ceada231d8870556
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
2018-06-01 10:36:59 +00:00
Thiago Macieira
a151e89178 Fix change-of-sign warning found by ICC
qhostaddress.cpp(263): warning #68: integer conversion resulted in a
change of sign
      length = -1;
               ^

I changed the length member from int to quint8 in commit
8656ee950b but I never tested ICC.

Change-Id: I052407b777ec43f78378fffd15311669b490ed7b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-01 10:03:16 +00:00
Nico Vertriest
28738d2d8d Doc: Add formatting features to Notepad example
- bold, italic, underline
- About button

Change-Id: I8ece7d2bfca0b148b681a2fccb4a439ce179848a
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-01 09:54:56 +00:00
Thiago Macieira
e1b40675ba Fix warning about tautological comparison in 32-bit mode
qwaitcondition_unix.cpp:209:14: error: comparison of constant 9223372036854775807 with expression of type 'unsigned long' is always false

Task-number: QTBUG-68568
Change-Id: Icc2c231dc2c44abdb087fffd1533c70ae68060dd
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-06-01 09:12:47 +00:00
Oswald Buddenhagen
7c87ffff9a qmake: skip empty parts when splitting strings in some more places
... and make it explicit where we can't do that for semantical or
backwards compat reasons.

most urgently, this fixes an assertion failure when $QMAKEFEATURES
contains empty paths (e.g., due to a trailing semicolon).

notable observation: QByteArray::split() has no argument for the split
behavior (it always keeps empty parts).

Task-number: QTBUG-47325
Change-Id: I72d4b2e154a2ed1802cfa98fb4a5211a68e43231
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-06-01 09:09:35 +00:00
Sergiy Korobov
94f249977c Fix QWindowsNativeInterface::platformFunction()
QWindowsWindowFunctions::setWindowActivationBehavior() does not work
because QWindowsNativeInterface::platformFunction() is broken.

Task-number: QTBUG-37435
Task-number: QTBUG-14062
Change-Id: Id5688316654ea8ad47d5c68894c376cb83e3583a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-06-01 07:30:31 +00:00
Kai Koehne
97c8b970cd Revert "Atomics: remove qatomic_msvc.h"
This reverts commit 90493e16b8.
The change broke static builds with MSVC.

[ChangeLog][Visual Studio] Reverted a change that caused static
binaries compiled with Visual Studio 2015 to crash on start-up. Note
that this does not apply to Visual Studio 2017 static binaries, even
though the crash stack traces are very similar: with 2017, the problem
is compiler regression and requires updating to version 15.8 for the
fix.

Task-number: QTBUG-68514
Change-Id: I67ea8e1ef442cecab83e7d8d74efc9617e02da35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-06-01 06:24:18 +00:00
Allan Sandfeld Jensen
0a63d5fed6 Render QOpenGLWidget/QQuickWidget with AlwaysStackOnTop
QWidget::render was ignoring QOpenGLWidget/QQuickWidget with
AlwaysStackOnTop set, because normally they will be composited later,
however when not doing a backing store render, they need to be painted
right away as there is no later.

Task-number: QTBUG-67533
Change-Id: I08e2eeee5e7a8f0dbbf43f659fcfa9068e8c46d1
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-05-31 22:10:48 +00:00
Allan Sandfeld Jensen
dc2476c75e Fix clang develop build
A mismatch of enums after a rename.

Change-Id: Ib28e4607f20583afcb9210fdef7f52d95c63e3dd
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-05-31 21:35:01 +00:00
Edward Welbourne
6c3603f2ad Eliminate an un-needed #include
Nothing in this test references date-times.

Change-Id: I4005cda550d54abe46370963b1e91fab9829298d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-31 15:52:20 +00:00
Edward Welbourne
2d3bbd7f17 glextensions.h: simplify #if-ery to avoid conflict
The prior #if-ery was needlessly confusing; and most of it was
redundant anyway.

Change-Id: I82da1b38c08b93b9dc2220dd7b15ecb7dcc002af
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-31 15:51:55 +00:00
Tor Arne Vestbø
c4a21708ed Provide presets for QGradient
Similar to Qt::GlobalColor, the presets allow the user to create
brushes based on predefined gradients, quickly getting pretty pixels
on screen.

The presets are based on the linear gradients from WebGradients, a
free collection of gradients, hosted at https://webgradients.com/.
The few radial and blended gradient presets have been excluded.

Change-Id: I1ce8f2210a6045c9edb8829ab3eddcc313549127
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-31 15:50:50 +00:00
Tor Arne Vestbø
c538a333db macOS: Make layer-backed mode the default
QWindows are still backed by NSViews, but these views render to a
CoreAnimation layer instead of directly to the top level NSWindow.

This is the direction Apple is going (and is the only available
option on iOS/tvOS), so we want to move away from the existing
code path as soon as possible.

The default can be reversed by setting QT_MAC_WANTS_LAYER=0, or the
_q_mac_wantsLayer property on QWindow.

[ChangeLog][macOS] Layer-backed mode is now the default for QWindow.

Change-Id: Ibb9cc7541b179cad215d0daee14aeb1b54be614c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-05-31 15:50:33 +00:00
Edward Welbourne
af928dd160 tst_qstandardpaths: #if-out a function only used within #if-ery
Avoids an unused function warning.

Change-Id: Id221595920e9a34eb83b66fe123d664f60fcae05
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-05-31 15:50:17 +00:00
Mikhail Svetkin
c9d593d431 macOS: minor refactoring in mouse handlers for nsview/systemtrayicon
Use new helper functions for mouse events

Change-Id: I01e83a228deb16cbdb1d7c8c628a92d48055ee2b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-31 15:49:50 +00:00
Edward Welbourne
78ac98a590 Remove LGPL_EXCEPTION.txt
It became obsolete when we switched to LGPL3, as discussed on the
developer mailing list in April 2017.

Change-Id: I8445a0e6febba8b31a95fbc140343c2013776b48
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-31 15:46:36 +00:00
Friedemann Kleint
3d841556bf Windows QPA: Fix release button event type after moving windows
Check whether the mouse is inside the window and report
MouseButtonRelease or QEvent::NonClientAreaMouseButtonRelease,
respectively. The inside case is triggered by programmatically
starting a size move via QPlatformWindow::startSystemResize()
(QSizeGrip) and was overlooked in
7c3ecf85a7.

Complements 4589440891,
7c3ecf85a7.

Change-Id: I8f714dc768a163878c2b4a075470bcee2dfbd802
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2018-05-31 14:41:06 +00:00
Tor Arne Vestbø
7e2177464f macOS: Allow moving out of fullscreen state using titlebar button
Even if the window isn't configured with Qt::WindowFullscreenButtonHint,
the user might call showFullScreen(), which we respect and move the
window into fullscreen. In this state, we need to keep the collection
behavior as NSWindowCollectionBehaviorFullScreenPrimary, otherwise the
zoom button will have no effect and the user can't move out of fullscreen.

Change-Id: I77a4b4ee4b42fabc4c6ed2f529ff57acc31d6c24
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-30 23:12:32 +00:00
Thiago Macieira
b9935239db QCborStreamReader: rewrite read{String,ByteArray}()
This rewrites _readString_helper() in terms of _readByteArray_helper()
(the helper version doesn't do type-checking) and rewrites
_readByteArray_helper() in terms of readStringChunk().

Change-Id: Iab119b62106d40fb8499fffd1510aa404d9f3611
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-05-30 19:49:01 +00:00
Allan Sandfeld Jensen
ccfb309b90 Document qRound's rounding semantics
This differs from both C rounding (away from zero), and IEEE-754
rounding (to even).

Change-Id: I2cdd358824ca14c922b23029308e3ce3258c1d8f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-30 16:12:03 +00:00
Liang Qi
a4d7535f19 Fix missing override warning for android
This amends 8447f5f006.

Change-Id: Idd25c13735539682f6034724df4c79fcf10a1810
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-30 15:01:00 +00:00
Tor Arne Vestbø
b6fcc86101 macOS: Minor metal support nits/cleanups
Change-Id: I840426ebf35b0fec64e92386fc3e1cabd91ced25
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-30 14:38:53 +00:00
Oswald Buddenhagen
04ebb981ab qprocess: don't leak pid pipe if redirection fails in startDetached()
Change-Id: Ifc42f634964b9412f73f53fb20bd220fcbd9a86c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-30 10:58:01 +00:00
Oswald Buddenhagen
fc9378952b nuke {tests,examples}_need_tools flags
making the dependencies on tools/ optional was meant to maximize build
parallelization, but it's just too fragile, as nobody ever remembers (or
even knows) about having to add the flags when necessary.

Task-number: QTBUG-68478
Change-Id: I85c0b65d5a63109aedc24bc17eaaaf46b777b634
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-05-30 10:57:45 +00:00
Oswald Buddenhagen
00c3418b1e remove support for demos/ directories
no module had one for ages.

Change-Id: Ifb829140e6c97d43e1c8431cb377af8a12231f95
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-05-30 10:57:41 +00:00
Tor Arne Vestbø
286c153583 iOS: Handle application state for application extensions
Change-Id: I97df0f8ecf93e28bfbe9c719922f1ee5ec12b563
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-30 09:46:39 +00:00
Tor Arne Vestbø
0587941f6e Add function to safely access the shared application on Apple platforms
Change-Id: I52910309ba94d84d69f049b5c1990f1f866e1698
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-30 09:16:23 +00:00
Tor Arne Vestbø
6ada504475 Add function to check whether or not we're part of an extension on Apple OSes
Change-Id: I308147c752ec9c869db87aa94ccf6c88e0999524
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-30 09:16:07 +00:00
Allan Sandfeld Jensen
ffc377a529 Reduce recent performance regression
The change to fix 16-bit integer overflow used two floor operations
when only one is necessary. With floor being rather expensive on x86
without SSE4.1 this caused a performance regression in ARGB32
smooth perspective transforms.

This eliminates one of the floor operations which is unnecessary as the
number is always positive in this case and thus truncation will yield
the same result faster.

Change-Id: Iaae76820d4bc2f368e49ed143130b5075fc760a2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-05-30 08:28:41 +00:00
Allan Sandfeld Jensen
d517d5428c Use qFuzzyCompare instead of qFuzzyIsNull in QPointF ==
qFuzzyIsNull has a fixed range, where qFuzzyCompare can tell if numbers
are different in a more relative range. Without it QPointFs that are
heavily scaled will be interpreted as identical, when they are quite
different at their own scale.

Task-number: QTBUG-60359
Task-number: QTBUG-62161
Change-Id: Ic4ba90e9e994aedff5548d690f053eb309b0a60b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-30 08:28:11 +00:00
Laszlo Agocs
6a14608742 QOpenGLTexture: Enable multisample 2D textures on GLES 3.1+
Task-number: QTBUG-68510
Change-Id: Ib224189906b595bbae5aab95c888dd13e94171aa
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-05-30 07:53:15 +00:00
Thiago Macieira
28ab81158f forkfd: Restore errno on exit from the SIGCHLD handler
I'd never thought about it, but it is a requirement: a signal handler
must leave the global state as it found it (except for those bits that
it intended to change, and those must be done in an async-signal-safe
way). Otherwise, errno could change from one line to the next in the
middle of some code.

[ChangeLog][QtCore][QProcess] On Unix, the QProcess SIGCHLD handler now
restores errno on exit.

Task-number: QTBUG-68472
Change-Id: If025d476890745368955fffd1531e7126f1436d9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-05-30 03:57:36 +00:00
Thiago Macieira
b9dc4f7a96 Suppress warnings about deprecated QString constructor
They were introduced in commit c416a7f257.

 warning: ‘QString::QString(const QByteArray&)’ is deprecated: Use fromUtf8, QStringLiteral, or QLatin1String [-Wdeprecated-declarations]

Change-Id: I6a540578e810472bb455fffd1532e31736e1edc9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-05-30 03:57:32 +00:00
Gabriel de Dietrich
9ffb001306 QAbstractSpinBox: Fix missing frame condition
Wrong check for SH_SpinBox_ButtonsInsideFrame in initStyleOption().

Change-Id: I35c6ff4d007f171fe44d7f3e5734c6f4586d871b
Task-number: QTBUG-68238
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-05-30 02:13:49 +00:00