Commit Graph

36194 Commits

Author SHA1 Message Date
Mitch Curtis
e04b85b026 Doc: improve Mandelbrot example
Change-Id: Iac6c3e681f3d5b195d08513ac5fe4b661c3d0f59
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-09-11 08:09:32 +00:00
Eirik Aavitsland
621ab8ab59 bmp image handler: check for out of range image size
Make the decoder fail early to avoid spending time and memory on
attempting to decode a corrupt image file.

Change-Id: I874e04f3b43122d73f8e58c7a5bcc4a741b68264
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-11 06:36:34 +00:00
Qt Forward Merge Bot
1f1e2aa57b Merge remote-tracking branch 'origin/5.11.2' into 5.11
Change-Id: I2fa26fa061cbf5d2bded203a299a19b7d1c31d0a
2018-09-09 12:13:02 +02:00
Kai Koehne
3bac18da8e Document SLJIT part of pcre2
src/sljit features the BSD-2-Clause license, not the BSD-3-Clause one.

[ChangeLog][Third-Party Components] Added documentation for the SLJIT
part of pcre2, which is available under the BSD-2-Clause license.

Change-Id: Ie1e981ef6eab2c8d2960919b66ac85b29450f919
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-06 12:09:31 +00:00
Laszlo Agocs
85f127cb04 Revise an incorrect QVulkanWindow doc note
Applying the transformation in question has no effect on the winding
order. Rewrite that section.

While all the examples are correct, clarify the rules for the geometry
they use since the winding order varies. Fix up the triangle example code
to use front=CCW for clarity (even though it does not matter much since
culling is off there).

Change-Id: Icb968c76cc9fa918a5608d3c66b4fccd5668175e
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2018-09-06 09:17:53 +00:00
Andre Hartmann
689a1e186b QString: Fix snippet explaining "non-spaced numbered place markers"
The snippet tries to explain the advantage of

 str.arg("Hello", QString::number(20), QString::number(50));

over

 str.arg("Hello").arg(20).arg(50);

which only makes sense, if str contains the same formating sequence,
namely "%1%3%2". That also matches the belonging comment.

Amends 8481500f63

Task-number: QTBUG-44044
Change-Id: Ic2595107bc599c6d244ebf88184a5cc5569ed4f1
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-06 09:07:01 +00:00
Andre de la Rocha
20ac20bcea Windows QPA: Fix missing accessibility info with WebEngineView
It seems when a WebEngineView is parented by a window its accessible
interface will not know its parent, which prevented the root of an
UI Automation fragment from being found, causing missing accessibility
info. This change adds a workaround to avoid this issue.

Task-number: QTBUG-70199
Change-Id: Ia7cfc9f410c4f0ef3b5f9d1700748a9a3e29b7c2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2018-09-04 19:48:01 +00:00
Venugopal Shivashankar
ff2a71e310 Doc: Move the literal code blocks to a separate file
It's easier to override the code blocks this way.

Change-Id: I98d40626a94fdb70a95c50332c2da141e9277070
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-09-03 12:31:07 +00:00
Morten Johan Sørvig
9da5b6f743 Revert "macOS: Force light theme on macOS 10.14+"
This does not really work: as soon as you build with
the 10.14 SDK you opt-in to having updated palette
management, which the Qt 5.11 series does not have.

This leaves app developers with two ways to opt-out
of dark mode:
 - Build with the 10.13 (or earlier) SDK.
 - Set NSRequiresAquaSystemAppearance in Info.plist

This reverts commit 04671a80db.

Change-Id: I5c01b9965da45de914f699526ba0723837f36e1d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-09-03 04:45:04 +00:00
Antti Kokko
4daa6bba7f Add changes file for Qt 5.11.2
Edited-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Ic7f9fdb79524194bf92d330052d971506f066fc5
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-03 04:44:46 +00:00
Morten Johan Sørvig
d615fb39d5 Make QMacCocoaViewContainer work again
The widget visibility state was set to explicitly hidden,
which was preventing it from working correctly when
its parent widget was shown.

This regression was introduced by commit d7a9e08,
which made QWindow::setVisible() call QWidget::setVisible().

