Commit Graph

30501 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
bb0f29f82b Fix gcc 6.4 builds
The builtins clzs and ctzs have been removed. Additionally they were
never proper internal GCC builtins and shouldn't have been used in a
constexpr function in the first place. This patch removes the assumption
that they exist when BMI is available, and let GCC fall back to using
__builtin_clz and __builtin_ctz.

Change-Id: I3e0b4e246098bb9ce6ede28b311948260ef881b9
Task-number: QTBUG-56813
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-13 05:14:32 +00:00
Lambert Duijst
00c9ec63a5 Fix for horizontal scrollbars
Horizontal scrollbars scroll in the wrong direction when the app
has a stylesheet and the LayoutDirection is RightToLeft.

Change-Id: I860cb733709e8d59a7b844f2b6ed1ee63410956e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-12-13 00:42:09 +00:00
Nico Vertriest
ee7a5a94f9 Doc: added spec about parameter enable
Err: Undocumented parameter 'enable' in QNetworkProxyFactory::setUseSystemConfiguration()
Err: no such parameter 'editable' in QComboBox::setCompleter()

Change-Id: Ib27b93cf74e97efd656eda1265003f33c6802005
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2016-12-12 14:43:34 +00:00
Nico Vertriest
c131a83f42 Doc: update Qt Widgets examples
- \image --> \borderedimage
- update screenshot if required

Change-Id: I0318b1df67154b70c061da7cbd509b8d5337b311
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2016-12-12 14:43:02 +00:00
Giuseppe D'Angelo
1da70af724 QMap: use std::less for defining an order between pointers
Reinterpret_cast()ing a pointer to a suitably sized integer is not guaranteed
to always give the same result for the same pointer (!). Therefore the
resulting integers are not comparable in a meaningful way. std::less is
supposed to be used to compare arbitrary pointers, so use it.

(Hopefully and reasonably, under the hood std::less does exactly what we
were doing, so this isn't BiC.)

Change-Id: I9960b3d6e35657fe7a25b842054f5d338280e850
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 11:15:22 +00:00
Eskil Abrahamsen Blomfeldt
888b3f5045 Fix compilation with -no-pch
Q_UNUSED(cursor) was failing to compile when configured with
-no-pch.

Change-Id: I1da3c95c1636ca06f38a97052ee4360232520a8b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-12-12 11:14:03 +00:00
Eskil Abrahamsen Blomfeldt
7896ae052a Accept ZWNJ, ZWJ and PUA characters in input widgets
Private Use Area characters are quite valid input characters when used
in combination with a custom font. Joiners also serve an important language
purpose in semitic writing systems.

Note that there is a hack where we disregard any character produced
using CTRL or CTRL+SHIFT specifically because of German keyboards. I have chosen to
keep the hack in this patch to limit the change (though I have made an exception
for ZWJ and ZWNJ since both are produced using Ctrl+Shift on Windows), but it
will probably have to be reverted.

[ChangeLog][QtWidgets][Input] Accept characters in Private Use Area, as well as
zero-width joiners and zero-width non-joiners in input in QLineEdit and QTextEdit.

Task-number: QTBUG-42074
Task-number: QTBUG-57003
Change-Id: I73f3b7d587a8670de24e902dc52a51f7721dba5a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-12-12 11:13:53 +00:00
Anton Kudryavtsev
87fefbc08e Plugins: use QStringBuilder more
Change-Id: I6f026b81fdc403d99d37dfa22ea6a27a95ead347
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-12-12 11:02:59 +00:00
Friedemann Kleint
101449a4cf QDir::cd(): Handle UNC server paths correctly
Add a bool *ok out parameter to qt_normalizePathSegments() and return false
when ".." are left over for an absolute path, indicating an attempt to
change above root.
Factor out static helper qt_cleanPath() to be able to pass the return value
to QDir::cd() and return on failure from there.

Amends change 63f634322b, which did
not handle UNC paths.

Task-number: QTBUG-53712
Change-Id: I3e63a5dd0259306a0b99145348d815899582f78e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 07:25:22 +00:00
Friedemann Kleint
f7b44f879c QDir::cleanPath(): Do not cd above root paths (UNC, WinRT)
Calling QDir::cleanPath() on "//server/path/.." resulted in "/".

Factor out a function to determine the root path part of an absolute
path for later use, and handle some special cases:
- Consider server name of "//server/path/.." as part of the prefix.
- Check on the root path for WinRT.

Task-number: QTBUG-53712
Change-Id: Ibddacf06212b6fc86fa74a5e4078df6cfd5b66f5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-12 07:25:05 +00:00
Thiago Macieira
4c0760d327 Re-fix the build with ICC and cmath & math.h
Commit c35fef9d3b wasn't sufficient. The
problem is that there's a complex combination of libc headers (math.h),
C++ headers (cmath), which may be provided by three different sources on
Linux (glibc, gcc and ICC). On some combinations, the isnan macro leaks
from math.h or cmath and that's what the the commit above tried to fix.

On some other combinations, there's no macro but there's an ::isnan
function defined. When we do "using namespace std; return isnan(x);",
that causes a compilation error. This commit solves that by detecting
whether there is a macro defined.

error: more than one instance of overloaded function "isnan" matches the argument list
             function "isnan(double)"
             function "std::isnan(double)"
             argument types are: (double)

Change-Id: Iaeecaffe26af4535b416fffd148bf71826541bdd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-10 19:31:45 +00:00
Topi Reinio
5b8957247f Doc: QPointingDeviceUniqueId: Fix documentation warning
Fix the following warning by adding a const qualifier:

warning: No documentation for 'QPointingDeviceUniqueId::isValid()'

Change-Id: I1ebeda8f45e88efb7cb844b67409352c695e6354
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-12-09 18:23:48 +00:00
Alexander Volkov
a76579d956 Android: Add missing override
Change-Id: I70b802517d8f7d129ffb71dc3e92cb2458a55acc
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit e3ad43843a)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-12-09 18:23:26 +00:00
BogDan Vatra
2d1378836c Android: remove unused variable
Fix compilation with -Werror

