Commit Graph

33942 Commits

Author SHA1 Message Date
Liang Qi
d0a0a3c041 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	examples/network/fortuneclient/client.cpp
	examples/network/fortuneserver/server.cpp
	src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
	src/plugins/platforms/cocoa/qcocoabackingstore.h
	src/plugins/platforms/cocoa/qcocoaintegration.h
	src/plugins/platforms/cocoa/qcocoascreen.h
	src/plugins/platforms/ios/qiosbackingstore.h
	src/plugins/sqldrivers/oci/qsql_oci.cpp
	src/widgets/kernel/qwidgetwindow.cpp

Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
2017-10-17 10:34:24 +02:00
Tor Arne Vestbø
ac35f9c44c macOS: Mark the widget's container as embedded when placed into NSMenuItem
Otherwise we'll end up creating a NSPanel for the QMacNativeWidget which is
never closed, even if the backing NSView is moved to a new superview.

Ideally this would be based on [NSView viewDidMoveToSuperview] and
[NSView viewDidMoveToWindow], with retain/releases of the corresponding
NSWindow, but that needs more research, especially as AppKit on macOS
10.13 will always keep a strong reference to the NSWindow.

Task-number: QTBUG-63443
Change-Id: I9eec5ea871373d00dedf154600bf7005898cf37a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-10-16 17:22:21 +00:00
Tor Arne Vestbø
ed9340a926 macOS: Add support for non-window backed offscreen surfaces
The modern approach to offscreen rendering on macOS is via FBOs, which
means there's no reason to allocate an NSView and corresponding NSWindow
just for that. In the offscreen case the NSOpenGLContext has a nil-view.

Change-Id: I2d1d407069af4d5283e6f56fba83db8eaf694ac6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-10-16 17:22:17 +00:00
Timur Pocheptsov
a520c179b8 HTTP/2 protocol handler: tweak receive window sizes
We were using the default ones, provided by RFC7540. It appears they are way
too restrictive and conservative: when downloading something relatively big,
a stream keeps spending the whole session/its own 'recv' windows and thus
we have to constantly send WINDOW_UPDATE frames. This significantly slows
down our HTTP/2 implementation, making it orders of magnitude slower than
HTTP/1.1. To fix this:

- We send SETTINGS_INITIAL_WINDOW_SIZE in the first SETTINGS frame
  to inform our peer that per-stream WINDOW is bigger than 64Kb
- We increase the session's receive window size.

Task-number: QTBUG-63722
Change-Id: I31312fcfd5f0fc0aee6aaa5d3562cc7d1b931adc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-16 16:54:32 +00:00
Thiago Macieira
65eed6d597 configure: make C++11 <random> a required functionality
Error out if it's missing or broken (Mersenne Twister not present).

This ensures that we never have a low-quality random generator in Qt.

Change-Id: I0a103569c81b4711a649fffd14ec80649df7087e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-10-16 16:25:34 +00:00
Edward Welbourne
a090076e93 Don't lose precision in QMacTimeZonePrivate::previousTransition()
NSTimeInterval is a typedef for double, but the code stored its value in
an int, and only then multiplied by 1000.

Fix by only truncating NSTimeIntervals to int(64_t) *after* the
multiplication by 1e3 to get milliseconds.

While it's highly unlikely that a transition will have fractional seconds
length, don't assume if you can just calculate the more exact result.

Adapted-From: Marc Mutz <marc.mutz@kdab.com>
Change-Id: I0911b9c945a94ca24c3dfb23ed6a849141076326
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-16 16:11:19 +00:00
Andre de la Rocha
9f405f98a4 Add virtual keyboard geometry support to Windows port
Overrides keyboardRect() and isInputPanelVisible() in QWindowsInputContext
in order to provide support for virtual keyboard geometry and visibility
information in the Windows platform.

Change-Id: I15382e604dc076929d253c0c1fbe64ea7da853ce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-16 12:14:55 +00:00
Laszlo Agocs
414c058ca7 hellovulkantexture: Fix issues with new validation layer
Upgrading to a recent Vulkan SDK (e.g. 1.0.61) leads to getting
a few previously unseen warnings from the validation layers.