QWindow::destroy() calls QWindow::setVisible(false),
which means that the destroy() call in setCocoaView()
would set the CoocaViewContainer to be explicitly hidden.

Clear WA_WState_Hidden to work around this behavior.

Task-number: QTBUG-67504
Change-Id: I77438fcd01f165f058eea178c214838bd4f27084
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-02 20:14:40 +00:00
Tor Arne Vestbø
4e4057460a macOS: Warn the user when using incompatible or untested platform SDKs
Task-number: QTBUG-70263
Change-Id: Ic946d1efc69ebb8ba65bbba956ed55ab7183957e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-31 12:25:23 +00:00
Tor Arne Vestbø
3ed306772e macOS: Detect changes to the platform SDK and ask the user to deal with it
Otherwise the SDK upgrade (or downgrade) may subtly and silently affect
the resulting binary, or if it results in build breaks, the user won't
know why.

We limit it to applications for now, as that's the point where it's
most important to catch the SDK upgrade, but technically we should
also do this for intermediate libraries. Doing it for everything
will likely incur a performance cost, so we skip that for now.

Change-Id: I8a0604aad8b1e9fba99848ab8ab031c07fd50dc4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-31 12:25:19 +00:00
Kai Koehne
a381ba4220 Document version number of pixman
The files match the ones in pixman 0.17.12

Task-number: QTBUG-69276
Change-Id: Idd03c6979456ad2cf4dcc2aee6986ebc95140937
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-31 12:06:34 +00:00
Allan Sandfeld Jensen
244c7bd193 Avoid conversion over RGBA64 for RGB32 LCD text blending
Short-cuts the case where there is no gamma correction to avoid a
conversion over RGBA64 and back.

Change-Id: I100697a9f7a4b94283557b2c0eaa45e0eff81785
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-08-30 18:39:32 +00:00
Paul Wicking
7f0cc35d9c Examples: Fix minor bug in Tree Model Completer Example
Minor bug that caused highlighter to not work properly.

Task-number: QTBUG-66084
Change-Id: I7860d7a13c402e3236f4c844020e35e11f6e53e5
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-08-30 13:14:01 +00:00
Venugopal Shivashankar
059b10f295 Doc: Check before including the \snippet from a .pro file
Change-Id: Icc7552b46a2657c81958e40f33596ddeee045172
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-08-30 09:23:42 +00:00
Tor Arne Vestbø
5b6eb8e247 Extend C++1z test to include variant APIs we use
std::get and std::visit are only available on macOS 10.14, so as long
as we're building with a deployment target lower than that, we can't
enable C++1z globally unless we special-case use of those functions.

Change-Id: Idb5eb5992ea4dd7eab92f5310321720e19ac793e
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-08-28 13:55:15 +00:00
Tor Arne Vestbø
2ef5362011 QMacStyle: Make helper-NSViews layer-backed
This prevents the view from triggering display of its superview when
being temporarily added, which is both inefficient and causes issues
when those dirty-rects are wrong due to the wrong frame position of
the added view.

The additional drawRect: calls and corresponding expose events
resulting from the needsDisplay calls also caused repaint issues
in Qt Widgets. QWidgetBackingStore doesn't seem to take the exposed
region into account for an expose event, and will try to flush all
dirty regions. Some of those may be outside the exposed region,
and will be clipped away by the window system, never ending up on
the screen, but with Widgets still thinking it has flushed all
dirty regions.

This is a separate issue, possibly solvable by setting the
wantsDefaultClipping property on NSView to NO, but this needs
further testing, so applying this commit as workaround makes
sense, even if it's just hiding the real bug.

Task-number: QTBUG-67998
Task-number: QTBUG-68023
Task-number: QTBUG-69990
Task-number: QTBUG-69740
Task-number: QTBUG-69292
Task-number: QTBUG-69332
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 38979332d0)
Change-Id: I4ef3fef29f749daa4f3a11fe9186ae77b359f966
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-28 10:28:47 +00:00
Paul Wicking
ac5e617596 Doc: Fix typos in QRectF documentation
Add missing 's'.

Fixes: QTWEBSITE-823

Change-Id: I1acd3b7ae18982248bf3402fa5943ee95c1efdbe
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-08-27 17:48:18 +00:00
Paul Wicking
9652711a07 Doc: Remove non-reentrant from QDomDocument::setContent
Following QTBUG-40015, QDomDocument::setContent is reentrant.
This change updates the documentation accordingly.