Change-Id: Iae6068f9eeb92dd1a96b11f6bb7017b97a8486fb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-12-09 18:23:19 +00:00
Laszlo Agocs
8005e0652c QAndroidPlatformOpenGLContext: fix adopting of existing native contexts
Change-Id: I854bbc511d89578c6a893015b21358f08ed8f5a6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-12-09 06:31:31 +00:00
Eskil Abrahamsen Blomfeldt
c483945cf4 REG: Fix missing glyphs with DirectWrite and stretch == QFont::AnyStretch
A stretch equal to 0 is since 5.8 defined as "accept the stretch of the font",
and this needs to be accounted for in the font engines.

Task-number: QTBUG-57491
Change-Id: Idabbe44677c4b92cbd8ad8278b054de53e9cc7f9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2016-12-09 05:16:53 +00:00
J-P Nurmi
84ea00d470 QGtk3Dialog: don't crash on Wayland
Check if it's an X11 window before calling XSetTransientForHint().
No transient parent will be set for GTK+ dialogs on Wayland. That
has to be implemented separately.

Task-number: QTBUG-55583
Change-Id: Iabc2a72681c8157bb2f2fe500892853aa397106b
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-12-09 05:16:35 +00:00
Thiago Macieira
b0c321a8db Don't crash on QVLA construction from an empty std::initializer_list
The C++ standard says in [support.initlist.access]/1:

 constexpr const E* begin() const noexcept;

 Returns: A pointer to the beginning of the array. If size() == 0 the
 values of begin() and end() are unspecified but they shall be
 identical.

So we can't assume it's non-null. I didn't want to remove the Q_ASSERT,
so passing a non-null pointer to append() remains required. This patch
simply won't call append() if the initializer list is empty.

This was already tested, but the failure is with a compiler that is not
part of the Qt CI.