Fix these:

vkDebug: ParameterValidation: 8: vkCreateSampler(): The
samplerAnisotropy feature was not enabled at device-creation
time, so the maxAnisotropy member of the VkSamplerCreateInfo
structure must be 1.0 but is 0.000000.

vkDebug: DS: 461375808: vkCmdPipelineBarrier():
pImageMemBarriers[0].srcAccessMask (0x4000) is not supported by
srcStageMask (0x1). The spec valid usage text states 'Any given
element of pMemoryBarriers, pBufferMemoryBarriers or
pImageMemoryBarriers must not have any access flag included in
its srcAccessMask member if that bit is not supported by any of
the pipeline stages in srcStageMask, as specified in the table of
supported access types.'

vkDebug: DS: 6: vkCmdDraw(): Cannot use image 0x7 with specific
layout VK_IMAGE_LAYOUT_GENERAL that doesn't match the actual
current layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL.

vkDebug: DS: 61: Descriptor set 0xc encountered the following
validation error at vkCmdDraw() time: Image layout specified at
vkUpdateDescriptorSets() time doesn't match actual image layout
at time descriptor is used. See previous error callback for
specific details.

Change-Id: I1a3200221ac725c2fa661eff3ac075262b9355c2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-10-16 08:15:39 +00:00
Joerg Bornemann
b5f2bf1a71 Fix QWinEventNotifier for auto-reset events
Auto-reset events are automatically reset to non-signaled when we get
notified about the signaled state. This implies that we cannot check the
event state again in activateEventNotifiers. Instead, store the signaled
state in a QAtomicInt and test and decrement that.

This amends commit 85403d0a.

Task-number: QTBUG-63555
Change-Id: I0adee3d2929783f98d91060f9106c8b5266d72fa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-15 16:14:04 +00:00
Christian Ehrlicher
1a039e89be Unify wording in documentation to use 'top-left' instead 'upper-left'
The Qt documentation is using 'upper-left' everywhere except at
QRect(F) detailed description and Qt::CoordinateSystem enum description.
Therefore fix it in those four places to be consistent.

Task-number: QTBUG-59981
Change-Id: Ie652044d0207ea5a42888d9e1f1dc9a86b1e9410
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-10-14 10:05:15 +00:00
Friedemann Kleint
015a4bb2f1 QVulkanInstance: Fix compilation with MSVC2013
Use assignment. Fixes:

vulkan\qvulkaninstance.cpp(811) : error C2061: syntax error : identifier 'd_ptr'
vulkan\qvulkaninstance.cpp(812) : warning C4551: function call missing argument list
vulkan\qvulkaninstance.cpp(813) : error C2659: '=' : function as left operand
vulkan\qvulkaninstance.cpp(814) : error C2440: 'return' : cannot convert from 'QVulkanDeviceFunctions *&(__cdecl *)(void)' to 'QVulkanDeviceFunctions *'
        There is no context in which this conversion is possible
vulkan\qvulkaninstance.cpp(832) : error C2061: syntax error : identifier 'd_ptr'
vulkan\qvulkaninstance.cpp(833) : error C2541: 'delete' : cannot delete objects that are not pointers
vulkan\qvulkaninstance.cpp(834) : error C2659: '=' : function as left operand

Change-Id: I859b141aa0cb24b1f85dc9f229262a4145651d7c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-10-14 07:27:08 +00:00
Jędrzej Nowacki
1798f0aa37 Build fix for clang-5.0
qkmsdevice.cpp:737:40: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]

Change-Id: I90f0281baeb7bd8216d62515e4b087070c98c235
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-14 07:07:08 +00:00
Thiago Macieira
d4ea12e260 Doc: fix QRandomGenerator missing updates after rename
Commit 282065d443 renamed the generator
functions but we didn't update all the docs.

