Commit Graph

27720 Commits

Author SHA1 Message Date
André Somers
4c00246fea Fixed crash taking null central widget
When no central widget has been set, calling takeCentralWidget should
just return a null pointer instead of crashing.

[ChangeLog][QtWidgets][QMainWindow] Fixed crash using takeCentralWidget when
the central widget was not set.

Task-number: QTBUG-56628
Change-Id: I240ccf4caa41d2716a78851571fbfbf444a4922e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-10-28 14:11:42 +00:00
Topi Reinio
dbf35d7571 Doc: Fix a typo in QtConcurrent example snippet
And use different wording to describe QtConcurrent::filtered(), as
it doesn't modify the sequence it operates on.

Change-Id: I768c0d121e027c5de36ba7bd548c2d4c2a7f1bd9
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-10-28 13:17:19 +00:00
Topi Reinio
431bc3321f Doc: CSS: Add styling for content generated with \legalese command
Even though the \legalese command is no longer used in Qt 5
documentation as it doesn't support collating legalese texts
across modules, it may still be useful for stand-alone doc
projects.

Add CSS rules so the \legalese text is styled similarly to
code blocks, to make it stand out from the rest of the content.

Change-Id: I533d8e2375ea2f8054c0671ff34dfa6f0dfe01d1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2016-10-28 13:02:22 +00:00
Anton Kudryavtsev
d245db2f83 QWidgetPrivate: remove unused declarations of methods
... such as beginSharedPainter() and endSharedPainter()

Change-Id: I0e76dd172c2f3bce169f58e4c62bd47c73c99dcd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-28 12:23:58 +00:00
Gabriel de Dietrich
f9280ba45e QNSColorPanelDelegate: Don't restore stolen view on dealloc
We may not be playing nice with Cocoa's internals when
we decide to reparent NSColorPanel's contents to add
QColorDialog's own OK/Cancel buttons. In order to reduce
issues, we should avoid poking at things during the
application's shutdown sequence. Simply releasing the
stolen view should be enough at that point.

A similar pattern exists in QNSFontPanelDelegate.

Change-Id: I678c236e0c57c4d08a1109a479d965f924288c54
Task-number: QTBUG-56448
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-10-28 12:13:38 +00:00
Friedemann Kleint
af3e697ad6 QWindowsXPStyle: Use qreal scale factors in theme drawing helpers
This improves support for fractional scale factors.

Task-number: QTBUG-49374
Change-Id: Ied6579ee831f3ea29f238baaffa67374ea6823d9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-28 07:45:02 +00:00
Alex Trotsenko
0e2d38b447 QAbstractSocket: avoid unspecified behavior in writing on TCP
Passing zero as size parameter to QAbstractSocketEngine::write() has
unspecified behavior, at least for TCP sockets. This could happen on
flush() when writeBuffer is empty or on writeData() with size 0. Avoid
by explicitly checking against zero size.

Change-Id: I070630d244ce6c3de3da94f84c2cded2c7a4b081
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-27 17:15:41 +00:00
Richard Moe Gustavsen
d19f01acbf nsphotolibrarysupport: add missing namespace macros
Change-Id: Ib2014dc64dfcc1ea8de63a1668907ace6d26c530
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-27 12:12:50 +00:00
Friedemann Kleint
1bd53131d8 configure: Determine MSVC version by evaluating macro _MSC_FULL_VER
The previously used regular expression failed for messages
in local languages, particularly for the French message containing
a non-breaking space.

Task-number: QTBUG-56388
Change-Id: Ie757617f1b3a31820d0ed274c4b157d544ac1ea6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-10-27 12:03:22 +00:00
Vyacheslav Koscheev
456f0e0f1a Compilation fix
If qreal is float, then android-clang compilation was breaking here

Change-Id: Ieccc357ecbbea5cbb22a5808dd0791795240a985
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-10-27 08:11:06 +00:00
Richard Moe Gustavsen
4e19615907 qmacmime: convert UTF-16 using QTextCodec
The current implementation of QMacPasteboardMimeUnicodeText
didn't contain any logic to handle unicode text with a byte
order mark (BOM). According to the
docs (*), 'public.utf16-plain-text' can have an optional BOM.
Because of that, Qt would fail encoding UTF-16 text from the
pasteboard if it had a BOM.