Task-number: QTBUG-57277
Change-Id: Iaeecaffe26af4535b416fffd1489806872b412ee
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-12-09 03:11:34 +00:00
Morten Johan Sørvig
2c9dc93696 Cocoa: Unbreak app activation on macOS Sierra
Previously, we would activate the application during
QCocoaIntegration construction, which means at QApplication
creation time. This now seems to interfere with application
startup on macOS Sierra, where the application window
ends up in an unfocused state.

Move application activation to applicationDidFinishLaunching,
at which point the Cocoa runtime should be completely
initialized. Do this for 10.12+ only to avoid regressions/
test failures on previous versions.

Change-Id: Ic5f150d53f06a302b53a3ba86a4a9b18bb2a1783
Task-number: QTBUG-57044
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2016-12-08 23:50:52 +00:00
Tor Arne Vestbø
aec85a53df Disable core dumps for selftests that are meant to be crashing
Task-number: QTBUG-55155
Change-Id: I26a1461f35f916f3980fcb18cdddf3502e22fc90
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-12-08 23:50:44 +00:00
Tor Arne Vestbø
50cb2687b2 UIKit: Improve handling of private system fonts / fallback fonts
Commit 2bc7a40048 taught the CoreText font database to populate the
families lazily, and in the process added a guard to ensure that we
didn't populate internal fonts (prefixed with a '.'), as these fonts
would then show up in font selection dialogs.

Commit 909d3f5c7 then added support for private fonts, by making it
possible to filter out any private fonts from font selection daialogs.
But the guard was not removed, so we were still not populating these
fonts. This guard has been removed, and the filtering function has
been updated to include the conditions of the guard.

Next, commit e5e93345c5 used [UIFont fontNamesForFamilyName:] to verify
that each family that we registered with the font database would also
have matching fonts when finally populated. This is not the right approach,
as [UIFont fontNamesForFamilyName:] does not handle internal fonts.

Instead we trust what CTFontDescriptorCreateMatchingFontDescriptors()
gives us, but make sure to register the resulting font descriptors
with the original/originating font family, instead of the one we pull
out of the font descriptor.

Finally, as of iOS 10, we can use CTFontManagerCopyAvailableFontFamilyNames
instead of [UIFont familyNames], which gives us all of the internal font
families like on macOS, instead of just the user-visible families. For
earlier iOS versions we manually add '.PhoneFallback', as we know it
will be available even if not listed in [UIFont familyNames].

The end result is that we register and populate families like '.PhoneFallback',
which is critical to supporting more esoteric writing systems.

The check in tst_QFont that styles for a given family is not empty has
been removed, as we can't guarantee that on all platforms, which is
also documented for QFontDatabase::styles().

Task-number: QTBUG-45746
Task-number: QTBUG-50624
Change-Id: I04674dcb2bb36b4cdf5646d540c35727ff3daaad
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-12-08 16:38:01 +00:00
Alexander Volkov
2488f34ecf xcb: Adapt QXcbWindow::startSystemResize() for touch events
Window managers typically grab the pointer after receiving
the _NET_WM_MOVERESIZE event. But they fail to do it for
touch sequences which have a receiver. So we should reject
the touch sequence before sending _NET_WM_MOVERESIZE event.

QSizeGrip calls startSystemResize() on MouseButtonPress event
which is synthesized by Qt on TouchBegin. We can find the id
of the touch point by comparing coordinates of the synthesized
MouseButtonPress event with coordinates of all TouchBegin events.
Then we use this id to reject the touch sequence (it's possible
only after receiving XI_TouchUpdate).

Change-Id: I26519840cd221e28b0be7854e4617c9aba4b0817
Task-number: QTBUG-51385
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-12-08 12:41:04 +00:00
Allan Sandfeld Jensen
d829dd3f44 Fix inconsistent alpha masking in qConvertARGB32PMToARGB64PM_sse2
The prolog and epilog did not force RGB32 to be converted to RGB64 with
alpha fully defined like the middle optimized part.