Fixes: QTBUG-69920

Change-Id: Id09e3541156f52d1a976afd02b410c263d3b3352
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-27 13:49:40 +00:00
Frederik Gladhorn
900ce73b6f Merge 5.11 into 5.11.2
Change-Id: I672bc167de3801c944315d92120c5e03da69e9c7
2018-08-27 15:49:03 +02:00
Edward Welbourne
bd42e2f0ce Blacklist two tests on macOS that a planned CI change shall break
We have #if-ery on Q_OS_DARWIN controlling an expectation of gettign
"GMT+1" and "GMT+2" instead of "CET" and "CEST" in two tests; this
turns out to not be a deficiency of macOS so much as of how we
configure Coin's VMs.  While we fix that, we need to ignore failures
in these tests, so that we can pull the #if-ery out and clear the
blacklist once the VMs are set up properly.

Task-number: QTBUG-70149
Change-Id: If3577200cf980b3329161ab3eea7bd2e9d0124e0
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-08-24 17:30:01 +00:00
Eskil Abrahamsen Blomfeldt
f71048a531 Fix crash when combining QOpenGLWidget, QStaticText and Qt Quick
Under certain circumstances, if you had a widget with a QOpenGLPaintEngine,
and drew QStaticText into this, and then later had Qt Quick access the same
cache and try to resize it, we would get a crash because the resize function
would have a pointer to the paint engine and try to access its shader manager
(which would now be null, since this is outside the begin()/end() phase of the
paint engine.

The solution is to reset the paint engine pointer to null on the cache once it
has been populated and it is no longer needed.

[ChangeLog][QtGui][Text] Fixed a possible crash when combining QStaticText,
QOpenGLWidget and Qt Quick in the same application.

Task-number: QTBUG-70096
Change-Id: I7383ad7456d1a72499cfcd2da09a5a808d4b3eff
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-08-24 08:30:28 +00:00
Edward Welbourne
dc7e775c9c Test for fractional part of Costa Rican currency
CLDR up to somewhere between v29 (used by 5.9) and v31.0.1 (used by
5.10 and later) claimed Costa Ricans don't include fractions in their
currency; now it claims they expec two digits.  Apparently one of them
does expect those digits, so this is the regression test I'll be
cherry-picking back to LTS, to accompany the CLDR updates they need.

Task-number: QTBUG-70093
Change-Id: I138772cc6013fa74de4f7c54b836cac83421eab2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-23 12:54:53 +00:00
Mitch Curtis
972dd1c544 Doc: fix typo in QNativeGestureEvent docs
Change-Id: I83ac3463752488d7dbb758ea767ba186ddd3fa2a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-23 09:36:21 +00:00
Luca Beldi
02b3d43fd4 _q_interpolate<T> is unsafe with unsigned template arguments
_q_interpolate<T> subtracts 2 arguments of type T,
for unsigned types this can cause wrapping around

Task-number: QTBUG-57925
Change-Id: Iffa59f413579a3d5de8cb728fe71443d8e8a04aa
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-08-22 08:38:44 +00:00
Mitch Curtis
76c328b2b3 Fix spacing in << operator for QEvent
Turns

     QNativeGestureEvent(ZoomNativeGesturelocalPos=686.855,312.836,
         value=0.0259857)

into

     QNativeGestureEvent(ZoomNativeGesture, localPos=686.855,312.836,
         value=0.0259857)

Change-Id: Id30860a3c7a1b6da583369126a31934ddb32d4b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-08-21 14:45:58 +00:00
Alexander Shevchenko
2d3098f77c Fix qtbase build for Windows ICC with MSVC 2017 15.8
After 0ef66e98cc was merged, the same should be done to
Windows ICC toolchain.

Task-number: QTBUG-69997
Change-Id: I1d76d8b59f87151a9064d9f7dcc3136dc1215633
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 11:42:59 +00:00
Kai Koehne
2a9223830c Doc: Remove duplicate thread-safe documentation from logging macros
qdoc now handles \threadsafe also for macros, so we can remove the
explicit \note.

Change-Id: Iabeb7f69d237e7024a4f584adc516951b06d752b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-08-20 10:43:45 +00:00
Edward Welbourne
4932cef5b8 Cast away -Wclass-memaccess warnings in QVarLengthArray methods
With g++ 8.2.0, I get warnings when a QVarLengthArray<QString> calls
remove() or prepend(), as some tests in tst_QVarLengthArray do, as
they call memmove() "writing to an object of type ‘class QString’ with
no trivial copy-assignment; use copy-assignment or copy-initialization
instead"; which may indeed be a good argument for not using
QVarLengthArray<QString>, but its own tests do.

Change-Id: I4f8a64948b32a54e67a285df4ec7788f60739ffb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 09:08:50 +00:00
Kai Koehne
54d062160d Document version of copied valgrind, kernel headers
Task-number: QTBUG-69276
Change-Id: If2d5d796fd9d414a41036187a178d88c2e93b5ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-20 07:50:04 +00:00
Andre de la Rocha
981b16d9ba Windows QPA: Fix mapping of static text accessibility role
QAccessible::StaticText should be mapped to UIA_TextControlTypeId instead
of UIA_EditControlTypeId.

Task-number: QTBUG-69894
Change-Id: If2f8f55d2be492c02a3af5b1813ca12cf774a33a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-17 08:53:20 +00:00
Lars Knoll
055ff7a8a4 Don't reset the bidi level on spaces
Fixes a regression introduced with the update to the bidi
algorithm.

Task-number: QTBUG-69633
Change-Id: I7eac45ed3ffb41f89ea3f793eedcfb6fcdace871
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-17 08:23:26 +00:00
Lars Knoll
1702ae24b3 Only show the bidi cursor mark if we actually have bidirectional text
Don't show the mark simply because we have unicode code points
larger than 0x590.

Task-number: QTBUG-69665
Change-Id: I9af97383f3bcd52277a5288e7ad06ec240c7e51c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-17 08:23:20 +00:00
Luca Beldi
70ba75519d QSortFilterProxyModel inserting at bottom of source model
Before this change, if you try to insert a row at the bottom of QSortFilterProxyModel
the row will be inserted in the source model at position proxy->rowCount rather
than at the bottom. This causes insert at apparently random positions in the source.

[ChangeLog][QtCore][QSortFilterProxyModel]
QSortFilterProxyModel::insertRows(row,count,parent) with
row == QSortFilterProxyModel::rowCount will insert at the bottom of the source model
rather than at the row QSortFilterProxyModel::rowCount of the source model

Task-number: QTBUG-58499
Task-number: QTBUG-69158
Change-Id: Ie78416c8fbc429303b8c9c98375630e3e4d85f6d
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-17 08:10:11 +00:00
David Edmundson
29778037f8 Don't block on lost context
When glGetError returns GL_CONTEXT_LOST, on XCB + Nvidia at least, the
error does not get cleared until the next successful
glGetGraphicsResetStatus.

We can't handle this properly until the start of the next frame where we
will hopefully have a valid context, but in the meantime we should avoid
locking up completely.

Change-Id: Id438d44d83b926e1f3e4281ca3704231bf1a23cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-08-16 22:04:10 +00:00
Thiago Macieira
b0479aab29 QUrl: Make sure we do reject URLs for which IDNA nameprep failed
qt_nameprep() already reset the string to its original length to
indicate failure, but we didn't handle that in qt_ACE_do(). So make it
have a return value whcih makes it easier to handle that case and do
handle it.

[ChangeLog][QtCore][QUrl] Fixed a bug that caused URLs whose hostnames
contained unassigned or prohibited Unicode codepoints to report
isValid() = true, despite clearing the hostname.

Change-Id: I41e7b3bced5944239f41fffd1545b7274c4b419d
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-16 19:34:52 +00:00
Thiago Macieira
04bbf534f9 MSVC: add support for 64-bit POPCNT on 32-bit machines
It's just adding the count of each half.

Change-Id: I9868946ceaf74002bde1fffd154b29908319007f
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-08-16 16:33:38 +00:00
Alexander Volkov
242ea38375 doc: Add missing override and remove redundant virtual for snippets
Change-Id: I2395fd01b93c4ea364225e0cf1a5f59908b691d0
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-08-16 11:00:31 +00:00
Paul Wicking
9b59a2ef97 Doc: Update out-of-date screenshots in example docs
Task-number: QTBUG-63248
Change-Id: I4cd47977ae020b43ca92b1781ac8b038e6ef851c
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-08-16 10:12:21 +00:00
Paolo Angelelli
a0ebd98f58 Normalize path segments in QHttpNetworkRequest::uri
Task-number: QTBUG-69659
Change-Id: I184cc460d2e3736d042893a38aa1c11b7d443f88
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-16 04:52:56 +00:00
Kai Koehne
d47c287d70 Document xkbcommon version
Task-number: QTBUG-69276
Change-Id: I0023ce210205def958b9e18f3d3c3a63576fc871
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-08-15 14:14:26 +00:00
Kevin Funk
48eb08d255 tests: Fix top-level CMakeLists.txt
Problem:
 CMake Error in CMakeLists.txt:
  A logical block opening on the line

    .../qtbase/tests/auto/cmake/CMakeLists.txt:149 (if)

  is not closed.

Broken by change 02ed1b36da

Change-Id: I6c04721edbccaa9fcdb53af92d33dfa87eeaebb8
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-08-15 11:08:34 +00:00
Shawn Rutledge
8f18510133 Silence warning about comparing signed and unsigned
qxcbimage.cpp:72:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]