Additionally, perhaps because of a bug in iOS 10, UTF-16 text
placed on the pasteboard by Qt ends up being encoded wrong by
native apps, unless the text has a BOM.

Rather than hard-coding UTF-16 encoding/decoding in qmacmime, we
now leave it to QTextCodec. QTextCodec will add a BOM by
default, and can handle decoding of UTF-16 both with, and
without, a BOM.

*: https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html

Task-number: QTBUG-56229
Change-Id: I3a08deb0262350c67e5622cf23eb3c3a4907ec39
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2016-10-26 12:14:23 +00:00
Albert Astals Cid
e8b55a6d2a Document qGuiApp and tweap qApp
Change-Id: I2cd865da0e081251a2702c11cb83dde35444693a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-26 12:28:57 +00:00
Richard Moe Gustavsen
b9af823ef7 qiosfileengineassetslibrary: replace Q_DECL_OVERRIDE with override
Change-Id: Iba67e1a1fa86dff3c82543597351b597be69ed1f
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-26 12:15:47 +00:00
Eskil Abrahamsen Blomfeldt
aa2e2a8d5e Android: Fix synthesized oblique for non-latin scripts
In 5e3e34731b, a default implementation
of QPlatformFontDatabase::fallbacksForFamily() was added, but this
implementation included only the fonts with a matching style in
the returned list.

The result of this was that if a font face for a specific language
did not have e.g. an italic font, then we would show missing glyph
boxes instead. On Android, it would be impossible to show any
italic text in Chinese, Japanese, Hebrew, or Arabic.

[ChangeLog][QtGui][Text] Fixed synthesized oblique for non-latin
text on platforms using the basic font database, such as Android.

Task-number: QTBUG-51223
Change-Id: I494d8ad87292b65d4380a2e600c1c0dc7fc8f937
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-10-26 09:40:30 +00:00
Richard Moe Gustavsen
78ee77f491 iOS: link photo lib plugin based on Info.plist contents
If the application's Info.plist contains the key
'NSPhotoLibraryUsageDescription', we know that we can safely link in
qiosnsphotolibrarysupport without violating AppStore requirements.

This is a simple feature that doesn't introduce additional qmake
API for doing app deployment with optional iOS QPA plugins.

[ChangeLog][iOS] Starting from iOS 10, Apple requires all apps
that need access to photos to have the key
'NSPhotoLibraryUsageDescription' in the Info.plist.
Therefore, to get the same support in Qt (when, e.g., using
a file dialog), the Info.plist assigned to QMAKE_INFO_PLIST
will need this key as well.

Change-Id: I7a93afe24b589cad96d5a1d9e2a155ad1671178a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-26 08:55:19 +00:00
Richard Moe Gustavsen
99ce5d5e85 iOS: refactor usage of photos into optional plugin
Starting from iOS 10, apps that tries to access photos on the device
need to specify the reason for this up front by adding the key
'NSPhotoLibraryUsageDescription' into Info.plist. If the key is
missing, the app will be rejected from AppStore.

This causes problems for the iOS plugin as it stands since parts of it
already tries to access photos, e.g to show an image picker dialog
if a file dialog is set to open QStandardPaths::PicturesLocation.
This means that currently, all apps written with Qt will be rejected
from AppStore unless the developer adds this key, whether he tries
to access photos or not.

To solve this, we choose to split the plugin into two parts, one
that contains the core functionality, and one that contains
optional support. The latter will need to be enabled explicit
by the developer in the pro file, or in this case, indirectly
by adding the right key to the Info.plist.

This patch refactors the code in the plugin that gives access
to photos into a separate optional plugin called 'nsphotolibrarysupport'.

Change-Id: Ic4351eb0bbfffdf840fd88cd00bb29a25907798f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-26 08:55:10 +00:00
André Somers
60dbd80e5a Document that qFuzzyCompare does not work on NaN or infinity
On a discussion in the Development mailing list it became clear that
qFuzzyCompare does not work for NaN or infinity values. That was not
mentioned in the method documentation though. This patch fixes that
hiatus. It also clarifies how to deal with the comparing to 0.0
limitation.