Change-Id: I0a103569c81b4711a649fffd14ec877ffbfe710d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-14 02:13:56 +00:00
Thiago Macieira
13b6c1e625 QRandomGenerator: improve internal noexceptness
There are a couple of Q_ASSERT wrapped by the new noexcepts, but most of
those aren't validation of external parameters, only of internal
construction. The two exceptions are the checks for pointer alignment.

Change-Id: I0a103569c81b4711a649fffd14ec8523d741dfb6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-10-14 02:13:53 +00:00
Thiago Macieira
0a98f790bf QNetworkInterface: don't include addresses from inactive interfaces
Incidentally, we can fix a typo.

[ChangeLog][QtNetwork][QNetworkInterface] Changed allAddresses() to not
include addresses found in inactive interfaces, matching the user
expectations of this function. If those addresses are needed for some
purpose, the application will need to call allInterfaces() and obtain
the addresses in each interface.

Task-number: QTBUG-51922
Change-Id: Iaf4157b7efa2416d898cfffd14d969c963ec0a2a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-14 02:13:51 +00:00
Thiago Macieira
28a6529c2a QTest: make toString(QHostAddress) work
I don't know why this needs to be a template specialization instead of
overload, like all the other toString overloads. With GCC 7, it was
calling QTest::toString<QHostAddress>, which returns nullptr.

Change-Id: I638cf58bfa7b4e5fb386fffd14ea7add0eef8f87
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-10-14 02:13:49 +00:00
Laurent Montel
638dcbe337 Printsupport: Not necessary to call setLayout when we added the parent
Change-Id: I3504afbc7bb1aaa8c2619532fa4e05740dd6f3c4
Reviewed-by: David Faure <david.faure@kdab.com>
2017-10-12 16:45:05 +00:00
Richard Moe Gustavsen
0e1c9a34c2 QPlainTextEdit: draw placeholder text correctly when it wraps
382faed introduced placeholder text to QPlainTextEdit. But the code
relied on the text begin short enough to fit inside the width of
the text edit. If the text was longer, and therefore wrapped, drawing
artifacts would show.

This patch will listen for text changes and check if the
placeholder text should show or not, and if so, issue a full update
to ensure that the whole placeholder text is either fully drawn
or hidden. And then we allow to the placeholder text to be drawn
inside the full rect of the text edit.

Task-number: QTBUG-61875
Change-Id: I808472839ab397340080b56407c76e74f9ad1ae6
Reviewed-by: David Faure <david.faure@kdab.com>
2017-10-12 13:33:29 +00:00
David Faure
55e273c1a2 Fix compilation with clang, missing errno.h
Similar to cfe1a295fc which was in a different file.

Change-Id: I40e204f8603a2d4c10a6c737192957653f537d1a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-12 13:26:16 +00:00
Tor Arne Vestbø
f3a21f267f Fix spelling in qWaitFor comment
Change-Id: I0ac67de3371ee36c21e124e88845aaae63a73f6e
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-10-12 09:51:27 +00:00
Timur Pocheptsov
5e71f40a34 A minor cleanup - fix a comment
... so that it comments the actual code, not what this code was before.

Change-Id: Ib191b9d7bd3ae3cda39a15f0f711cb1dd3c5c2b7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-11 15:50:26 +00:00
Edward Welbourne
ffd822b968 Force QT_LOGGING_RULES in testlib's selftest
On some systems (e.g. Debian/buster) a standard Qt package may install
a qtlogging.ini file, e.g. in /etc/xdg/QtProject/, which suppresses
QDEBUG output.  A ~/.config/QtProject/qtlogging.ini could interfere
similarly.  This can break the selftest, when run with expected_*
files generated without such interference.  Likewise, if those
expected_* files are generated on a system such similar, they won't
work on CI.  Given that this caused confusion and delay with
integrating the latest set of updates to the expected_* files, it
seemed best to save others from similar bafflement.

So set a standard value for QT_LOGGING_RULES in both the selftest and
the generator script, so we get consistency.

