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>
The flag was introduced in kernel 2.6.22, but we're already depending on
features added on 2.6.23 in qcore_unix_p.h (pipe2, dup3, O_CLOEXEC) and
2.6.27 in qnet_unix_p.h (accept4 and SOCK_CLOEXEC).
Change-Id: Id5480807d25e49e78b79ffff144a093c9e30cd96
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
This is no longer true on at least Cocoa, Windows and xcb.
Change-Id: I214caae46a8707ab7c89138646219140079e919a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Port the last remaining Q_FOREACH user in QtCore to
C++11 range-for and mark QtCore, QtSql and QtDBus as
Q_FOREACH-free, using QT_NO_FOREACH.
Change-Id: Ia6f99139cb1ca4a8bbe9e445421592242e048b0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Port the last four remaining Q_FOREACH users in qmake
and uic to C++11 range-for and mark all qtbase tools
(incl. qmake) as Q_FOREACH-free, using QT_NO_FOREACH.
Change-Id: Ief4e5877269e7a853e4cf05e58861a448e822d3d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
It has been known for a long time that Q_FOREACH produces
inferior code to other looping constructs, and the use of it
in Qt library code was informally frowned upon since forever
(pun intended).
Yet, to this day, several thousand foreach/Q_FOREACH loops
have been added to Qt libraries, and while many were ported
to range-for in Qt 5.7, there are still new ones added every
day, which is a nuisance, to say the least.
This patch introduces a technical way to prevent new foreach
use to creep into Qt libraries after they have been cleaned,
by simply not defining either Q_FOREACH or foreach when the
QT_NO_FOREACH macro is defined. This way, one library at a
time can be ported away, and, once ported, is guaranteed to
actually stay ported.
Change-Id: Ie042e84d6c7d766bd16095f9bc1118a8e0ce0c7a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
Change-Id: I0d6065fbdd19acff14072ff626585e8a12a3e073
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The native display was simply invalid.
Task-number: QTBUG-53225
Change-Id: I682fb1d91dbea3dab971a079060d181fc313da46
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
... or if it is less than ARMv5. The last ARMv4 Qt supported was Windows
CE 7, which was dropped for Qt 5.7 alongside MSVC 2008.
Change-Id: Ifc817705441a4aab9469ffff141dcfe491464efa
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Allows to get rid of some QStringLiterals.
Change-Id: I546aace6876cf373b1cb67269fcc3d042dfd3aac
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Allows to get rid of some QStringLiterals, reducing QtGui
text size by ~200b.
Change-Id: I0f3a84c1c8ee6771d8e1f2c6284d314b3fc0c28a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Allows to get rid of some QStringLiterals, reducing QtCore
text size by ~800b.
Change-Id: I8f7e57927163eaaf628e42020f83f053faea6bf8
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
QXmlStreamReader also has QLatin1String overloads, which
greatly benefits parsers, since the vast majority of keys
in both JSON and XML are US-ASCII. This patch adds such an
overload to the JSON parser.
The value() function is all typical parsers need, so even
though many more QJsonObject functions taking QString could
benefit from the same treatment, value() is the single most
important one for read-only JSON access.
Add some more overloads, too, for functions that don't need
more internal scaffolding than value(). Requires adding a
dummy op[](QL1S) (forwarding to the QString overload) so as
not to make
QJsonObject json;
json[QLatin1String("key")]; // mutable
ambiguous between const op[](QL1S) and mutable op[](QString).
[ChangeLog][QtCore][QJsonObject] Added value(), op[] const,
find(), constFind(), contains() overloads taking QLatin1String.
Change-Id: I00883028956ad949ba5ba2b18dd8a6a25ad5085b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
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>
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>
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>
~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>
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>
MSVC 2013 does not like QStringLiteral between brackets.
Change-Id: Ic42f80b7a3abbb48df3d0e222bd5c868045a0ded
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
a63ca3fa10 caused a build breakage
for WinRT as GetModuleHandleEx does not exist on that platform.
Change-Id: I143d9cad5f32d98a4d86292dfa73f94a4acdf305
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
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>
the "generated by qt creator" header is not supposed to be checked in.
Change-Id: I7626c0bd16f83d81b3facd216a04e7d505942256
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
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>
The test passes on OS X now.
Task-number: QTBUG-8941
Change-Id: I7b57dc30ede7c1ed0bcb8bacb458ea56f222d987
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Sheets are no longer transparent on newer OS X
versions.
Change-Id: Iaaed5aea9c9b130a5d991acd36717b76c3927cfb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
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>
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>
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>
... with known size and known char by corresponding ctor.
Don't use fill() for this case.
Change-Id: I475a0655132ecbb40b1eac919309597b2560e71b
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
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>
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>
from the perspective of freetype, this looks like a system zlib.
Change-Id: Idb961850b2a92d456cfa2b027bdc85ce5e4be771
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
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>
Change 3cdc02d actually "reverted" the behavior of listening for
cursorFlashTimeChanged. The reason is that we sat "blinkingEnabled"
directly to true in the constructor instead of calling
"setCursorBlinking", which was responsible for setting up the
connection.
And as it turns out, after 3cdc02d, nobody is actually calling
"setBlinkingCursorEnabled" anymore. From the widgets
point of view, it should always blink when visible
(unless QPA sets cursorFlashTime to zero). So we can remove the whole
function, and set up the connection in "setVisible" instead.
Change-Id: I577a5fbbbd9c56331ac7f8bb38567a684ca8c1df
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
glGetUniform*v functions are supposed to return just a single
array element, so returning the whole array is always incorrect.
Task-number: QTBUG-53072
Change-Id: I22f05d420082d4d9de06d975b3d0f5e64d3e0c41
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Removed Qt Quick Controls 1 examples from the highlited
list, and also removed the webkit1 and webkit2-related tags.
Change-Id: I674dc00544bc70c50460a64690d1062835885fc0
Reviewed-by: Sami Makkonen <sami.makkonen@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
!isComplex is quite good heuristic, but we know for sure which types
should be included.
Change-Id: I609d021b8a668e6c1945ed2b11d69f5a82b5e2bf
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
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>