Change-Id: I8b6d54cc0c1136e79b0d7be1a62bc9ed394d2575
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-10-26 08:39:46 +00:00
Thiago Macieira
047e3f8f04 Autotest: fix silly mistake in assigning where a comparison was intended
The file descriptor has been closed and this test is checking if we get
EBADF.

Change-Id: I33dc971f005a4848bb8ffffd1478eaffd99aa2e9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-10-25 22:55:46 +00:00
Jesus Fernandez
b82793e790 Fix possible loss of data in conversion from size_t to int warning
Change-Id: I72c74e67708f1e164a0c35e1e92d9bf3ec99ffd6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-10-25 21:22:52 +00:00
Thiago Macieira
0cffe2135e qversiontagging.h: Don't tag binaries in static mode
Though there should have been no ill-effects, they happen.

Task-number: QTBUG-52605
Change-Id: I9093948278414644a416fffd147444078edc3183
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-25 20:21:20 +00:00
Oswald Buddenhagen
d507cd40b6 unset OBJECTIVE_SOURCES and QMAKE_OBJECTIVE_CFLAGS after absorbing them
this is a bit easier on the backwards compat code in qt creator, which
needs to merge and then de-duplicate the lists itself.

Change-Id: I79f9319c26af541f5efa85700878e7ddbd00e2b7
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-25 17:49:49 +00:00
Oswald Buddenhagen
fe8f387794 don't moc OBJECTIVE_SOURCES twice
since 9ff1310af, the variable's contents are simply added to SOURCES,
and the variable is not cleared. and qmake does not de-duplicate ...

Task-number: QTBUG-53905
Change-Id: I3e551d21cbbd2d0cbfbf7aa7efaa5babac112f9d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-25 17:49:37 +00:00
Gabriel de Dietrich
9c83d7f871 QCocoaMenuBar: Update even if no window is attached
Then we need to check if the current active (or focused)
window has any menubar associated. In case there isn't,
and the menubar has no window associated, then we should
update immediately.

The previous condition is still valid.

Change-Id: I4532ccc87354d91c76b53f5433dc3944b9e29584
Task-number: QTBUG-56275
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-10-24 21:14:02 +00:00
Andy Shaw
e2d8c7bf22 Don't change the size of widgets just because it is in a floating dock
When a QDockWidget was floating on macOS then it would force the size of
various widgets, such as buttons, comboboxes, to be the smallest needed
rather than the size they had when it was docked.

Task-number: QTBUG-7460
Task-number: QTBUG-52354
Change-Id: Id348180934f113f3a9a9ce5622a9af03eed04108
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-24 16:02:23 +00:00
Andy Shaw
843247e1c5 Call raise on the window that contains the widget and not the widget
When the mouse is clicked on the widget in a window while a popup is
visible then it should raise just the window and not the widget inside it.
If the widget is in a stacked layout then calling raise() on it can cause
it to appear on top so avoid this by calling raise() directly on the
window.

Task-number: QTBUG-52670
Change-Id: Idd287c6cc7038c57e14e92f4a3e1c50985925684
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-10-24 16:01:35 +00:00
Erik Verbruggen
f6eb570c7d Darwin: normalize all watched paths to composed from
This will be done by all POSIX APIs for strings coming in that way, but
because other code (like NSWhateverViews) will most likely return
decomposed form, we make sure that those are in composed form too.

Task-number: QTBUG-55896
Change-Id: I065e11cee6b59706d4346ed20d4b59b9b95163b8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-24 15:10:42 +00:00
Eskil Abrahamsen Blomfeldt
592614ea3e Don't claim all fonts are smoothly scalable on Windows
Since 40ebda3efb, bitmap fonts are detected
as smoothly scalable on Windows. While the fontsAlwaysScalable() does say
whether or not the font engine can rasterize the fonts at any size, it does
not determine whether or not the result is "attractive" as the
documentation for isSmoothlyScalable() says.

Only outline fonts are smoothly scalable, and this fact is used in Qt Quick
to determine whether we can use the distance field renderer for the font or
if we have to fall back to the native renderer. The consequence was that
the fonts were no longer usable in Qt Quick.

We also need to revert the optimization for isBitmapScalable() since there
a font that is smoothly scalable should not be identified as bitmap
scalable (basically this means: Font is not smoothly scalable, but it
can be scaled with bitmap scaling artifacts).

