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>
Until now we applied the geometry in QWidget::setVisible() by
calling QWidget::move() and QWidget::resize(). But these
methods are unreliable when the window is created but not
visible yet. For example, specifying the window position by
"-geometry +0+0" will take no effect.
Apply the geometry directly to QWindow in QWindow::setVisible().
QWidget will update its geometry after the response of the window
system. Besides it allows to specify the geometry for QML
applications.
Task-number: QTBUG-44713
Change-Id: I9a0e110e81e569c81da802729707fec104fef887
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
It may change after the window has been created.
Change-Id: Ib81a7ad7353b1909cc42684fc70d6b7d2556106f
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
This change is related to 6a7ee92b39
which added handling for SelectionClientClose. Further testing showed
that with e.g. Qt 4 applications the SelectionClientClose is not
emitted, but the selection window seems to be destroyed before the
client is destroyed.
Fur a destroyed selection window the same applies: the clipboard
content is no longer valid and we should emit the changed signal.
Change-Id: Id3778a28b9f5601bf2c6e0106981316e0efa6e7c
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
While most (all?) touchpads send WM_MOUSEWHEEL for vertical scroll
the story is quite different for horizontal scroll. Some of them
send WM_HSCROLL instead of WM_MOUSEHWHEEL.
Some of them even send left/right key event but those are lost cases.
Task-number: QTBUG-45120
Change-Id: I3bf86e25a6f4f3ba03ac7e89a23f4b7bc432f2de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
At least the dismissive action should be on the left, but we can take
the OS X rules as reasonable in cases where a lot of buttons are in use.
Task-number: QTBUG-42808
Change-Id: If45f991a068d47009e02d39fbb3886ff4b31c8e1
Reviewed-by: BogDan Vatra <bogdan@kde.org>
The text was accidentally removed in
1afe110b8f.
Fixes qdoc warning:
qtbase/src/corelib/io/qstandardpaths.cpp:60: warning: Undocumented enum item GenericDataLocation in QStandardPaths::StandardLocation
Change-Id: I7f236c01d85ebf76b67ab7af7e61b8cbedee4c36
Reviewed-by: David Faure <david.faure@kdab.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>