Task-number: QTBUG-69923
Change-Id: Icdb4ce8cb7ce5b48d7ee3839166eb1c7c9520c78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-14 15:59:40 +00:00
Erik Verbruggen
8dd40e9b09 [macOS] Fix lower bound when searching for previous transitions
The lower bound shouldn't be the smallest (positive) value representable
by a double, but the *lowest* (finite) value.

Task-number: QTBUG-69862
Change-Id: Ia66610e3c0f8d9643c329714607f5af573206fd8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-14 15:02:08 +00:00
Shawn Rutledge
f2862b4d5d VNC plugin: explicitly cast int to uint16_t before calling htons
Otherwise there is a -Werror=narrowing error on big-endian
architectures (where htons does nothing).

Task-number: QTBUG-68390
Change-Id: Idb204a81aaedb9f4fde1d5fae406da36c7a1953e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry-picked from b206d1c808)
2018-08-14 14:59:58 +00:00
Alexander Volkov
43f5377fad Make QMessageBox window with the detailed text closable
QMessageBox window ignores QCloseEvent if it was created
with Ok button and the detailed text was set. But it can
be closed if it contains only one button.

Make it closable if there are two buttons and one of them
is the "Show Details..." button.

[ChangeLog][QtWidgets][QMessageBox] A message box with two
buttons, one of which is the "Show Details..." button,
can be closed by clicking the X button on the window's
title bar.