[ChangeLog][QtGui][Text] Fixed a regression where raster fonts on Windows
were detected as smoothly scalable and thus rendering with said fonts
in Qt Quick would break.

Task-number: QTBUG-56659
Change-Id: Ia7db6fee8249aca347233a488388be5c3a00c2df
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-24 14:52:49 +00:00
Erik Verbruggen
30b7278c5c Remove type punning from ucstrncmp
Type punning is UB.

Change-Id: I0022d2a38136d80f5ddda21cea7dc0968c736242
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-23 11:48:20 +00:00
Marc Mutz
e70e168abb Plug leaks in tst_QWizard
This completely over-engineered piece of code has a hierarchy of
Operation subclasses encapsulating but three actual operations
on a QWizard.

Because these operations and their containers were all allocated
on the heap, but never deleted, asan went crazy and reported over
50 leaks (not the record so far, but a (distant) second).

Since these collections are passed through addColumn/QFETCH, too,
it's nearly impossible to track their lifetimes. So instead of
trying, delegate that to the runtime, ie. pack the Operation
objects into QSharedPointer and pass around those instead.

Change-Id: I8a0fe7a60cd30aed618667affaa030e80cf2b1ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2016-10-22 10:20:22 +00:00
Marc Mutz
84dc7d5f55 QComboBox: fix build with GCC 7
GCC 7 warns about implicit fall-throughs now.

Fix by adding the missing comments.

Interestingly, Coverity only found one of them, even though all three
still exist in dev, too.

Change-Id: I9f2c5e2700d5ec5234fee3a532feffe01b7c4ce3
Coverity-Id: 11156
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2016-10-22 10:20:18 +00:00
Marc Mutz
0e888ae1a1 tst_QGraphicsItem: plug remaining leaks
Store QGraphicsItems that are either not added to a scene or
removed from it again and that are also not children of other
items - iow: those that were leaked, even on successful runs
of the tests, in either a QScopedPointer, or, where that'd
cause too much churn due to adding of .data() calls, back the
pointer by a stack-allocated object.

This fixes the remaining leaks reported by GCC 6.2.1's ASan on
successful runs of tests/auto/widgets/graphicsview/qgraphicsitem.

Change-Id: I61c3a1cd39b9e96e83c5d7b8cf392e0b26ecbaf0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2016-10-22 10:20:14 +00:00
Marc Mutz
686c44a69b Plug remaining leaks in tests/auto/widgets/kernel
The usual:

- delete return values of QLayout::takeAt(), replaceWidget()
- delete styles
- delete top-level widgets
- delete actions

Either by naked delete, QScopedPointer or allocation on the
stack instead of the heap.

This fixes the remaining errors in GCC 6.1 Linux ASan runs of
tests/auto/widgets/kernel.

Change-Id: I8cc217be114b2e0edf34ad8d60dbf722f900bb7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-21 21:48:26 +00:00
Kai Koehne
f773ddd026 Fix when calling QSurfaceFormat::setDefaultFormat before Q*Application
Fixes a regression introduced in commit 51767affb.
QOpenGLContext::globalShareContext requires a QGuiApplication to exist.
This wasn't required so far.

Task-number: QTBUG-56614
Change-Id: I07bcf434fca536c4dc50feee7ea17eb541fd589a
Reviewed-by: Liang Qi <liang.qi@qt.io>
2016-10-21 14:45:30 +00:00
Anton Kudryavtsev
10b9321c1d qxcbconnection.cpp: fix warning about unused function
isXIEvent() is used iff XCB_USE_XINPUT2 is defined.
So move declaration of the function in XCB_USE_XINPUT2 define scope.

Change-Id: I6f045cd07d572ee7425ee6edc5ac73dcf0afdb37
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-21 09:14:05 +00:00
Frederik Schwarzer
92df823ed6 QFileInfo: fix double sentence in apidoc
Change-Id: Ie1cf32565b2fcb828ec381c45595adad1392e2ec
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-21 09:06:50 +00:00
Frederik Schwarzer
ef88bf02ef Fix some typos in docs and apidocs
While "commonest" is still correct English, it's rather old-fashioned
and "most common" predominates Qt's wording style.