Change-Id: I649e2f1f6ead21edf8af051aaee286e369fed064
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-10-11 13:31:43 +00:00
Edward Welbourne
98ef376fb6 generate_expected_output.py: update generated expected_* files
In selftests.qrc, imposed alphabetic order (on stem of name, then on
suffix, effectively treating . as sorting before any letter) while
removing old tests and adding new tests and data.  Updated all non-csv
files and added many missing files.  (Not clear on csv support status;
the script seems to have dropped it after 5.6, but the test still uses
it.)

Left expected_crashes* alone (no new files added, no update to old) as
I don't get results resembling those anticipated.

Omitted printdatatagswithglobaltags, printdatatags due to dangling
hspace on output lines, which upset sanity-bot.  A change to the test
cpp is needed to make it viable to skip that dangling hspace.

Change-Id: Iab3fb626c44a91c249b2fb626c12c75ea0317098
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-10-11 09:59:44 +00:00
Friedemann Kleint
b2fc458620 qopenglcontext_p.h: Fix Clang warning about include resolution
kernel/qopenglcontext_p.h included opengl/qopengl.h as "qopengl.h",
triggering:

In file included from ..\..\include\QtGui\5.11.0\QtGui\private/qopenglcontext_p.h:1:
..\..\include\QtGui\5.11.0\QtGui/private/../../../../../src/gui/kernel/qopenglcontext_p.h(58,10):  warning: #include resolved using non-portable Microsoft search rules as: ..\..\include\QtGui/../../src/gui/opengl/qopengl.h [-Wmicrosoft-include]

Task-number: QTBUG-63512
Change-Id: I867a8f2ceeb8a9369dfe0163c179572feadc033e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-10-11 05:33:51 +00:00
Samuel Gaist
e5fa5bffd0 Doc: move QKeyValueIterator documentation to the right file
The documentation of QKeyValueIterator was in the wrong place. This
patch moves it with the other iterators documentation.

Change-Id: I42ad529f72f9b19fdecfca7ddfeb6e6f4dcfebac
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-10-11 05:24:49 +00:00
Samuel Gaist
6f35d7ea4e Doc: fix indexOf QRegularExpression overload documentation
That overload documentation was missing the "exact" qualifier regarding
the search result.

Change-Id: I27a08b60f9b88ae497f8bd9d9ba6a99f4a9ab4d6
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-10-11 05:24:43 +00:00
Masashi Fujimoto
aebc9023bb macOS: Fix standardLocations() returns invalid path
The file path included in the return value was
incorrect when giving the following value to the argument of
"QStandardPaths::standardLocations()".

- QStandardPaths::AppDataLocation
- QStandardPaths::AppLocalDataLocation
- QStandardPaths::DataLocation

The function to obtain the path to <AppName>.app changed from
CFURLCopyPath() to CFURLCopyFileSystemPath() by commit id
c0da37a806.
CFURLCopyPath() returns a value with a path delimiter appended at the
end, but CFURLCopyFileSystemPath() is not.
This is a commit to append '/' to the end of the return value of
CFURLCopyFileSystemPath().

Task-number: QTBUG-61159
Change-Id: Icaebdf09d9cdf992d59c16a398dfe666e6225f99
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-11 04:51:17 +00:00
Gatis Paeglis
2764d82dc4 tablet: use enhanced mouse event when synthesizing mouse
All the required data is just there, few lines above. Instead of
throwing it away and then deducing again in mouse event handler,
use the enhanced mouse constructor.

Tablet event handler was the last remaining user of the obsolete
mouse event constructor. This patch removes the now unused construtor.

Change-Id: I0df7f1b82f0e768f651aa7fbe2d4efce93e992fa
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-10-10 22:09:29 +00:00
Gatis Paeglis
72dfe1deb3 touch: use enhanced mouse event when synthesizing mouse
The documentation for AA_SynthesizeMouseForUnhandledTouchEvents states:

"All touch events that are not accepted by the application will be
translated to left button mouse events instead."

