If the menu items change while a menu is showing, the current
implementation would crash. The current code tried to take this
scenario into account by using a copy of the item list inside
the native menus, but failed since the list contained pointers
to menu items. And those items would be deleted in a higher layer
when removed from the owning QMenu, even if the native menu was
visible.
One could argue that the list of items should not change while
the menu is visible, but from testing, other platforms handle
this scenario gracefully. So this patch will ensure we do the
same on iOS.
Task-number: QTBUG-44275
Change-Id: I5508e1d6d47039a9aa948c246b33479bd6801868
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Concept of 'current position' exists only for random-access devices.
As documented, for sequential devices QIODevice::pos() must always
return 0. Prevent a modification of the internal 'pos' member in
QIODevice::readAll() method to follow this rule.
Change-Id: Ida2ee6a629ccfc3068d62f95ab1064ada13fdda5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
New SSL backend fails to read data most of the time.
This patch:
1. Removes direct call to _q_SSLRead - it was never executed (intentionally)
and is completely horrible and redundant.
2. Changes the reading loop - read not while we have bytesAvailable, but
until we have errSSLWouldBlock.
Change-Id: I3fc5ff94ded76fcc1748d4979f7af85740b4b6aa
Task-number: QTBUG-45290
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org>
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Use miniaturize instead of performMiniaturize when the window has no
minimize button (even if frameless).
Make sure the window is resizable before performing zoom. Even restore
this, of course.
Change-Id: I43217153b4d4fcec0ded4afcde3009817e01feba
Task-number: QTBUG-32184 QTBUG-45339
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
This reverts commit d024f0a922.
Qt::FramelessWindowHint actually DO require 'non-resizable' window.
Let's assume, non-resizable means 'resize by mouse dragging'.
There is a better fix that will follow this patch (temporary
setting/resetting resizable mask).
Change-Id: I61cefcade437d3e54719e2e1ff0e8d070c577df0
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
glibc 2.9 is required for pipe2 and version 2.7 for eventfd.
Bionic added them to Android version 2.3.1, but I can't find a version
macro.
uclibc masquerades as glibc version 2.2, so this function won't be
thread-safe with uclibc.
Change-Id: Iee8cbc07c4434ce9b560ffff13cd3c3b63dd7e83
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This will cause FormatMessage() to return messages with placeholders
as well even though we do not pass the message parameters (for
example: "The operating system cannot run %1." for ERROR_INVALID_ORDINAL).
Task-number: QTBUG-43164
Change-Id: Ib95c1c0fabb543bbe4e8ab2bd8f244f73dff5fa4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
C++03 forbid the use of local or unnamed type as template parameter.
But in C++11 that is allowed, and clang accept them even in C++03
mode, but with a warning.
The Warning happen for example with this code:
enum { Foo = 3 };
int x = 3 << Foo;
Then the compiler issues warnings:
metatype.h:1379:31: warning: template argument uses local type [-Wlocal-type-template-args]
enum { Value = sizeof(qt_getEnumMetaObject(declval())) == sizeof(QMetaObject*) };
^~~~~~~~~~~~~~~~~~~~
qdebug.h:269:42: note: in instantiation of template class 'QtPrivate::IsQEnumHelper<(anonymous enum)>' requested here
typename QtPrivate::QEnableIf<QtPrivate::IsQEnumHelper<T>::Value, QDebug>::Type operator<<(QDebug dbg, T value)
Normaly the compiler should not even try to instantiate the operator<<
with such types in C++03 mode.
Change-Id: I48c7d5d1836fd87986835fe15c7e0b1beb73c728
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This cpp file did not include its header.
Change-Id: Ib68f4a1470c1dc213add5e8825ef972c07ee57df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of making insignificant the all platform for
QtBase 5.5 integration.
Change-Id: Ief3f29c094bdbc90e684f19c1077ee595fb7d581
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
- Use QDebugStateSaver to restore space setting in stream operators
instead of returning dbg.space() which breaks formatting on streams
that already have nospace() set.
- Fix some single character string constants.
Change-Id: I0fe86bb1adbdd4a76ab6d2f8c19e063b45ddcf3b
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
The variables used for release with debuginfo was set in g++-base.conf
which is not included by clang builds.
Change-Id: Iec3b23c371c113ff934d2c7f5134ef78b1cf939e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Introduce QDebugStateSaver, use new formatting helpers and
output parent, flags and z only when necessary. Output the
widget contained in QGraphicsProxyWidget.
For example,
QGraphicsProxyWidget (this = 0x1877550 , parent = 0x0 , pos = QPointF(870,491) , z = 1e+30 , flags = ( ItemIsFocusable | ItemUsesExtendedStyleOpton | ItemSendsGeometryChanges | ItemIsPanel ) )
becomes:
QGraphicsProxyWidget(0x1877550, widget=ItemDialog(0x1e29dc0), pos=870,491, z=1e+30, flags=(ItemIsFocusable|ItemUsesExtendedStyleOption|ItemSendsGeometryChanges|ItemIsPanel))
Change-Id: Ia554dc3e2eb6f16d9d9220d1067194a4424b7cf5
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Prevent compilers from calculating strlen at compile time
by using a volatile pointer. This corrupted paths if the
installation path is patched for the binary SDK installer.
Task-number: QTBUG-45307
Change-Id: I624b0409e8b27299475a88eb1cbf03ffef9589c6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Clang likes to complain when override is not used consistently.
Change-Id: I0fad18a7c3eb068aa1b6786243969aef53d1f42c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Use QDebugStateSaver to store the formatting state and fix the return
statement to return the unmodified stream.
Change-Id: I476d13c5487a89f263dcc11334fc67c85d9433f5
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Extract helpers to be able to format classes without type names
and use those for formatting QEvents to reduce clutter.
For example:
QWidgetWindow/"MainWindowClassWindow" QMouseEvent(QEvent::Type(MouseMove), buttons=QFlags<Qt::MouseButtons>(LeftButton), localPos=QPointF(50,116), screenPos=QPointF(948,652))
QWidget/"qt_scrollarea_viewport" QMouseEvent(QEvent::Type(MouseMove), buttons=QFlags<Qt::MouseButtons>(LeftButton), localPos=QPointF(45,32), screenPos=QPointF(948,652))
becomes
QWidgetWindow/"MainWindowClassWindow" QMouseEvent(MouseMove, LeftButton, localPos=50,116, screenPos=948,652)
QWidget/"qt_scrollarea_viewport" QMouseEvent(MouseMove, LeftButton, localPos=45,32, screenPos=948,652)
Change-Id: Ie5441d922962a05caed6b7079a74ea8a2b8a64fb
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Constructing the QProxyStle object with a null QStyle
pointer causes the QProxyStyle to use the default native
style.
Change-Id: If624ed7a805aef839ca8a51242d12b2f6d777e83
Task-number: QTBUG-42231
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
This is just so the Q_COMPILER_xxx macros get defined properly.
Change-Id: Iee8cbc07c4434ce9b560ffff13d066aa0a8671cc
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Move to qdbusutil_p.h the string constants that are used often and in
multiple places; use QStringLiteral in qdbusintegrator.cpp for the
strings that are used often.
Change-Id: I8e1325b9ba015bda91bf01c42175d8032ea32f62
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
The ActivationReason provides the type of click. If the icon has a
D-Bus menu, then QStatusNotifierItemAdaptor::ContextMenu will not be
called: the tray is responsible for opening the context menu. But
an application can alternatively do something different with a
right-click by not providing a menu, and instead handling the
QSystemTrayIcon::activated signal with the Context reason.
Simplified the code by emitting the signal directly in
QStatusNotifierItemAdaptor.
Task-number: QTBUG-44929
Change-Id: Ia062a9a2fd99554418d58a1ff6ecd4e862035198
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
This was incomplete functionality in
38abd65377
Task-number: QTBUG-44929
Change-Id: I7120a3de011c5df57ef5a9fbdfe056eee42d572b
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
It was printing the following error:
arguments to dbus_validate_bus_name() were incorrect, assertion "name !=
NULL" failed in file dbus-syntax.c line 248.
This is normally a bug in some application using the D-Bus library.
Change-Id: Iee8cbc07c4434ce9b560ffff13d0586189ba3a79
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
In this case GetLayout will be called with the D-Bus menu ID of the
menu item which contains the submenu.
Task-number: QTBUG-45191
Change-Id: Ia8108272910eac10f040db5865ec4e070da80edb
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
User code should build with -Werror=zero-as-null-pointer-constant
Task-number: QTBUG-45291
Change-Id: Iee8cbc07c4434ce9b560ffff13d0031979b4c2fe
Reviewed-by: Matthew Woehlke <mw_triad@users.sourceforge.net>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
QOpenGLContext::defaultFramebufferObject() knows nothing about QOpenGLWidget
and QQuickWidget. The problem is that this function (and others that rely on it)
is expected to give the widget's backing FBO in paintGL() and friends.
To overcome this, we have to provide a way for such widgets that indicate what is
the expected "default fbo".
Task-number: QTBUG-43269
Change-Id: I43f439f8609382b9f7004707ab0ef9f091952b4f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Many people complain about this unexpected behavior. We
may consider introducing a style hint later for those
few people that may want it.
Change-Id: Ifab663b4b5c3a78a3544ab4408cf34f672df8c05
Task-number: QTBUG-8428
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Allows catching exceptions without quitting the application.
The behavior change should be unnoticeable since we can't
activate the menu item from within the Qt application.
Tested that the keyboard modifiers are still set when we get
to the action signal handler.
Change-Id: I43d0c377834450344bd3a3678e07b6631ba0b768
Task-number: QTBUG-15197
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Applications built using the regular makefile generator also need to
link to XCTest, as the library is referenced from qxctestlogger.mm
Change-Id: Iedbb5c6a2811fd904d75abc20f4e39440e44e748
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Previously we would take ownership of all threads when attempting to
attach it to the VM, regardless if it was already attached or not, to
avoid expensive re-attachments in our own code. The downside of this
approach is that we might hijack threads the user wants to control
themselves, and the later detach the thread while it still in use, e.g.,
after the QApplication instance is destroyed.
This change does not add any infrastructure to enable more advanced
management of attached threads, so threads might still be hijacked if
the user make a call directly or indirectly through the QJNI API's on
a thread that's not attached.
Task-number: QTBUG-45110
Change-Id: I30f7faa2d8c2c35151e2ac8875ebf839bcd6c7c6
Reviewed-by: Sergey Galin <s.galin@2gis.ru>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Input method events contain attributes, etc. and cannot
be compressed.
Change-Id: Ib9a2a80f1efec53f9d843684f8227e1f2e245853
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
They are apparently a relic of some old bitmap header that
did not contain them (superseded by BITMAPV5HEADER).
Task-number: QTBUG-45265
Change-Id: I993dda7d409f7963c9fabd42b0fac5f5586c6248
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Returning dbg.space() breaks formatting on streams that already
have nospace() set.
Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e
Reviewed-by: David Faure <david.faure@kdab.com>
before fallingback to uploading a bitmap cursor
Task-number: QTBUG-30016
Change-Id: I53eeda6bb5f6cab66e3bc10a2e5382ce55cc1bab
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>