Commit Graph

27796 Commits

Author SHA1 Message Date
Andy Shaw
3cd457bdad Handle RemovePath correctly when calling matches()
Change-Id: Ied324a537df127e676fad26b42e658a9d5aeec9b
Reviewed-by: David Faure <david.faure@kdab.com>
2016-11-22 07:05:30 +00:00
Oliver Wolff
9f17c24589 Enable constexpr support for Visual Studio 2017
Change-Id: I894789c41cc2c1a327c14d0526e658520d096085
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-22 06:07:25 +00:00
Oliver Wolff
38675e18fc Add support for Visual Studio 2017
Tested with RC

Task-number: QTBUG-57086
Change-Id: I21f56edca3852b52edd2c5fdcce76817141e8d4a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-22 06:07:23 +00:00
Vyacheslav Koscheev
0a203faa7f Adjust comment to "new" spec name
Change-Id: I58250de09f10637b145a5f43c3764a86e47bce96
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-22 05:39:51 +00:00
Marc Mutz
4bf5a3c885 tst_QFormLayout: Fix UB (invalid enum value) in several functions
The code coerced a -123 into a QFormLayout::ItemFlags, which, however,
being an enum with enumeration values 0..2, only has valid numerical
values 0..3.

Fix by using 3 as the value to represent the invalid enum value, and
store this in a constant so as not to distribute this magic number
all around the test class.

Change-Id: Ie5e93a69ef5a3acdde43030b022e0cce8aec484d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-22 05:38:45 +00:00
Friedemann Kleint
ad788c1014 tst_qstandardpaths: Disable WOW64 redirection on Windows
The logo (microsoft.windows.softwarelogo.showdesktop.exe) is otherwise
not found.

Change-Id: Ic52329462612a027e2928922a1f9a541dcbc67a3
Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-22 05:29:11 +00:00
Timur Pocheptsov
e798d0b18a qnativesocketengine_winrt - do not shadow a variable
We first hide identifier 'hr' and then later we check the one that was never
correctly initialized.

Task-number: QTBUG-57226
Change-Id: Ibbf1bb99aa752c2e4090caf4533dc5f5b71b5e41
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-22 05:05:24 +00:00
Marc Mutz
3691f7ca0c QFutureInterface: make accesses to 'state' thread-safe
Introduce helper functions switch_{on,off,from_to} to make
the code more readable, and prepare everything for later
optimizations reducing the sizes of critical sections (by
locking the mutex later, or even never).

This commit, however, is only concerned with shutting up
tsan.

In waitForResult(), simplified the code by removing an
unneeded if guard: the condition is checked in the while
loop immediately following in the then-block, and the
local variable declaration that precedes the loop is not
worth guarding.

Change-Id: I24bfd864ca96f862302536ad8662065e6f366fa8
Reviewed-by: David Faure <david.faure@kdab.com>
2016-11-20 15:48:05 +00:00
Peter Seiderer
f1b4bd4790 eglfs: fix eglfs_mali compile for odroid-mali
Avoid duplicated struct fbdev_window definition (introduced by commit
58bed4cda9) by renaming the local
shadow definition to struct shadow_fbdev_window.

Task-number: QTBUG-57156
Change-Id: I72b03f09fc57ddcd0284d6d3554a5658e02b80fc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Julien Corjon <corjon.j@ecagroup.com>
2016-11-19 21:25:52 +00:00
Kai Koehne
0d2f0164f4 Also release winmain, qopenglextensions under commercial licenses
Add commercial licenses as an alternative to BSD for code that
is statically linked into applications by default. BSD requires
attribution even for commercial customers, which is not intended.

This is a manual backport of parts of change 71404b0be1 in 5.7,
and should be dropped when merging to 5.7.

[ChangeLog][License Changes] Static libraries that are linked
into executables (winmain and qopenglextensions) are
now licensed under BSD _and_ commercial licenses.

Change-Id: I0d33bc09c06548d63b11a39027e9bb12c1b9a915
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-18 16:19:56 +00:00
Kai Koehne
4b1c343e5e Doc: Add missing reference to qInfo()
Change-Id: I7438aa8ff9fddf2e0155ffe0d442f96d4d9265d4
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-11-18 16:19:49 +00:00
Edward Welbourne
a56dd0b828 tst_QDateTimeEdit: Use base method, not direct member access
A test was directly accessing the .text member of QDateTimeParser
(which presently has nothing private).  Use the virtual .displayText()
method of this base instead, to let the base have some hope of
data-hiding (maybe, some day).