This is exactly what this patch does. With the enhanced mouse event,
we can simply pass event details as necessary. This should not conflict
with the code doing its own mouse synthesis (as long as custom event
handler accepts QEvent::Touch{Begin,Update,End}).

What was wrong with the previous implementation:

It was sharing the same state variable (mouse_buttons) to deduce button
state/type on physical mouse and emulated mouse. This was wrong, you
can't track state of two input devices by sharing one variable. Moreover,
this variable is intended for tracking state of a hardware mouse only.

Button state on physical mouse (as a separate pointer device) is
irrelevant for touch input (which is another "pointer device"). The
current API does not support multiple pointer devices, thus button state
on one pointer device should not affect state on other pointer device.

Task-number: QTBUG-57465
Task-number: QTBUG-52102
Change-Id: Id45d815508918b4e52319baddb2c9564d52ad783
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-10-10 22:09:22 +00:00
Gatis Paeglis
a37785ec76 qpa: enhance mouse event with type and button data
... and deprecate QWSI APIs that accepts mouse event without mouse button/
type data.

In the early days of Qt5 it was decided to centralize mouse button/type
handling in QGuiApplication (because of limitation of some now unknown
platform). This has proven to be problematic as mouse handling details
differ across platforms (e.g on X11 we do not receive mouse release event
when closing popup windows or ordinary windows that are closed from the
mouse press event). Instead of hacking around platform specific behaviors
in Qt Gui, we should move this task back to platform plugins (similar to
how this was done in Qt4 with native APIs sending mouse details directly
to QApplication). There are even cases where it simply is not possible
to deduce (from QGuiApplication) which button caused the event (e.g. when
more than one button is involved and some event goes missing). Besisdes,
throwing away information which is already available at QPA level (for free)
and trying to deduce it again at Qt Gui level seems impractical, fagile
(as probably noticed by people fixing all the unexpected issues) and adds
unnecessary complexity.

Note:

Removing the deprecated QWSI APIs from offscreen plugin depends on fixing
autotests that rely on QOffscreenCursor::setPos() logic.

For the convenience of testing use QT_QPA_DISABLE_ENHANCED_MOUSE to restore
to the old code path where QGuiApplication does the mouse state deducing.

Other platforms have similar issues. I do not have all supported platform
available on my desk, so other platform maintainers will need to take care
of porting those platforms to the new APIs. And mainly, I don't want to deal
with all the hacks that other platforms have added to workaround this broken
mouse logic.

In Qt6 we need to remove deprecated code path from QGuiApplication.

This patch:

- Extends QWindowSystemInterfacePrivate::MouseEvent ctor with QEvent::Type
and Qt::MouseButton. We use this extra data when processing mouse events in
QGuiApplication. This actually is similar to KeyEvent, where we do pass the
type (press or release) to QtGui.

- Refactors QGuiApplicationPrivate::processMouseEvent and qtestlib to use
the new APIs.

Task-number: QTBUG-59277
Task-number: QTBUG-62329
Task-number: QTBUG-63467
Change-Id: If94fd46a7cccfea8264dcb1368804c73334558b8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-10-10 22:09:07 +00:00
Friedemann Kleint
46eb7d6b70 Windows Vista Style: Draw dock widget title with Qt::TextShowMnemonic
Align with the other styles.

Task-number: QTBUG-54485
Change-Id: Ic8d008c59f5acf858b8ba6fbea5dd30b8aa9634c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-10-10 18:24:40 +00:00
Friedemann Kleint
65d9d89573 clang-cl: Fix warning about #include resolution
In file included from ..\..\..\mkspecs\win32-clang-msvc\qplatformdefs.h:40:
..\..\..\mkspecs\win32-clang-msvc/../win32-msvc/qplatformdefs.h(51,10):  warning: #include resolved using non-portable Microsoft search rules as: ..\..\corelib\global/qglobal.h [-Wmicrosoft-include]
 #include "qglobal.h"