Change-Id: If7c4829f2239f9a3c524f78b9ce269e2b0b5b150
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2016-12-08 12:40:58 +00:00
Oswald Buddenhagen
e2978d6097 move license check to qmake-based configure system
this also removes the need for passing pre-processed options via
configure.cfg, so get rid of that.

a somewhat unfortunate side effect is that the android-style-assets
feature had to move back to the top level, as the licensing options
depend on it.

Started-by: Lars Knoll <lars.knoll@qt.io>
Change-Id: Id4d1e0ba18b3e3104400293b8f0c7f2f65e68dea
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-12-08 12:40:53 +00:00
Allan Sandfeld Jensen
f882d2f443 Fix qdrawhelper function toRGB64
The function was incorrectly handling green and blue color channels
causing them to be dropped. This affects drawing non 32-bit images onto
10-bit per color channels formats such as RGB30.

Change-Id: I9211e253b1a9da0dada5c418d592a8f531265989
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2016-12-08 12:40:02 +00:00
Maurice Kalinowski
181860e1af winrt: Fix input grabbing
Beside its usage in widgets, mouse grabs are required for QML menus to
work.

Task-number: QTBUG-57079
Change-Id: I306cb68624186da69725470e147bc7b979dac8e4
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-12-08 10:08:53 +00:00
Shawn Rutledge
10143ea803 QPointingDeviceUniqueId: remove deprecated numeric() and constructor
Followup to 0484473: this is all new stuff for 5.8 and we don't need
to release it with pre-deprecated functions.

Task-number: QTBUG-54616
Change-Id: If17a4bec6fc36ca78d87517992374f101ae13b4f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2016-12-08 10:08:16 +00:00
Liang Qi
cae32bd04d Merge remote-tracking branch 'origin/5.7' into 5.8.0
Change-Id: I576187a9905802c177ae483e6c29d0f55cf7034d
2016-12-08 08:20:36 +01:00
Thiago Macieira
e1a70ce495 moc: force the Microsoft compiler not to define _MSC_EXTENSIONS
This re-fixes commit d72ac3f35f, which
simply removed the #define but did so at the wrong place. Instead of
forcing the macro to be removed, let's simply not have it defined in the
first place.

Change-Id: Ie6dbad9bbbd9488887e8fffd148dd67d9a31b32e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-12-08 05:09:31 +00:00
Gabriel de Dietrich
093e1111ef QCocoaMenu: Don't rely on tags when we can get the actual NSMenuItem
-[NSMenu itemWithTag:] clearly states that it'll return the first
item with that tag. Furthermore, when and item has been synced more
than once, it could be that more than one such item exists in the
same menu (e.g. lately changing the role of Edit->Copy).

Change-Id: I95a4f0a151659ae273ba03a3cab4a720b781fc3a
Task-number: QTBUG-57404
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-12-08 05:09:14 +00:00
Gabriel de Dietrich
b2f78b796b QCocoaMenu: Avoid exception when inserting item already in this menu
This should not happen, but it's clearly not the user's fault.
So we should try to carry on as gracefully as possible instead
of letting Cocoa abort the application.

The patch also factors the repeated calls to QCocoaMenuItem::
nsItem() in QCocoaMenu::insertNative() and improves a warning
from QCocoaMenuIten::sync().

Change-Id: Id00135c219aaf40fb565b19a65cab68f6d9863b2
Task-number: QTBUG-57404
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2016-12-08 05:09:07 +00:00
Oswald Buddenhagen
074b9f1eef Make reported build type match old configure
Adds platform and CPU features to the reported build type,
matching the format of the old configure.

Started-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I6d93ec7416b38684da51af5238a5cf537810b21d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-07 21:17:00 +00:00
Alexander Volkov
86ccc84357 eglfs: Add missing override
Change-Id: I257cfb29b919de5d4876d39e0512815c6ed24a88
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-12-07 15:42:31 +00:00
Marc Mutz
4077fcc615 QHostAddress: fix assignment operators
QHostAddress allowed assignment from a QString, but the respective
constructor is explicit, and rightfully so. So it does not make
sense that the assignment operator is provided, because of the
asymmetry caused between

   QHostAddress addr = funcReturningQString(); // ERROR
   addr              = funcReturningQString(); // OK (until now)

