Commit Graph

33850 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Oleg Yadrov
5ff9d6a470 QMacStyle: smooth QMenu corners for real
It's been for years that QMenu's rounded corners in qmacstyle_mac were
done via QWidget::setMask(QRegion). Unfortunately, QRegion mask does not
work well with retina displays and also does not support translucency.
That's why in this change we explicitly make QMenu's background
transparent and then draw a rectangle with rounded corners in
QMacStyle::drawPrimitive(PE_PanelMenu). This not only gives much better
result than the mask-based approach, but also de-HIThemes QMenu.

As a consequence, QComboBoxPrivateContainer doesn't get any mask from
QMacStyle anymore. Therefore, when the mask is empty, we need to paint
PE_PanelMenu before invoking QFrame's paint event handler.

Made-with: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Change-Id: Ia9236176113f23b86e45507fa6ddf77236084ce3
Reviewed-by: Oleg Yadrov <oleg.yadrov@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-10-05 17:04:07 +00:00
Tor Arne Vestbø
08e083e682 Ensure result of all QTest::qWaitFor are verified
The qWaitFor functions themselves can not trigger a test failure, as that
will not result in the test function exiting early, so every single call
to qWaitFor needs to be wrapped in a QVERIFY.

Change-Id: Id15a1549f31d06cdbf788e1d84ea431c28636ec8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-05 15:15:36 +00:00
Liang Qi
7bbb9a8ce8 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2017-10-05 12:38:45 +00:00
Tor Arne Vestbø
8e70241dcc Let QPlatformBackingStore handle its own QOpenGLContext
The resources allocated by QPlatformBackingStore are owned by the class,
and should be allocated in a context the class also owns. This removes
the asymmetry of having to pass in a context to composeAndFlush, while
having to make the same context current before destroying the platform
backingstore.

The context owned by QPlatformBackingStore is shared with the associated
window though a new QWindowPrivate::shareContext() API.

The result is that on e.g. iOS, the backingstore does not need to tie
the resource allocation of QPlatformBackingStore to the global share
context, but can instead tie them to the per-window context, and hence
clean them up after each window is closed.

Task-number: QTBUG-56653
Change-Id: Ic1bcae50dafeeafaa8d16a7febd83b840ec6367a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-10-05 12:34:23 +00:00
Timur Pocheptsov
aeee3be166 QtNetwork (examples) - update googlesuggest example
Mainly cosmetic - nullptr, explicit, QVector<QString> etc.
Plus: do not leak SearchBox.

Task-number: QTBUG-60628
Change-Id: I4c538ced64a469fbe4627f44d2d883e6dcd2362e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-05 03:45:26 +00:00
Tor Arne Vestbø
5b4cf7af6a macOS: Prevent backingstore image detach during color space assignment
The call to CGImageCreateCopyWithColorSpace took a naked toCGImage(),
which left the resulting CGImageRef without a release, causing the
extra ref by toCGImage() to never be derefed, and a subsequent detach
of the image data on the next paint event.

Wrapping the call in a QCFType<CGImageRef> solves the problem. The code
has also been moved directly into QCocoaBackingStore::flush(), as there
is no need to keep the CGImageRef a member.

A local autorelease pool has been added to QCocoaBackingStore::flush(),
so that the NSImage used for blitting the backingstore is released upon
exit of the function, thereby releasing the corresponding CGImageRef.

Note that for layered mode, the QImage will still detach, as the view's
layer.contents property keeps a reference to the image data until being
replaced in a subsequent flush.

Task-number: QTBUG-63559
Change-Id: I06b9298f65a84deae7cc2eff617ba75c92ec3b87
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-10-04 20:27:29 +00:00
Tor Arne Vestbø
1b473ee676 iOS: Bump deployment target to 10.0 as planned for 5.10
[ChangeLog][iOS] The minimum deployment target for applications is now
iOS 10.0.

Change-Id: Icb37e4eaecbf6f62fd3c9293b2abf19a0954a02d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-04 20:27:26 +00:00
Liang Qi
bc5f45052f Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/corelib/global/qconfig-bootstrapped.h
	src/corelib/global/qglobal.h
	src/corelib/tools/qcryptographichash.cpp
	src/corelib/tools/qcryptographichash.h
	src/corelib/tools/qmessageauthenticationcode.cpp
	src/plugins/platforms/windows/qwindowswindow.h
	tests/auto/gui/kernel/qwindow/BLACKLIST
	tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST

Change-Id: Ib68112de985a3d714c2071f47c10e907e4f0229a
2017-10-04 13:41:04 +02:00
Richard Moe Gustavsen
b4981f9d4c Widgets: change QWidget::setTabOrder to understand compound widgets
A "compound widget" is a widget that has a focus proxy set to an inner
child. This is normal for complex black-box components where focus handling
is delegated to the children. Since the compound can have several
children, a local tab order might exist between them.

The current implementation of setTabOrder had no idea about
compound widgets. As such, when connecting two compounds in the
tab chain, it would just break up their inner tab order and
cause tabbing to ignore children other than the proxy.

The new implementation recognizes compound widgets, and add some
extra code to figure out the correct tab targets. This way, the
local tab order between the children will be preserved.

This implementation was inspired by the patches of Marek Wieckowski posted
in the linked bug report, and later modified by Nikita Krupenko.

[ChangeLog][Widgets] QWidget::setTabOrder() will now preserve the local
tab order inside a widget if it has a focus proxy set to an inner child.

Task-number: QTBUG-10907
Change-Id: I0673d39d70ec8c6bf64af30bf978d67c651b2f3c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-10-04 11:27:18 +00:00
Gabriel de Dietrich
b8947e9194 QMacStyle: Remove HITheme calls for QSizeGrip
That's no longer a thing on macOS. We still keep it around for
QMdiSubWindow, but we should support 4-edge resizing there as
do native windows.

In practice, because of WA_MacOpaqueSizeGrip, we were already
rendering the size grip manually instead of relying on HITheme.

Change-Id: If613a14f03dc650b457688f3f2f57631b5fb30a3
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-03 21:12:42 +00:00
Gabriel de Dietrich
d47a467ca6 QMacStyle: De-HITheme QGroupBox
NSBox is good enough for this and pixel equivalent with
the previous HITheme calls.

Change-Id: I32b2a1cc8a9cd2a6ef17d1e01032540344808ebc
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-03 21:12:36 +00:00
Gabriel de Dietrich
475243a746 QMacStyle: Refactor QMacStylePrivate::cocoaControl()
That switch following the if looked a bit corny.

Also made cocoaCells hash mutable to get rid of the
const_cast(this) in QMSP::cocoaCell().

Change-Id: I4facec827409314cf1214152c19efb9688715eb2
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-03 21:12:30 +00:00
Timur Pocheptsov
3faf8f4d48 tst_QSsl(longlongnamefollows) - fix a flakey auto-test
The original test was using QSslSocket::waitForEncrypted function, which
is apparently a bad idea on Windows: connecting to 'www.qt.io' we have
to verify certs and there is no guarantee a given Windows VM has the required
CA certificate ready in its cert store. In such cases we start a background
thread (aka CA fetcher's thread) and it calls a (potentially blocking for
a significant amount of time) function (CryptoAPI). When finished, this
thread reports the results via queued connection, which does not work
if we are sitting in a tiny-loop inside waitForEncrypted. Re-factor
the test to use signals/slots and a normally running event loop.
Also, the last test makes a wrong assumption about Windows - fixed.

Task-number: QTBUG-63481
Change-Id: I4abe9cda2a6c52d841ac858cccb6bf068e550cb8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-03 16:37:30 +00:00
Andy Shaw
3e2de48161 OCI: Clear the cache in the result for a forward only query
When the query is forward-only then nextIndex() is always 0, therefore
the cache values need to be cleared beforehand so that they are not
reused when the next row is retrieved.

Task-number: QTBUG-57765
Change-Id: I49e8427b24ec2d932e5b387699ac7f3496e9a48c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-03 12:10:54 +00:00
Tor Arne Vestbø
bccbb52b7a macOS: Tighten up window icon and represented filename handling
Window icons on macOS are tied to document windows, and should not show
up unless a represented filename has also been set according to the HIG.

We follow this, and no longer create a document button based on the window
title if one did no exists. We also fall back to using the filename of
the file if a title has not been set, including being able to restore
this default title after setting a custom title.

