Commit Graph

27049 Commits

Author SHA1 Message Date
Oswald Buddenhagen
adf85c09b4 Merge 5.6 into 5.6.1
Change-Id: I22003b840f1a7ac685a1ec3353d7e7dbd84c3953
2016-05-12 11:17:23 +02:00
Friedemann Kleint
feaef44559 Windows: Suppress error dialogs when querying logical drives.
Set the error mode flag SEM_NOOPENFILEERRORBOX when calling Win32 API
GetLogicalDrives() to prevent it from prompting to insert media
as does QStorageInfoPrivate::mountedVolumes().

Task-number: QTBUG-18729
Task-number: QTBUG-32457
Change-Id: I5c76afbb5bf2ec5ec84194650c316fe531578d5b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-05-12 06:58:06 +00:00
Alexander Volkov
46f1c4c86b xcb: Properly interpret data.l[0] field of XdndStatus message
The standard https://freedesktop.org/wiki/Specifications/XDND/
states: "In order for the proxy window to behave correctly, the
appropriate field of the client messages, window or data.l[0],
must contain the ID of the window in which the mouse is located,
not the proxy window that is receiving the messages."

So compare it with the current target window instead of the
current proxy window.

Change-Id: Ie31fd3aeadebcf5a9be7b9a9194f35a4ec7bdebb
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-12 05:45:23 +00:00
Mitch Curtis
6bcd27b957 Document how to save an application using QUndoStack
Change-Id: Ic61374d5b6ce395dfe8d0b30813ea437b5e16e9d
Task-number: QTBUG-52497
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-05-11 17:38:23 +00:00
Friedemann Kleint
37a983cd98 Dirview example: Add option for DontUseCustomDirectoryIcons.
This enables people to toy around with the option and check
what impact it has.

Change-Id: I8b49c31211cc48721b3326eea48b4e74967b1a92
Reviewed-by: Sérgio Martins <iamsergio@gmail.com>
2016-05-11 17:29:17 +00:00
Gabriel de Dietrich
36578d41f3 Remove wrong doc note for QPlatformBackingStore::flush()
This is no longer true on at least Cocoa, Windows and xcb.

Change-Id: I214caae46a8707ab7c89138646219140079e919a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-05-11 17:21:18 +00:00
Laszlo Agocs
c46f74d325 eglfs: Support dynamic mouse cursor show/hide with DRM HW cursor
Task-number: QTBUG-52743
Change-Id: I0bea1451dfe7b049c129b11716d593115e3d8374
Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
2016-05-11 12:36:38 +00:00
Oswald Buddenhagen
edc4f02410 make -R and -D not affect qmake
this was meant to be part of d8be8110a, as qmake is obviously also a
bootstrapped tool.

-I/-L/-F/-l/-fw already had no effect on qmake.

Change-Id: I5095742ef5401558cc4432e7a774d0851d417bb0
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-11 11:53:11 +00:00
Eirik Aavitsland
40a9216e06 Avoid asserting when painting certain degenerate bezier paths
It could happen that the stroker would attempt to join empty subpaths,
resulting in an invalid path structure that would cause assert later.

Task-number: QTBUG-43474
Change-Id: Ia369a31e60c40cdae3900d96f15f3e83c9e78b97
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-11 08:32:00 +00:00
Alexander Volkov
acf43c17b6 QFileSystemModel: create nodes with correct QFileInfos
Create parent nodes with the corresponding paths, not with
the absolute path of the child node. Otherwise we will get
incorrect QFileInfo at least in the following case:

    QFileSystemModel model;
    model.setRootPath("/usr/bin");
    QModelIndex idx = model.setRootPath("/usr");
    qDebug() << model.fileInfo(idx).absoluteFilePath();

Without the fix it prints "/usr/bin".

It's a regression triggered by 61cefb2f7a
(De-inline QFileSystemModel::fileInfo() and implement it efficiently).