Task-number: QTBUG-63512
Change-Id: Id60b599126049f2bb07db22e721ff5b761a9b1fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-10 18:24:14 +00:00
Andy Shaw
0900cf3581 OCI: Use TIMESTAMP for datetime data
The TIMESTAMP type has been available in Oracle since Oracle 9i
which was released in June 2001 and contains more data than the
DATE type so it can be reliably used for the related data types.

This adds support for preserving milliseconds and the time zone
information if this is passed or in the database.

[ChangeLog][QtSql][OCI] Added support for the TIMESTAMP data type.

Task-number: QTBUG-23
Change-Id: Icf7a012dda75fb342ce6c6aa34eaa2a52755ff2d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-10 08:56:32 +00:00
Gatis Paeglis
bbcc2a92d0 xcb: tidy up QXcbWindow::handleClientMessageEvent
- Store "event->data.data32[0]" in a variable with a meaningful name.
  This improves code readility.

- Use categorized logging.

- Wrap lines where it makes sense (Qt Coding Style discorages more than
  100 chars per line).

Change-Id: I163abab8380b459fd349227f22dc417a444aefa7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-10 05:33:23 +00:00
Laurent Montel
89e5492877 PrintSupport: Layout constructor already uses "this"
Not necessary to call setLayout here.

Change-Id: I761215b46ab4f778786e92338906b5ec7515c53d
Reviewed-by: David Faure <david.faure@kdab.com>
2017-10-09 12:55:14 +00:00
Laurent Montel
bd98a52256 PrintSupport: replace 0 with nullptr
Change-Id: Ic5e0000e384989239965f269474d17fa29669db1
Reviewed-by: David Faure <david.faure@kdab.com>
2017-10-09 12:50:26 +00:00
Laurent Montel
b4b36c9b50 Printsupport: Fix compilation on gcc with -Wpedantic
Change-Id: Ic17079e14e90801ed40fddb12d5c1af1b1fa14be
Reviewed-by: David Faure <david.faure@kdab.com>
2017-10-09 12:21:39 +00:00
Thiago Macieira
4a44bd6cdc Stop including net/if.h from qplatformdefs.h
I need to include linxx/if.h from elsewhere and these two files conflict
by defining the same types (struct ifreq, struct ifmap, struct ifconf,
etc.)

Change-Id: I0a103569c81b4711a649fffd14eb2f6dbbef83b6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-08 06:41:24 +00:00
Thiago Macieira
f27e029ef2 Autotest: use _exit() instead of exit() to simulate an unclean exit
We're not going to crash to avoid core dumps getting recorded by
systemd, filling up filesystems or showing dialog boxes. We just need to
exit without running destructors. Now, exit() isn't supposed to run
function-scope destructors, so just in case we use _exit().

Change-Id: I0b48fc8e90304e0dacc3fffd14e909ff248ce1a1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-08 06:41:05 +00:00
Alex Trotsenko
ca49f133f0 QSslSocket: implement skip() overload
As QAbstractSocket does not handle most cases for this socket type, we
should override skip() in QSslSocketPrivate implementation.

In unencrypted mode, QSslSocket should forward skipping to the plain
socket. If a connection is secure, we just need to check the connection
state.

Change-Id: I56602c6427b8617e8a9f453809a30fb2914ad798
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-07 17:22:24 +00:00
Allan Sandfeld Jensen
f0096a2bd3 Enable patent-free LCD rendering with FreeType 2.8.1
Use the FreeType LCD rendering path with 2.8.1 even when it has lcd-
filtering disabled. This gives us proper subpixel rendering even with
a freetype build with the patented lcd-filtering code disabled.

The code is also simplified by removing the long pointless
ifdefs for 10+ year old versions of freetype.

Change-Id: I487e465317cb984b6e33c7bcc497f27cf29f9bcd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-10-07 11:20:10 +00:00
Allan Sandfeld Jensen
06089a19e5 xcb: Unify visual to QImage::Format logic
Make a common function to replace the two existing ones that convert
from XCB visuals to QImage format.