Change-Id: I20d72c098ee40b2a89f91e42f7208fe5b87286a2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-21 09:06:13 +00:00
Erik Verbruggen
49d3bb0058 Normalize realpath(3) output to composed form
All strings coming out of POSIX API calls are converted to composed form
by QFile::decodeName. Do the same for realpath(3) output. This is
especially important for HFS+, which will store file names in decomposed
form, and APIs will therefore return strings in decomposed form.

Task-number: QTBUG-55896
Change-Id: I5e51f4e5712ff26bf9644cbcf9a9603995748892
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-21 07:49:00 +00:00
Kai Koehne
557abfc327 QUrl effective TLDs: update table
There are more than 1000 new entries since the table has been
generated the last time. The autotest needs to be tweaked
because the rules for the .mz domains have changed; use the
.ck domain instead.

Change-Id: Ife692afd46ac41a66604e966e5e8cb57c7aa649c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-21 06:29:53 +00:00
Marc Mutz
294c870bed QImage: cache colortable size
Coverity threw an error that in the else branch, the expression
colorTableRGB16[tableSize - 1] accesses uninit'ed data. The working
theory is that it fails to perform the implication

   isEmpty() → size() == 0

This patch, therefore, checks for size() == 0 instead of isEmpty(),
which is hardly less readable and might help Coverity understand the
code better.

Then again, Coverity might not understand that the tableSize can never
be negative.  If that's the case, another patch will be needed, but
let's try the simpler solution first.

Coverity-Id: 11420
Change-Id: Ibfe2a798c55af95c8001fa909aa94a6c5bc7c647
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2016-10-21 06:19:21 +00:00
Marc Mutz
b6df725750 Fix UB (ininited pointer read) in qt_egl_device_integration()
The m_integration member of DeviceIntegration, a naked pointer, was
checked for nullptr in the DeviceIntegration ctor, but never set to
nullptr.

Fix by init'ing it to nullptr in the ctor-init-list.

Coverity-Id: 172056
Change-Id: Ia1dc9b67b9d16a991bba82338eedb19de68f91d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-21 06:19:13 +00:00
Marc Mutz
0cccc23478 QNetworkReplyHttpImpl: Fix UB (member call) in destruction sequence
Found by UBSan:

  qnetworkreplyhttpimpl.cpp:457:29: runtime error: member call on address 0x602000009cf0 which does not point to an object of type 'QNetworkReplyHttpImpl'
  0x602000009cf0: note: object is of type 'QObject'
   1e 00 80 18  20 e0 bb 12 54 7f 00 00  00 f2 00 00 70 61 00 00  02 00 00 00 ff ff ff 06  08 00 00 00
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QObject'
    #0 0x7f541461b71b in QNetworkReplyHttpImplPrivate::~QNetworkReplyHttpImplPrivate() qnetworkreplyhttpimpl.cpp:457
    #1 0x7f541461b7f0 in QNetworkReplyHttpImplPrivate::~QNetworkReplyHttpImplPrivate() qnetworkreplyhttpimpl.cpp:458
    #2 0x7f540f26df1a in QScopedPointerDeleter<QObjectData>::cleanup(QObjectData*) qscopedpointer.h:54
    #3 0x7f540f26df1a in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::~QScopedPointer() qscopedpointer.h:101
    #4 0x7f540f26df1a in QObject::~QObject() qobject.cpp:940
    #5 0x7f540e915f6e in QIODevice::~QIODevice() qiodevice.cpp:416
    #6 0x7f5414599bae in QNetworkReply::~QNetworkReply() qnetworkreply.cpp:444
    #7 0x7f54145e6f5e in QNetworkReplyHttpImpl::~QNetworkReplyHttpImpl() qnetworkreplyhttpimpl.cpp:239
    #8 0x7f54145e6f5e in QNetworkReplyHttpImpl::~QNetworkReplyHttpImpl() qnetworkreplyhttpimpl.cpp:242
    #9 0x7f54144b3539 in void qDeleteAll<QList<QNetworkReply*>::const_iterator>(QList<QNetworkReply*>::const_iterator, QList<QNetworkReply*>::const_iterator) qalgorithms.h:317
    #10 0x7f54144b3539 in void qDeleteAll<QList<QNetworkReply*> >(QList<QNetworkReply*> const&) qalgorithms.h:325
    #11 0x7f54144b3539 in QNetworkAccessManager::~QNetworkAccessManager() qnetworkaccessmanager.cpp:496