Change-Id: I3b4e5f5b256711e27ad50824eaa8492dbc096808
Task-number: QTBUG-51586
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-10 20:51:15 +00:00
Timur Pocheptsov
ab3a8443fa QCocoaWindow - do not call resignKeyWindow
QCocoaWindow::setMouseGrabEnabled/setKeyboardGrabEnabled calls
resignKeyWindow. According to Apple's docs, we should _never_ call
this function (it's done by Cocoa automatically).
Calling this function leaves a window in weird state where it can
not become key again until you explicitly make another window key first.

Task-number: QTBUG-53050
Change-Id: I7a887659df8df11880328ffa2adc07c4a3af63e6
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-05-10 19:06:58 +00:00
Gabriel de Dietrich
ce37467acf Acknowledge QWidgetWindow::widget() may be null
We guard QWidgetWindow's widget with a QPointer to avoid
sending it events during destruction (which may result in
undefined behavior, since this originates from ~QObject and
we expect the object to behave as a QWidget). Therefore, we
need to harden all access to that widget since it can now
be null, specially during destruction.

As an example, QGestureManager may crash when we delete a
top-level widget. The crash stack trace is:

1  QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::data() const
2  QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::pointer qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>>(QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>> const&)
3  QWidget::d_func()
4  QGestureManager::filterEvent(QWidget *, QEvent *)  <-- the widget ptr is null
5  QGestureManager::filterEvent(QObject *, QEvent *)
6  QApplication::notify(QObject *, QEvent *)
7  QCoreApplication::notifyInternal2(QObject *, QEvent *)
8  QCoreApplication::sendEvent(QObject *, QEvent *)
9  QWindow::destroy()
10 QWidgetPrivate::deleteTLSysExtra()
11 QWidgetPrivate::deleteExtra()
12 QWidgetPrivate::~QWidgetPrivate()
13 QWidgetPrivate::~QWidgetPrivate()
14 QWidgetPrivate::~QWidgetPrivate()
15 QScopedPointerDeleter<QObjectData>::cleanup(QObjectData *)
16 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer()
17 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer()
18 QObject::~QObject()
19 QWidget::~QWidget()

Task-number: QTBUG-53103
Change-Id: I1bb32648270c4f7791f668b8f0b639ddb4235703
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-05-10 18:32:49 +00:00
Gabriel de Dietrich
6a84a51611 QWidgetWindow: Guard reference to own widget
~QWidgetPrivate() may end up calling QWidgetPrivate::
deleteTLSysExtra() which, in turn, calls QWindow::destroy().
This sends an event to the window itself. This reaches
QWidgetWindow::event() which will forward the event to
the widget. However, the widget has just been deleted
since the sequence was initiated by ~QObject().

Task-number: QTBUG-53103
Change-Id: Ib511714a76bbc1e734d6f2800a983eb1459bbf0b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-05-10 18:32:40 +00:00
Maurice Kalinowski
dbd81a0b9f winrt: Fix potential startup crash
Depending on the windowstate passed to QWinRTWindow constructor we might
act on the uiElement which has not been created yet. This happened
especially in release mode, probably due to timing.

Hence delay uiElement changes until we created it in the constructor and
can ensure it is valid.

Change-Id: I00daa9fcf8542a0535bbcb663a76d85c36e510e2
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-05-10 17:11:03 +00:00
Andy Shaw
5dc421ec87 Restore the missing -P option for lex handling
We don't know why it works, but we've been told that it fixes
some builds and we have no reason to think it will break others.

Task-number: QTBUG-52998
Change-Id: Iacaa1fb3c49e4d7aafd4167e591ff3724489872e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-05-10 13:16:37 +00:00
Oswald Buddenhagen
33c5df2887 decruft project files
the "generated by qt creator" header is not supposed to be checked in.

Change-Id: I7626c0bd16f83d81b3facd216a04e7d505942256
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-10 11:12:04 +00:00
Timur Pocheptsov
4e0b76d810 Cocoa integration - avoid dangling menuitem pointer
Since QCocoaMenu can live longer than its m_attachedItem pointer,
this pointer is becoming invalid after QCocoaMenuItem deleted
(and its 'm_native' was released).

Task-number: QTBUG-53251
Change-Id: I6d97b75b2c09e2443cd21415c5db94206d5d89ce
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-05-10 10:36:30 +00:00
Morten Johan Sørvig
7e539002ee Enable movedAndResizedAttributes test.
The test passes on OS X now.

Task-number: QTBUG-8941
Change-Id: I7b57dc30ede7c1ed0bcb8bacb458ea56f222d987
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-10 10:36:08 +00:00
Morten Johan Sørvig
95b8dfdb6f tst_qwidget: remove sheetOpacity test
Sheets are no longer transparent on newer OS X
versions.

Change-Id: Iaaed5aea9c9b130a5d991acd36717b76c3927cfb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-10 10:26:51 +00:00
Morten Johan Sørvig
7f5e8a5e34 OS X: Remove unified toolbar test.
The Qt 5 unified toolbar implementation does not move
the toolbar to the “non-client” area. This test is
no longer relevant.

Change-Id: Ia32de2260f8ef400a0dc5acf3e5e3ff59083657a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-10 08:15:09 +00:00
Błażej Szczygieł
d6cbf9efb7 xcb: Properly unset mousePressWindow()
In some cases the mouse release event won't arrive, i.e. when window is
minimized on button press. Check for mouse buttons state on mouse move
event and properly unset the mousePressWindow to avoid blocking
enter/leave events in this case.

Amends: c511466d74

Change-Id: I543a75104f528df1bf644bace13f78a6af017455
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-05-09 21:46:29 +00:00
Alberto Mardegan
ab2cf73440 QXcbDrag: forward mouse release event to initiator window
The mouse release event which ends the drag and drop operation must be
forwarded to the window where the drag started, and not to the
QShapedPixmapWindow, which is not supposed to handle input events.

Task-number: QTBUG-52541
Change-Id: I24a7c7b331a06342ac28b420ff9467aa05fe00dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-05-09 20:46:14 +00:00
Thiago Macieira
50723bf3d0 Make sure the QDBusVirtualObject virtuals are called in the right thread
Change-Id: I42e7ef1a481840699a8dffff1409e30f191e822f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-05-09 16:21:50 +00:00
Laszlo Agocs
844ea8beea linuxfb: Support transparency
Always clearing to opaque black makes it impossible to create
semi-transparent overlays with linuxfb. Instead, behave like other
platforms' backingstores: if the target image has an alpha channel,
clear to transparent instead and set the correct composition mode.

Task-number: QTBUG-52475
Change-Id: I2db4588e0112e200a3aa5eed49f806c37d7ca8b5
Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
2016-05-09 15:56:20 +00:00
James McDonnell
1e971f8555 Add FreeType libraries for Windows -system-freetype builds
Add a "CONFIG += qpa/basicunixfontdatase" to the -system-freetype block
so that the FreeType libraries are included in LIBS.

Task-number:  QTBUG-35767
Change-Id: I81e18e72e068d5ac240cba79bab880e50a033860
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-05-09 13:08:31 +00:00
Oswald Buddenhagen
45bec92e7a make qt-freetype use qt-zlib when present
from the perspective of freetype, this looks like a system zlib.

Change-Id: Idb961850b2a92d456cfa2b027bdc85ce5e4be771
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-09 12:52:13 +00:00
Oswald Buddenhagen
8edfc4e9b6 make zlib_dependency auto-add QtCore as a private dep
our zlib header includes qglobal.h, so we need the qtcore include dirs,
and qtcore is also where the actual code is compiled into.

Change-Id: I09f530a1b4e6160438215a6d7223c0771ce94f05
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-09 12:52:08 +00:00
Määttä Antti
ed7845098f Fix threading issue in creating static opengl context
Add mutex lock for static opengl context creation.

Task-number: QTBUG-53202
Change-Id: Iba22339776ec8885efd82b13ae56f6781a426f4b
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-05-09 10:14:40 +00:00
Friedemann Kleint
9f6f06c319 tst_QMdiArea::subWindowActivated2(): Allow for several activated events.
On some X11 window managers, 2 events are received when
hiding/reshowing and activating the window, which became
apparent after 91f536dd71.

Change-Id: I66fdc4f69d87ac898b18d5dfddc957617bb8f916
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-09 08:40:00 +00:00
Friedemann Kleint
c0425f39d1 Windows Accessibility: Use QWindowsAccessibility::windowHelper().
Amends changes ee51638187,
d7a3b61459.

Task-number: QTBUG-52943
Change-Id: Icdf9d99c327bdd38dfb084e6cf77b14cd5ce073b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-05-09 07:52:26 +00:00
Thiago Macieira
0453897f1e QStorageInfo: allow getting the info of pseudo filesystems too
They won't be listed in QStorageInfo::mountedVolumes, but we can now
obtain their info if you know their mountpoint. For example, on Linux:

 $ ./qstorageinfo /dev /proc /sys
 Filesystem (Type)            Size  Available BSize  Label            Mounted on
 devtmpfs (devtmpfs) RW    4029772    4029764  4096                   /dev
 proc (proc)         RW          0          0  4096                   /proc
 sysfs (sysfs)       RW          0          0  4096                   /sys

Change-Id: I3e15a26e0e424169ac2bffff1417ba2429d6d9f4
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 06:04:36 +00:00
Thiago Macieira
4aba3dbcb3 QStorageInfo: get the label properly if the mounted device is a symlink
This happens for me with LVM:

 $ ls -l /dev/mapper/system-root /dev/system/root /dev/disk/by-label/*
 lrwxrwxrwx 1 root root 10 Nov 17 22:45 /dev/disk/by-label/system -> ../../dm-1
 lrwxrwxrwx 1 root root  7 Nov 17 22:45 /dev/mapper/system-root -> ../dm-1
 lrwxrwxrwx 1 root root  7 Nov 17 22:45 /dev/system/root -> ../dm-1

The mounted device according to /etc/mtab (/proc/self/mounts) is
/dev/mapper/system-root.

Change-Id: I3e15a26e0e424169ac2bffff1417b96779d84246
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 06:04:31 +00:00
Thiago Macieira
d9f6b6d1f8 QStorageInfo: update the detection of pseudo filesystems
Allow tmpfs filesystems to be reported, as they're often usable by the
user, mounted in /tmp and in /run (the fs for $XDG_RUNTIME_DIR).

But disallow anything whose device is not a pathname. This catches most
of everything else that wasn't specifically tested for before, like
virtual fuse filesystems, like GVFS.

Change-Id: I3e15a26e0e424169ac2bffff1417b7cee0f8ec97
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 06:04:26 +00:00
Thiago Macieira
b168c6c824 QStorageInfo: fix matching of mountpoints to sibling directories
The path "/usrfoo" starts with "/usr", so if you tried to get
QStorageInfo("/usrfoo") when "/usr" is a mount point, you'd get the
wrong filesystem.

[ChangeLog][QtCore][QStorageInfo] Fixed a bug that caused QStorageInfo
to report information for the wrong filesystem if there is a mounted
filesystem at a path that is a prefix of the requested path (e.g., it
would report "/usr" filesystem for "/usrfoo").

Task-number: QTBUG-49498
Change-Id: I3e15a26e0e424169ac2bffff1417b7a27cd0132d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-05-09 06:04:21 +00:00
Thiago Macieira
fe23db053a Add an autotest for the QtDBus message spy hook
There's exactly one application that needs this functionality (kded/
kiod), but we should test it too.

Change-Id: Icaa7fb2a490246bda156ffff143d210c6f5f207f
Reviewed-by: David Faure <david.faure@kdab.com>
2016-05-09 05:31:11 +00:00
Thiago Macieira
c619fc278d Fix moc warning detected by ICC
moc.cpp(385): error #187: use of "=" where "==" may have been intended

Change-Id: Ibb6ef27030762cbe4f7c7002581a0955f0f9086d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-09 05:30:52 +00:00
Thiago Macieira
29076cf6cb Fix QBasicAtomicPointer::{load,store} to actually be relaxed
We were using direct loading and operator=, which for everything except
std::atomic was very relaxed. But std::atomic<T *> defines the direct
access to actually be the least relaxed possible, under the idea that if
you didn't know any better to use a member function, you probably need
the most protection.

So use Ops::load and Ops::store.

Change-Id: Id5480807d25e49e78b79ffff144a06a2e6398576
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-09 05:30:49 +00:00
Thiago Macieira
ad66dbe305 Disconnect signals from each QObject only once in QDBusConnectionPrivate
Because the moment we disconnect from the object's destroyed() signal,
it may get destroyed in another thread. If the same object appears more
than once in the object tree or in the signal hook table, we could be
accessing a dangling pointer.

Task-number: QTBUG-52988
Change-Id: Ifea6e497f11a461db432ffff14496f0f83889104
Reviewed-by: Weng Xuetian <wengxt@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 05:30:46 +00:00
Thiago Macieira
8de2986a42 tst_QDBusMarshall: make sure we compile on linked, old dbus
If we're linking to libdbus-1, qdbus_symbols_p.h #includes dbus/dbus.h,
which may be old and not #define the Unix FD macros. tst_QDBusMarshall
had the definition for one of the macros but not the other, so add the
missing second one.

Change-Id: Id69569111e7d4e619e22ffff144c35edcd6f348b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-05-09 05:30:43 +00:00
Vyacheslav Grigoryev
558718ff44 QTableView: Fix selection for reordered or hidden rows/columns
The old code sometimes made incorrect selections when rows or columns were
hidden or moved. It used logical top left and bottom right indexes to create a
selection rectangle. However on moved or hidden cells a wrong rectangle was
made. This fix calculates a simple rectangle without hidden cells and makes use
of the row/column select functionality provided by the selection model, to make
the right selection.

[ChangeLog][QtWidgets][QTableView] Fixed a selection bug when rows or columns were hidden (QTBUG-50171)

Task-number: QTBUG-50171
Change-Id: Id186012af26da7b2051ff5eb1c13e6b7494cca77
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2016-05-09 05:14:38 +00:00
Thiago Macieira
194a56ea79 QTest: Fix printing of values of Q_ENUMs
QMetaEnum::key(n) returns the n-th key, which is not necessarily the one
of value n. For the key of value n, we want QMetaEnum::valueToKey(n).

Change-Id: Ic90fe6b1cbe84978a02fffff141bf4a06074917a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-08 08:57:16 +00:00
Jake Petroules
9ba296cc4c Add constants for the CoreText font weights.
Incidentally, this corrects two small errors in the values of the
Medium and Heavy font weights.

Change-Id: I17d4410890f1f3bd1ed72e94f5ca0d43c21484e1
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-05-08 04:28:37 +00:00
Thiago Macieira
e1d0da6526 Fix Clang -Wexpansion-to-defined warning by deprecating QT_SUPPORTS
The C and C++ standards say it's undefined whether the preprocessor
supports macros that expand to defined() will operate as an ifdef.
Clang 3.9 started complaining about that fact.

One solution was to change QT_SUPPORTS to check for zero or one, which
means we need to change the #defines QT_NO_xxx to #define QT_NO_xxx 1.
The C standard says we don't need to #define to 0, as an unknown token
is interpreted as zero. However, that might produce a warning (GCC with
-Wundef), so changing the macro this way is not recommended.

Instead, we deprecate the macro and replace the uses with #ifdef/ndef.

Change-Id: Id75834dab9ed466e94c7ffff1444874d5680b96a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-08 04:25:27 +00:00
Lorn Potter
1c2210b7b1 make sure QNAM reacts to configuration changes
Task-number: QTBUG-49760
Change-Id: Ic52fc9f7999f3dd00ef4022c959361782bd1ccd2
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2016-05-07 17:29:12 +00:00
Friedemann Kleint
2c90973ebf QAccessibleMenuItem: Implement QAccessibleInterface::window().
The window is required to be able to determine the correct
scale factor for the screen when High DPI scaling is active.

Change-Id: I8f776684396d055754093f62e0d33bd7e23cb52b
Task-number: QTBUG-52943
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-05-06 21:25:54 +00:00
Friedemann Kleint
558c5c849c QAccessibleWidget: Retrieve window from native parent widget.
Query the native parent widget if the widget does not have a window handle.
The window is required to be able to determine the correct
scale factor for the screen when High DPI scaling is active.

Change-Id: Ibaf5e8e7b07327ea635d2f726acea76c2c95bda3
Task-number: QTBUG-52943
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-05-06 21:25:47 +00:00
Friedemann Kleint
ee51638187 Windows Accessibility: Recurse up to find a window.
Not all classes inheriting QAccessibleInterface implement
QAccessibleInterface::window(), so, go up the hierarchy to find
one that does.
The window is required to be able to determine the correct
scale factor for the screen when High DPI scaling is active.
Fixes multimonitor issues for QtWidgets.

Amends change d7a3b61459.

Task-number: QTBUG-52943
Change-Id: I81733765faee4d296bd6ea046bc2cecb018eb28d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-05-06 21:25:38 +00:00
Gabriel de Dietrich
6eb27afcdf Cocoa: Add QCocoaWindowPointer
This patch extends 5b54c352ed
by abstracting the watcher pattern. The class is specialized
for QCocoaWindow since it's aware of the QObject sentinel there.

We update the usage in QNSWindowHelper and extend it to the
forward window (this one is used for mouse coordinate conversion
when docking windows).

Change-Id: I628415527593daec835bbad1b6e83d13fe7b6703
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-06 21:25:28 +00:00
Gabriel de Dietrich
e6c0373421 Cocoa: Clear the backing store pointer when changing window
If the geometry is being changed at some point while showing
the widget after reparenting, we set the Cocoa frame on the
QNSView. This results in Cocoa invalidating the view and
calling drawRect: before we get a chance to flush the backing
store.

This may be an issue if the previous parent toplevel window
has been deleted. In that case, the backing store pointer is
a dangling one, resulting in a crash.

Change-Id: I18b5dd7794a3bde8815daf3f84e4113a37aaea90
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-06 21:25:17 +00:00
Gabriel de Dietrich
939b7bfe66 QCocoaMenuBar: set the native item's title
Or, "Give Cocoa a Chance to do its Magic"

Some menubar items, like the "Edit" menu, get extra items added
at some point by Cocoa. Evidence points out to those extra items
being added right after the NSMenu holding the menubar is set as
the current menubar. At that point, both the child NSMenu and its
NSMenuItem (the entry in the menubar) must have their title set.

Therefore, we must set the menubar native item's title before
QCocoaMenuBar::updateMenuBarImmediately() sets the main menu.

Task-number: QTBUG-53085
Change-Id: Idd775cf0e3485739f38363a84cfed8d2db9cb662
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Marko Kangas <marko.kangas@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-06 19:45:59 +00:00