Change-Id: I2ae08ef4df96df950910a45e71c9d9cd98375b2e
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-10-07 09:04:38 +00:00
Jake Petroules
467cede61e Fix build with -no-opengl and on watchOS in general
This fixes a regression introduced in 8e70241dcc.

Task-number: QTBUG-63631
Change-Id: I5a2c23e06b790a482e1542ac2db3dcf25927caf2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-10-06 10:50:02 +00:00
David Faure
23d0c77ce8 QTestLib: flush DeferredDelete events between every test
This makes qtestlib behave more like real Qt applications with an
event loop, where exiting the application does indeed flush deleteLaters.
And since every test method is supposed to be independent from other
test methods, we should even cleanup between tests.

For "app less" tests, no flushing happens.

Real life use cases:

* A unittest for some code (e.g. KIO job) which uses a socket, runs an
event loop until the socket communication is done, and ends. However
slotDisconnected() does, as recommended, socket->deleteLater(). So the
test finishes before the socket has a chance to actually get deleted,
and memory leak tools flag a memory leak, which doesn't actually happen
outside the unittest.

* Deleting a QWebEngineView with deleteLater is even worse than a memleak,
it leads to an assert (from a global object destructor) in QtWebEngine
if the view deletion hasn't actually been processed.

Change-Id: I18fc822fd26988a0fa4e75313c1947fcaa7d9e56
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-10-06 10:43:03 +00:00
Lars Schmertmann
6486a4bd19 Avoid using deprecated APIs on iOS 10.0+
Change-Id: Ic9dc6a24ef793a29c2652ad37bc11120e2e6ceef
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-06 06:15:30 +00:00
Giuseppe D'Angelo
cb08b40976 Move detection of <future> to a configure test
<future> is needed by QThread::create. Instead of a fragile series
of preprocessor tests, move its detection to a configure test.
This dramatically simplifies the code, but on the other hand ties
the availability of QThread::create() to the system used to compile
Qt (rather the one used to compile an application).

Change-Id: If1b06363379bf29126cfa68f2a0651cbb78a67f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-06 05:51:54 +00:00
Thiago Macieira
db1027bc36 QLockFile: don't use QCoreApplication::applicationName()
That was stupid for two reasons. First, applicationName() can be changed
by the user by calling QCoreApplication::setApplicationName(), so if
that happens, we won't be able to properly identify a lock belonging to a
given application because the name changed.

Second, because applicationName() is not what we compare to. Instead,
let's use processNameByPid() on both content creation and verification.

[ChangeLog][QtCore][QLockFile] Fixed a bug that would cause QLockFile
mis-identify valid lock files as stale if the application name was set
with QCoreApplication::setApplicationName().

Change-Id: I0b48fc8e90304e0dacc3fffd14e912a5c98c87e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-10-06 01:53:53 +00:00
Thiago Macieira
4dca0cba30 QLockInfo: Centralize the management of the lock file's contents
We duplicated both the creation of the contents and the check if the
file was stale. Centralize everything in qlockfile.cpp.

Change-Id: I0b48fc8e90304e0dacc3fffd14e91174af79841f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-10-06 01:53:50 +00:00
Thiago Macieira
3399d79773 QLockFile/Unix: drop the use of fcntl(F_SETLK)
F_SETLK is bad. Explanation in the comment. And flock(2) does work with
NFS on Linux, so let's just stick to that, which is simpler.

We only use the file locks when we attempt to delete an apparently stale
lock: that is, for a lock file that is at least staleLockTime old.

Change-Id: I0b48fc8e90304e0dacc3fffd14e908c8c4c9d59b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2017-10-06 01:53:47 +00:00
Tor Arne Vestbø
de3f764be8 macOS: Split QCocoaScreen out from qcocoaintegration.mm
It's confusing to keep it along with an unrelated class. Let's keep it
in its own file like for most other platform plugins.

Change-Id: I449ee061ff9fd5dc7ef06cadd633414d6b16358f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-10-05 17:06:00 +00:00