Fix by moving the emission of the QNetworkReplyHttpImpl::abortHttpRequest()
signal from ~Private, when the public object is merely a QObject anymore,
to ~QNetworkReplyHttpImpl(), when the public class is still itself.

Change-Id: Ifb3b19f6d180452bdf3fc26f54629ef780a5d9d9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-10-20 11:03:37 +00:00
Oliver Wolff
0e61323c87 winrt: Added timeout for cancellation of socket read operation
As the function runs on the XAML thread it can make the app
unresponsive/wait forever on a socket close. Thus we should not wait
forever but have a timeout. If the timeout is hit the socket is not
closed properly but hard reset.

Change-Id: I82e9425c0f8195e3465027fdc2417a93f1c1ad91
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-10-20 07:02:10 +00:00
Andy Shaw
2c0033983b macOS: Don't override the set tab text color with white
Originally on macOS it would override any tab text color with white
for the active tab as it would set it directly on the option palette
inside the style code. This would cause it to ignore any changes done
by the user in a changed option, via setTabTextColor or in a proxy
style. Therefore the setting of the color should be done when the style
option is initialized and only if the tab text color has not been
set by the user.

This has the added effect of making it easier to change the color for
tabs via a stylesheet since it will not be overridden in the style but
setup correctly in the option instead.

Change-Id: Ic338e96470112cba71d422bce79e664df0cb188a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-19 15:48:48 +00:00
Andy Shaw
cd081ca96a macOS: Only show menu and allow dragging on proxy when a file path is set
If there is no file path set then it should not be possible to see a
menu or to drag from a proxy icon in the titlebar.

Task-number: QTBUG-56082
Change-Id: Ib8305bcab5717bc8cb7ddabbb079f152debbdded
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-19 15:48:39 +00:00
Andy Shaw
b38145a11d PDF: Handle monochrome images correctly
When an image is considered to be monochrome then it should not be
making the white part of the image transparent, the colors should be
kept as is.

Task-number: QTBUG-56489
Change-Id: I3621ca7be2a0ebe6852363f860c0b3de28d28a31
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-19 15:48:31 +00:00
Sérgio Martins
6cfdfad7d4 Don't crash while parsing malformed CSS
Task-Id: QTBUG-53919
Change-Id: I31a0e218e4e41ee217f8f87164f115450d69d42c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-10-19 15:38:56 +00:00
Clinton Stimpson
ee22c6505a xcb: fix passing of focus from child to its top level QWindow
With the client message _NET_ACTIVE_WINDOW, not all window managers
will pass focus from a child window to its root window, Detect this
child-to-root case, and use xcb_set_input_focus() instead.

Task-number: QTBUG-39362
Change-Id: Ib32193018e3b725b323f87d7306c9ae9493d78a7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-19 15:24:22 +00:00
Marc Mutz
46078f3374 QOrderedMutexLocker: unlock in reverse order of locking
This is an improvement for the following reasons:

- Should mutex locking allocate any kind of resource,
  unlocking in reverse order will free those resources
  in inverse order, which helps typical allocators.
- If the lock pair is contended, by unlocking in the
  same order as locking, we were allowing the waiting
  thread to wake up to take the first lock just to
  find that the second lock is still held by someone
  else.

The order of unlocking has no influence on the correct-
ness of the algorithm.

Change-Id: Id16b0342aef325c14a7bd8836d3a75db68ef2588
Reviewed-by: David Faure <david.faure@kdab.com>
2016-10-19 13:25:01 +00:00
Albert Astals Cid
8249f490ff Document QClipboard::mimeData can be null
The current wording (reference) seems like it's always a pointer to valid stuff

Change-Id: I2a9f8bde7d2ba672e4e664ff731a3272a6deaaaa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-19 08:58:18 +00:00
Andy Shaw
683c9bc4a8 Windows: Fix regression in QFSFileEnginePrivate::nativeWrite()
Change 0696566b1e caused the block
size to be incorrect for data > 32MB.
Since bytesToWrite changes within the do...while loop, then the block size
can potentially change too each time. So it needs to be recalculated each
time rather than just once.

Task-number: QTBUG-56616
Change-Id: I9880d0985f2d0242c30e67230be7271eb806db95
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-10-19 08:05:32 +00:00