Change-Id: I8b6e39fba130de56f117bffb2aec346197969c5b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-18 05:03:43 +00:00
Allan Sandfeld Jensen
ac384524c8 Speculative fix for tst_QThread::wait2() flakiness
This test fails on Windows occasionally with values just short of 800, the lowest
observed being 791. It is probably rounding somehow to 10ms segments, so allow
it to be up to 10 ms too fast.

Change-Id: Ie28e9f61588b68a9060a006f78eedc3a26d05155
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-17 14:23:19 +00:00
Edward Welbourne
658c8370e4 QDateTimeParser: localize variable to avoid shadowing
The outer scope it was in had a later clause with its own pos
variable.

Change-Id: I8d083d3d5935416ef82a78890ed145f02d6d6ded
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-17 14:22:44 +00:00
Andy Shaw
bd591064be Use QPersistentModelIndex for storing a model index
QModelIndex is not safe to be used to store an index as it is designed
to be discarded right after use as the index information can change.

Therefore a QPersistentModelIndex should be used instead to store the
index. Subsequently the m_index does not need to be updated whenever
the model changes anymore as this is already done for us.

Task-number: QTBUG-49907
Change-Id: Icc93e410de2821c503ea15a7a1dd9ae32634914e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2016-11-17 06:48:31 +00:00
Marc Mutz
bebbaa43fd Fix warnings in tst_q{table,list}widget
GCC warned:

  tst_qtablewidget.cpp:30:
  tst_qtablewidget.cpp: In member function ‘void tst_QTableWidget::mimeData()’:
  qtestcase.h:66:52: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
       if (!QTest::qVerify(static_cast<bool>(statement), #statement, "", __FILE__, __LINE__))\
                                                      ^
  tst_qtablewidget.cpp:1523:5: note: in expansion of macro ‘QVERIFY’
       QVERIFY(data = table.mimeData(tableWidgetItemList));
       ^~~~~~~

Fix by adding the extra parentheses, as usual.

Change-Id: I2826d7a865b4113b468d5a958ede06e03aa0e278
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-16 20:21:50 +00:00
Marc Mutz
8d8991c697 QXbmHandler: don't construct a QByteArray just to find '0x' in text
Even QByteArray::fromRawData() allocates memory.

Instead of QByteArray::contains() and indexOf(), use good ol'
strstr(), like already done elsewhere in the same function.

Apart from the memory allocations saved, this fixes a Coverity error
complaining that indexOf() can return -1. It's a false positive on the
first occurrence, because we didn't call that function unless we know
there is a "0x" in the string, but the second _was_ wrong, because we
applied it on a new buffer, with unknown content.

Coverity-Id: 11262
Change-Id: I18f352c5576e24f89a5c3ef7f2f1b2176f2a235d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-11-16 19:49:04 +00:00
Sérgio Martins
e655426e7a docs: Reference QLineEdit::hasAcceptableInput() in setValidator()
Easy to miss otherwise and hasAcceptableInput() already references setValidator().

Change-Id: Id2d63050db670ab8f7150d7f76492664751cd2da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-16 19:33:43 +00:00
Martin T. H. Sandsmark
1753d69607 QCss: Fix parsing of charset
When including a CSS file in a HTML file sent to QTextDocument, and the
CSS file starts with «@charset "UTF-8";», which is the correct way of
declaring that, the parsing fails.
If you omit the space, like «@charset"UTF-8";» the parsing succeeds,
which is wrong.

Fix this by expecting and swallowing whitespace after the @charset
tokens.

Task-number: QTBUG-54829
Change-Id: I32044e8d24bda70c1eb06bf74af50d4cabe2211d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2016-11-15 17:17:08 +00:00
Marc Mutz
083d8caee1 QXbmHandler: fix missing NUL-termination
The buffer is fed into strstr() on the next loop iteration, but
strstr() expects a NUL-terminated string.

In the equivalent code some lines up, the buffer is explicitly
terminated, and we never write the last character of the buffer again,
so we'll not fall off the end of the buffer, but if we read less bytes
than in the last line, we'll parse garbage from the previous line.

Change-Id: I354e1ce1dea71188942305190500b4778a69b4ff
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-11-15 16:50:42 +00:00
Robin Burchell
f2205c48c2 QFontEngine: Cache whether or not a font can be smoothly scaled
This will be used by QtQuick to correct a performance regression introduced by
592614ea3e -- QFontDatabase::isSmoothlyScalable is
quite computationally expensive; and now it is unconditionally expensive
regardless of the platform.

Change-Id: I82bfa65a963c6c3c276d574f2b379da4a9ba5b69
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-11-15 16:02:07 +00:00
Friedemann Kleint
628d367a9d Stabilize tst_QFileDialog2::task143519_deleteAndRenameActionBehavior()
The test relied on the file created being automatically selected,
which sometimes does not happen when executing the entire test.
Explicitly select the file and check the selection.

Use the temporary directory for testing.

Change-Id: Ia58641c1ac32ba21effa8a5ace9623eb5d48a1c2
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-11-15 09:56:31 +00:00
Morten Johan Sørvig
246fe27187 Cocoa: Make dictation via speech recognition work
Returning NSNotFound from the NSTextInputClient selectedRange
implementation when there is no selection prevents
dictation from activating (for unknown reasons).

Return an empty {0, 0} range instead. Text input
methods such as Pinyin still work after this change.

[ChangeLog][macOS] Speech to text dictation now works
for Qt text input.

Change-Id: Ibf1729bdd271e8ed5ce3c9d2a0373c8ab3613d8e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-14 20:59:51 +00:00
Palo Kisa
291eba6f80 QClipboard: Fix emitting changed() in XCB
In XCB environment the QClipboard::changed() was not delivered if the
QClipboard::clear() was issued by other Qt app/process.

If the QClipboard::clear() is used, then the owner in
xcb_xfixes_selection_notify_event_t is XCB_NONE, so we need make the
decission to handle this event by the selection_timestamp and our
m_timestamp[mode].

Task-number: QTBUG-56972
Change-Id: If4c486ac02223eac506465cac7ff1a07bd02a187
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-14 19:54:58 +00:00
Marc Mutz
80842959c4 Revert "Optimize QJsonObject::operator=="
This reverts commit 862fa24179,
which attempted to optimize QJsonObject::operator== under the
assumption that the entries it holds are lexicographically
sorted. They should be, because Object::indexOf() finds them
by binary search, but apparently both fromJson(), as well as
construction through op[] leave (some) entries unsorted.

This behavior should be fixed, because other code relies on
sorted entries, too, but until the problem is more fully under-
stood, revert the patch to unbreak equality comparisons.

Task-number: QTBUG-56843
Change-Id: I5b608c16d1bbcb4f01b75ce93bd58b49ff050be2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-14 16:49:39 +00:00
Jake Petroules
addf1f45f3 qmake: fix installation of asset catalog files
This strips leading whitespace from asset catalog filenames, which was
causing installation to fail due to incorrectly calculated paths.

Task-number: QTBUG-57090
Change-Id: I80db627262f9d58f4403e2d8ab205bef2113992b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-14 15:48:41 +00:00
Friedemann Kleint
d91bf00c43 tst_QFileSystemModel::specialFiles(): Remove Windows parts
The test created a Windows shortcut (.lnk) and checked on its existence.
It was not found in the first test since QFileSystemModel returned
the resolved file name (linktarget.txt). When fixing this by querying
QFileSystemModel::fileInfo()::fileName(), the 2nd test failed since
shortcut files are not considered system files.
Amends change 3b093034b6.

Task-number: QTBUG-53890
Task-number: QTBUG-20968
Task-number: QTBUG-29403
Change-Id: Iec58b52532b44d12759eaa6c8d63a8a4dc8d1bc3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-11-14 15:26:32 +00:00
Oswald Buddenhagen
6bfe30a0bf drop obsolete file
amends 97fcf3bc9 (introduction of official android port).

Change-Id: Iaab596559c5d4c825269cbdda77d956c3650fb09
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Otto Ryynänen <otto.ryynanen@qt.io>
2016-11-14 12:19:21 +00:00
Oswald Buddenhagen
4e1d65071b fix wording issues in license prompt
Task-number: QTBUG-42136
Change-Id: Ie4ff1b38af6e7a74490558e80a0e559fee8a5486
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2016-11-14 12:19:14 +00:00
Oswald Buddenhagen
9308b7d618 don't create bogus property variants
sysroot, spec, and xspec have no /src and /get variants.

Change-Id: I8548791f8ea6ba9fd9f10c35f914ed6badbea9d4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-11-14 12:19:05 +00:00
Oswald Buddenhagen
8db556d299 fix $$section()'s bad argument count error message
the autotest was also broken, because it was created by pasting the
bogus message into the result ...

Change-Id: I02b8663b96c7d96cdb3c19639e2213e49fd2bcec
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-11-14 12:18:56 +00:00
Alexander Volkov
839cae0422 doc: Add missing documentation for QXcbWindowFunctions::setWmWindowRole()
Change-Id: I5a457eb19fee011868cdf6d0534713c760fd57d2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2016-11-12 18:38:20 +00:00
Alexander Volkov
1c08046565 doc: Remove obsolete note for QWidget::paintEvent()
qt_x11_set_global_double_buffer() is dead code since Qt 5.

Change-Id: Ie9a33b6f03dc2e39f12bc790292bb0d227f05c44
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2016-11-12 10:40:42 +00:00
Alexander Volkov
2265fbe7c1 Remove unused variable in QIconLoader::findIconHelper()
Change-Id: Idac0b24631187063445ea5acfd078b2479359d52
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-11-12 10:40:20 +00:00
Maurice Kalinowski
dffde23a0a Fix writing into application directory
Tests are not supposed to write into the build/application directory,
but rather should output to the temp directory.

Change-Id: Idcdf51226a2d547514aea2fbb2054998d8a3437e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-11 15:36:10 +00:00
Lars Knoll
bfaa8925d5 Improve the validation algorithm for binary JSON
Add better boundary checks and catch (hopefully all)
cases where invalid binary JSON could cause crashes.

Change-Id: I206510b7c5e3ba953802a5f46645878e65704ecc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-11-11 12:34:27 +00:00
Laszlo Agocs
3c2cb87de2 xcb: Warn and bail out when even the basic, dummy context fails
Do not move on to glGet since the behavior is undefined.

Task-number: QTBUG-48986
Change-Id: Ifd279635ed1b8441f92697965d15ae3ecb59a7e3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-11-10 12:16:25 +00:00
Laszlo Agocs
e8364f9a4b Enable GL prototypes with recent Khronos headers
Recent Khronos headers decided to break the world by guarding all
function prototypes with GL_GLEXT_PROTOTYPES which has traditionally
been used for extension headers only.

Until this gets corrected - see
https://lists.freedesktop.org/archives/mesa-dev/2016-September/128654.html
- add the define to the config tests and qopengl.h.

While 5.7 already has some of the qopengl.h fixes due to an upgraded
ANGLE shipping with newer headers, this is a cross-platform issue that
will surface everywhere eventually. Therefore we target the full set
of fixes to 5.6.

This time we also make sure the forced define of GL_GLEXT_PROTOTYPES
is removed before including the ext header, thus apps get the ext
protos only if they actually requested them.

Task-number: QTBUG-56764
Change-Id: Ib2c6d2e7b71b8fb8683424f43e6289e64e4ee46c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-11-10 12:16:20 +00:00
Laszlo Agocs
5fcda45872 Do not guard tslib with evdev
That relation is incorrect. We can have tslib support without evdev.

Task-number: QTBUG-54998
Change-Id: I2c09bad73210fa4a13000077480c70365d482e2e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2016-11-10 09:11:21 +00:00
Eskil Abrahamsen Blomfeldt
15414257b3 Don't count no-break spaces as trailing spaces
No-break-spaces should not be counted in the space data, but rather
be treated as any other non-breakable character. We were already
taking care of this in the loop we reach if the item starts with
a character which isn't whitespace, but there is a second loop for
items that begin with whitespace characters.

The result of this was that in certain circumstances where you gave
the nbsp its own format and made the line wrap, the previous line
would count an extra trailing space and it would swallow the first
character in its following line.

[ChangeLog][QtGui][Text] Fixed a bug where a no-break space would
sometimes cause the first character of the containing line to not be
displayed.

Task-number: QTBUG-56714
Change-Id: Idd760a389052e6de70f6cc397122b217987fa5f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-09 16:24:46 +00:00
Edward Welbourne
8ee65cd1f2 Correct a Q_CHECK_PTR()'s parameter
Someone cut-and-pasted but forgot one of the changes.

Change-Id: I647dc8117ebfe8ce3d4b26d468b80c15d4e533e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-09 09:41:15 +00:00
Steve Schilz
a160fd52a1 Documentation: Specify units for QTextDocument::pageSize
Parameter in setPageSize is QSizeF. Without a specified unit it is hard to know
what to use as input.  Units depend upon the underlying paint device

Change-Id: If001b3e9587d6085cc18017680fa20396e936adb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@theqtcompany.com>
Reviewed-by: Steve Schilz <sschilz@pasco.com>
2016-11-09 09:36:25 +00:00
Daniel Vrátil
9de3b15d07 QLabel: take DPR of QMovie in account when calculating sizeHint
QLabel already does that for QPixmap, so just do the same for
QMovie's current pixmap.

Task-number: QTBUG-48157
Change-Id: I7b26460f778e56ff017a5efd433f8929f30e4b41
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-11-09 09:09:26 +00:00
Maurice Kalinowski
c83ba01f7b winrt: remove superfluous code
We do not need to check for an invalid timer id, as this can only happen
if the above check is already true. Hence, this was doing the same check
twice.

Task-number: QTBUG-56756
Change-Id: Icca9b26c32ce88eab76dd02c6c10b24af07bfad7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-09 07:03:31 +00:00
Maurice Kalinowski
0383d0be33 winrt: Do not copy into a reference
The intention has probably been to reset a reference, which is not
required.

Task-number: QTBUG-56756
Change-Id: I1ef44b6c9b8365ac5c8d48234137e518558e9398
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-09 07:03:28 +00:00
Marc Mutz
b559b56463 QFontconfigDatabase: remove 200 unneeded relocations
Same change as in QColor (d38f86e50b).

No text and data reduction numbers (ubsan build).

Change-Id: I7280a511e785c9442a3a6a1ed55e10011ce0a84e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-11-08 19:37:42 +00:00
Marc Mutz
ef36fd0217 QGraphicsSceneBspTreeIndex: fix misleading code in event()
The old code employed a switch statement to filter timer events,
but fell unconditionally through to the default case of calling
QObject::event(). The final return statement following the switch
is thus dead code.

Fix by turning the switch into an if and returning QObject::event()
unconditionally afterwards, which much better describes the intent
of the code, and also fixes the GCC 7 warning about implicit fall-
through in the switch (which wasn't implicit to a human, but GCC's
comment-reading-capabilities are somewhat limited at this point).

Change-Id: I6756a65b3679a446d09fd721dfd0adc24fdf7772
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-11-08 16:33:10 +00:00
Marc Mutz
e25f2392eb QGraphicsWidget: add missing break statement to switch in event()
If the QEvent::GraphicsSceneMousePress case falls through, it does so
because d->hasDecoration() == false or the virtual call to
windowFrameEvent() returned false.

It falls through to the case for QEvent::GraphicsSceneMouseMove, etc,
which ensures d->windowData and then checks hasDecoration() again,
with some other conditions on top, and calls the same virtual
function, windowFrameEvent(), with the same arguments again.

Now, it could, theoretically, be possible that that second call would,
due to the presence of a windowData that wasn't there before, return
true when before it did return false. But the only modification to
*this between the calls to windowFrameEvent() is the potential
allocation of d->windowData, which, if actually effected, will have
d->windowData->grabbedSection == Qt::NoSection, hence
windowFrameEvent() won't even be called a second time

It is therefore safe to assume that a break was intended here, so add
it.

Discovered independently be GCC 7 and Coverity.

Coverity-Id: 11149
Change-Id: Id708a1689ed0f0c914622e388c456ea4576fda02
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-11-08 16:32:42 +00:00
Friedemann Kleint
d7bcdc3a44 QStyleHelper::uniqueName(): Improve palette pixmap cache key
Use QDataStream to obtain cache key for a palettes that are different
from the default QPalette. This results in unique keys for palettes
created from QStyleSheetStyle's render rules.

Task-number: QTBUG-56743
Change-Id: Icbfe165f705ef3e1c9e88cfc9dca88ff1d1e81e6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2016-11-08 14:32:37 +00:00
Morten Johan Sørvig
356f5bbac3 Cocoa: Make child window cursors work correctly
The existing cursor logic had a couple of issues:

- It made the faulty assumption that we could not use
the NSWindow invalidateCursorRectsForView API for
child NSViews.

- It used NSWindow invalidateCursorRectsForView and
NSView resetCursorRects. This API has been replaced
by the more general NSTrackingArea API.

- It did not implement falling back to the parent
window cursor if the current window has no cursor
set.

Document that QWindow cursors work the same way as
QWidget cursors in that a QWindow with no set cursor
will fall back to the parent window cursor.

Change the cocoa platform code to use NSTrackingArea
exclusively and implement NSView cursorUpdate which
sets the cursor. Handle immediate change on QWindow::
setCursor() manually.

Add QWindow::effectiveWindowCursor() and
applyEffectiveWindowCursor() which finds the correct
window cursor.

Add a manual test for the child window, child widget,
and QWidget::createWindowChild cases.

Task-number: QTBUG-33479
Task-number: QTBUG-52023
Change-Id: I0370e11bbadb2da95e8632e61be6228ec2cd5e9d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-08 12:30:45 +00:00