The icon is no longer reset to nil after setting a QIcon(), which would
remove the icon completely, but instead we restore the default behavior
of showing the default filetype icon of the file.

Finally, the two callbacks in QNSWindowDelegate dealing with the document
icon/title popups and drags have been taught to look for spaces in the
represented filename. This allows clients who really want the old
behavior of setting an icon without caring about the filename to set
the filename to a single space character, which will prevent the
dropdowna and drag from occurring.

The reason for not tying this behavior to the existence of the file in
the filesystem is that being able to represent a file that is yet to
be saved is a valid usecase.

Task-number: QTBUG-63338
Change-Id: I7d4377c6358226fb6058f8c2b3c28588eec77ce5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-10-03 07:30:26 +00:00
Timur Pocheptsov
d892292409 QtNetwork (examples) - update the second download manager example
It's the one that is more complex - with a text-based 'progress-bar'
and queueing (for some, probably educational, reason) of requests.

Changes:

- update the C++ syntax (mem-initializers, range for, etc.)
- new-style headers
- redirects should not result in creating an empty file.  Since we
  have no UI, and this example is already complex enough, settle
  for just reporting the redirect and removing the empty file.

Task-number: QTBUG-60628
Change-Id: I0b69cd77414ecac7c0bc6b2f8f787befc978de28
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-02 17:16:21 +00:00
Timur Pocheptsov
42d7bc4c00 QtNetwork (examples) - update network download manager
Mainly 'modernizing' - use <c...> c-library includes (<stdio.h> -> <cstdio>),
add appropriate using directive; minor fixes in formatting + removal of a
hated double negation (aka ifndef QT_NO_NOTHING). Also, as our rules
('how to write examples') suggest - replace too many inclusion directives
with module-level headers. Basic redirects handling - do not create empty files
for redirected requests (or even files with some useless html).

Task-number: QTBUG-60628
Change-Id: Ia4398d39126313e6213bc7244d11a55958e64dec
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-02 17:10:38 +00:00
Jake Petroules
291233a8d0 Fix strict-prototypes warning with qVersion function
This is enabled by default with Xcode 9 and would therefore be seen by
anyone calling this function from C or Objective-C.

Task-number: QTBUG-63450
Change-Id: Iecd67017b6774c9f2fce2433002ff852058dd3ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-02 05:28:08 +00:00
Thiago Macieira
5e8b8a9388 Mark QCoreApplication::applicationPid() as const function
The PID cannot change.

Change-Id: I0b48fc8e90304e0dacc3fffd14e9324bfcda4412
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-01 17:00:40 +00:00
Thiago Macieira
bd4506fe5b Remove Q_ALWAYS_INLINE from frequently-used functions
MSVC is too stupid for them. Not only will it not inline those functions
if they are in a __declspec(dllimport) class, it will also print an
annoying Level 4 warning:

 function 'function' marked as __forceinline not inlined

Task-number: QTBUG-57811
Task-number: QTBUG-55042
Change-Id: I0b48fc8e90304e0dacc3fffd14e8a346d18a9e0c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-09-29 20:11:06 +00:00
Mårten Nordheim
8b64a1054a Fix cookies not being applied on redirect
Task-number: QTBUG-63313
Change-Id: I5245fc837557f19062cbbf0f1dfb86353c85229f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-29 14:44:13 +00:00
Timur Pocheptsov
49643145e1 HTTP/2 protocol handler: set redirect URL on reply
For HTTP/1 it's done when no data expected and response headers received -
protocol handler emits channel->allDone which handles the status code and
sets (if needed) a redirectUrl. HTTP/2 protocol handler cannot emit allDone
(it has many requests multiplexed and actually cannot say allDone yet).
So we set a redirect url if we have the corresponding status code and
found 'location' header.

Task-number: QTBUG-63471
Change-Id: Ibd3438ef918c245a46b8c0128910a89b9a418448
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-29 14:12:35 +00:00
Venugopal Shivashankar
7d6c168a73 Doc: Remove entries for highlighting QQC2 examples
The highlighted examples list for QQC2 is maintained separately.

Task-number: QTBUG-60647
Change-Id: Ib64ff7a44c6fcaf99058422d76ef6680df310911
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-09-29 11:29:31 +00:00