Task-number: QTBUG-69526
Change-Id: Iba09e38561eb3898dc2aecfd38d8519d512a71c1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-14 04:39:05 +00:00
Johan Klokkhammer Helsing
edbac71691 Skip all qfocusevent test on platforms that don't support window activation
Task-number: QTBUG-66846
Change-Id: Ia8b69ede9154822f78ca28e0a2470b8bfb2abef0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-14 04:38:35 +00:00
Gatis Paeglis
833b9997fd xcb: make sure we have a valid m_qimage in backing store
This patch amends a62f1d0356.

If the initial backing store resize request is called with QSize(0, 0),
we end up with QXcbBackingStoreImage holding a default contructed QImage / m_qimage.
This happens because of the logic in QXcbBackingStoreImage::create(), where
if we detect that the requested segmentSize == 0, we do not allocate
any memory, and thus don't create a valid image in m_qimage. On subsequent
call to QXcbBackingStore::resize() we would only check if QXcbBackingStoreImage
object has been created, but not if it is in a valid state. This obviously
would cause problems.

This patch re-factors the logic to handle better resize to QSize(0, 0). And
make the code cleaner by:

- merging ::create and ::resize as semantically it is always resize().
- dropping unnecessary argument passing.

Task-number: QTBUG-69581
Change-Id: Ied337beb449dea8259fcf6b7d29f0a5bd553019d
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-13 22:14:26 +00:00