By the same token, since SpecialAddress is implicitly convertible
to QHostAddress, provide the missing assignment operator from that
enum.

Add tests, rewriting the _data() function to use the enum instead
of an int to pass SpecialAddress values, and to test !=, too.

Added setAddress(SpecialAddress), since a) it was missing and
b) to share code between the ctor and the assignment operator.

Change-Id: Ief64c493be13ada8c6968801d9ed083b267fa902
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-07 13:21:20 +00:00
Kai Koehne
630f8e7ad6 Document 3rd party code in qimagetransform.cpp
Change-Id: I685d3964617e3984b938bd9aafa0626acd75656f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2016-12-07 13:21:10 +00:00
Thiago Macieira
3695c2ee11 Disable ICC warning 3373
This warning does not make sense. it seems to trigger when in code like
the following in template functions:

    auto x = 1, y = 2;

3373: nonstandard use of "auto" to both deduce the type from an
initializer and to announce a trailing return type

Other reports on the Internet indicate that no one understands what
triggers this warning and have just worked around it. Additionally, the
same warning exists on other compilers with the same text, so it's
likely come from the EDG front-end. This has been reported to Intel.

Change-Id: I73fa1e59a4844c43a109fffd148d45065ab69eff
Intel-Issue-ID: 6000164202
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-12-07 13:21:01 +00:00
Shawn Rutledge
7df0c7a309 rename QPointerUniqueId -> QPointingDeviceUniqueId
Several people agreed that the name was confusing and that this one
is better.

Task-number: QTBUG-54616
Change-Id: I31cf057f4bc818332b0551a27d1711599440207c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Sune Vuorela <sune@vuorela.dk>
2016-12-07 13:20:51 +00:00
Liang Qi
04f68053df Merge remote-tracking branch 'origin/5.7.1' into 5.7
Change-Id: Ic2cdbd0c826bd63f545479495fa095ec666ddd5a
2016-12-07 12:04:36 +01:00
Oswald Buddenhagen
b9e800cd99 fix qlalr invocation in silent builds
Change-Id: I8cd5da01dcbcdebe29815a80cc0f65365727465d
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-12-07 06:54:33 +00:00
Oswald Buddenhagen
019c932ca9 unbreak "aux" template for mingw & msvc, take 3
eliminating everying TARGET-related was a nice try, but in the real
world (e.g., qttranslations), extra compilers are activated by
PRE_TARGETDEPS, which of course doesn't work when TARGET is entirely
gone.
so instead, let it act as a phony target. this is consistent with the
unix generator.

supersedes 0810d48bc in amending af2847260.

Task-number: QTBUG-57423
Change-Id: I3d2ecc4ff42b37ffe5f71f5c20d17c06b31f4da2
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-12-07 06:54:04 +00:00
Ulf Hermann
141be52f2f Merge the two features for shared memory
Change-Id: Ic7bd27b289b755c801e3c510c44b2afe9a253bd8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-12-06 17:03:26 +00:00
Allan Sandfeld Jensen
506aa694a9 Cleanup convert_ARGB_to_ARGB_PM_inplace_sse2
Changes it to follow standard SIMD patterns so it can use
ALIGNMENT_PROLOGUE_16BYTES and SIMD_EPILOGUE helpers.

Should also improve performance by using aligned memory access.

Change-Id: I14a48b82e3f3de83bd7572aa82bed07f28ad944c
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-12-06 16:16:53 +00:00
Sergio Martins
0382bb2ab8 Fix crash when dragging a tab off QDockWidgetGroupWindow
Crashes later in QMainWindowLayout::hover()

Change-Id: Ibf1085ebfa7b0edcbd1662b0300550788b7f9c33
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-12-06 15:34:53 +00:00
Jesus Fernandez
3c4febf557 Fix using 0 as null pointer
Fixes: error: zero as null pointer constant.

Change-Id: I850d51075263dac6dd135d3cadc136cbd08b40ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-06 15:32:26 +00:00
Kevin Funk
6ff4d8c61a QTest::addColumn: Use nullptr instead of 0
Fixes -Wzero-as-null-pointer-constant warning in user code

Change-Id: I59492633d14947e90e91efa7c4fcd14c33fa413e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-06 15:32:00 +00:00
Oliver Wolff
14ea8759da winrt: Change the way tcp packets are handled
Similar to the way datagrams are handled for udp sockets the worker now
takes care of tcp data. Thus we avoid race conditions which stopped data
processing. It could happen that data was read from the socket into the
buffer and before readyRead was emitted the buffer was completely read.
In this case readNotification is set to false and no new data is processed
afterwards.

Additionally the buffer was replaced by a vector of QByteArray. The buffer
kept growing and was never cleared (and there is no obvious way for
clearing the buffer), so that an overflow happened eventually.

pendingReadOperations (and its mutex) could be removed as well. There is
only one situation where they could clash and that's the initial read.
Having two members is preferred over having a list of operations and a
mutex.

Task-number: QTBUG-56438
Change-Id: Idbad58e47785996023748c310530892163f24594
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-12-06 07:59:39 +00:00
Timur Pocheptsov
4f959b6b30 ~QHttpNetworkConnectionPrivate - disconnect from socket's signals
We have a 'channel' object connected to a socket with Qt::DirectConnection.
QHttpNetworkConnectionPrivate in its dtor (note, it's a private object destroyed
after its 'q' - QHttpNetworkConnection - was destroyed) calls socket->close()
and this can end up in socket setting an error and emitting (for example, in
QSslSocket::transmit). The slot (QHttpNetworkConnectionChannel::_q_error) will
access the now-dead/non-existing connection then. So disconnect the channel
from the socket early, before closing the socket.

Task-number: QTBUG-54167
Change-Id: I3ed4ba4b00650c3a39e5c1f33aa786e47bfbbc57
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-12-06 05:54:32 +00:00
Friedemann Kleint
82a6f38873 tst_qsqlquery.cpp: Refactor runIntegralTypesMysqlTest()
Change 3370ab9119 introduced
warnings from MSVC:

tst_qsqlquery.cpp(4005): warning C4805: '==': unsafe mix of type 'const bool' and type 'int' in operation
tst_qsqlquery.cpp(4059): note: see reference to function template instantiation 'void runIntegralTypesMysqlTest<bool>(QSqlDatabase &,const QString &,const QString &,const bool,const T,const T)' being compiled
        with      [           T=bool       ]
tst_qsqlquery.cpp(4006): warning C4805: '==': unsafe mix of type 'const bool' and type 'int' in operation
tst_qsqlquery.cpp(4006): warning C4804: '/': unsafe use of type 'bool' in operation
tst_qsqlquery.cpp(4026): warning C4804: '+=': unsafe use of type 'bool' in operation

Extract an overload taking a QVector of values and use that for the
bool case instead of looping over min/max to generate a sequence of values
for bool.

Change-Id: I72583774e788b8df899f22ed1a64278217e664f6
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2016-12-05 12:06:39 +00:00
Thiago Macieira
6ae9dc3f37 Work around ICC compiler bug on template instantiation on ?:
It doesn't like the access to the template instantiation in the ternary
operator.

 error: operand types are incompatible ("FetchPixelFunc" and "<unnamed>")

Intel-Issue-ID: 6000164201
Change-Id: I73fa1e59a4844c43a109fffd148ca452796eebb1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-12-04 07:26:29 +00:00
Thiago Macieira
32a7efe225 Fix the warning number for ICC deprecated warnings
That's what happens when you don't test and just rely on an the warning
listing. ICC has two warning numbers for deprecated warnings: one that
matches Q_DECL_DEPRECATED and one for Q_DECL_DEPRECATED_X.

Change-Id: I73fa1e59a4844c43a109fffd148ca7a05eda8f13
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-12-04 07:26:13 +00:00