Introduce utility function to check using
QWindowsXPStylePrivate::isLineEditBaseColorSet().
Task-number: QTBUG-40634
Change-Id: Iaa6962a17217352aa59d0c54421b764ad47d3bf8
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Introduce QWindowsXPStylePrivate::isLineEditBaseColorSet() checking
whether the base color has been set in the widget's palette taking
into account the QSpinBox special case and simplify the code
accordingly.
Task-number: QTBUG-40634
Change-Id: I0e7527031b333d71727fbd30db6dd80aa715c9ab
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Labels would use a statically defined font for <pre> blocks.
Use the one defined by the QPlatformTheme instead, through
QFontDatabase::systemFont(FixedFont)
Task-number: QTBUG-50564
Change-Id: I5491bd0defce651bdf809bcbc6a529a900f4959b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
We would ignore the vertical hinting when calculating the
bounding box, giving an off-by-one error in the base line of
some characters when rendering with PreferVerticalHinting,
which is the default when doing High-DPI on Windows.
Task-number: QTBUG-50940
Change-Id: I2846765ec044eaf317026ee8c7bb9588257bf05c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
Introduce a special scaling function fromNativeLocalExposedRegion()
for exposed regions that uses the floor of the top left point
and the ceiling of the bottom right point similarly to how it
was done in the XCB plugin in 5.5.
Task-number: QTBUG-46615
Task-number: QTBUG-50463
Change-Id: I95e4a571b814357c014605ed79e374a821fa155b
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
The layout and phrasing of these two QFileSystemEntry methods was such
as to obscure what they actually test. (Overlong lines, extraneous
parentheses, spurious conditions and poor line-breaking.) Rewrote to
make both clearer; and, in particular, to make it obvious that they
are *not* mutually complementary. Behavior is not changed.
Change-Id: If748e48d41fe3a76bab3a1f840c7b7ca62442f8f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Move code from QWidget::setMask() and reimplement QWidget::setMask()
using QWindow::setMask().
Task-number: QTBUG-50938
Change-Id: I040688d6b18df91368fa6ab6392a3b4cd80f2683
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
It does not work as expected since the QLineEdits do not expand.
Amends b880b7e1ac.
Change-Id: I0b3b3822cca7fc6442a7155eecd46bd3d134d069
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
In the gray antialiasing code path for text on Windows, we
check whether Cleartype is enabled in the system and,
if it is, we forcibly enable gray antialiasing instead. But in
this logic we did not consider the case where antialiasing
is turned off entirely, i.e. when the style strategy is
QFont::NoAntialias. We should never override
no-antialias with antialias.
[ChangeLog][Windows][Text] Made it possible to disable
antialiasing for text when drawing into images.
Task-number: QTBUG-47141
Change-Id: Ieb2beba8c2d02295abe6d9a98d2e63a2d39c9e6a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
If a menu is added to the tray icon after the icon itself has been registered,
we need to register the menu properly.
Change-Id: I19a6d78848142d66c2cd882746d8d55c0b9a2818
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
This method can be called for a submenu after it's called for the top-level
menu, and we should not replace it with a submenu.
Change-Id: I8e180ee074287cfcdc76dfe77c6c7aa7d5891741
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Transfer propertiesUpdated and updated signals from submenus to parent
menus. Without this, the adaptor only receives this signal from top-level
menu items, and doesn't receive it from items of submenus. Connect to
these signals when a menu item is added or synced, and disconnect when it
is removed.
* Make QDBusPlatformMenus use IDs of items containing them, not their own
IDs (own IDs do not make any sense since they are not exported over D-Bus).
* Store toplevel menus per-adaptor, to make it possible to export multiple
menus (for example a menubar and a tray icon menu).
* Adjust the QDBusMenuLayoutItem::populate methods to always get the menu
via its containing item and to populate the menus recursively.
* Map D-Bus menu AboutToShow method to platform menu aboutToShow method,
and map hovered and closed events to hovered and aboutToHide signals.
(QTBUG-46293)
* Always set the visible property on item. Otherwise, when an item becomes
visible, the D-Bus menu still thinks it's invisible because that property
was not changed back to true. (QTBUG-48647)
* Call emitUpdated from insertMenuItem and removeMenuItem methods, as they
really update layout. Do not call it from syncMenuItem, it changes only
properties but not the layout.
* Start revision numbering with 1, because libdbusmenu-based hosts ignore
updated signal with revision=1.
Task-number: QTBUG-46293
Task-number: QTBUG-48647
Change-Id: Icf713405db0443e25462c1a19046df7689fe5e78
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
It's used as a global static but according to library policy it's required
to have a trivial dtor and a trivial or constexpr ctor, otherwise it
runs code at library load/unload.
Change-Id: I1fcea3ce388b2a198e3851e6d0aeb91ae0a8e4b1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Consider a window which was hidden and shown with hide() and show()
methods and mouse pointer was in window when hide() was called.
At first, window got focusOutEvent and then Qt library sends X server
a message to unmap the window.
Then X server will send client two messages:
1) FocusOut(10) detail=Nonlinear(0x03)
2) FocusIn(9) detail=Pointer(0x05)
QXcbWindow has a logic for not seting active window to 0 if there is
a FocusIn coming (see QXcbWindow::doFocusOut).
So QGuiApplicationPrivate::focus_window still points to the current
window.
Then when show() is called, qt compares previous focus with new focus
and, since they are equal, doesn't do anything. Event focusInEvent
isn't delivered to the window.
Here are two links why X server sends FocusIn just after FocusOut:
http://lists.freedesktop.org/archives/xorg/2008-December/041684.htmlhttps://tronche.com/gui/x/xlib/events/input-focus/normal-and-grabbed.html
Proposed fix ignores FocusIn events with detail==Pointer.
The text of explaining comment is taken from the Chromium project:
https://chromium.googlesource.com/chromium/src/+/master/ui/views/widget/desktop_aura/x11_desktop_handler.cc
from X11DesktopHandler::ProcessXEvent function.
[ChangeLog][module][Linux/XCB] Fix not delivering focusIn event on
hide/show with XCB
Task-number: QTBUG-49071
Change-Id: I433c8b638834c25f113cc134ee4185778c44f540
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
This patch fixes cursor shape when mouse leaves the window and enters
the window again with pressed mouse button - ignore the mouse enter
and leave event when any of mouse buttons is pressed.
Task-number: QTBUG-46576
Change-Id: Id6ce50cd0d66da51a251d4811bc42cd31606de29
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Added enter/leave event handling in XInput2 to avoid problems with
those events when the mouse is grabbed.
This commit amends: 53d289ec4c
This commit amends: ed2e157803
Task-number: QTBUG-50340
Change-Id: I7a120b46daa4f8fa4c218346273ae90b6abfa156
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
-ldl option was used unconditionally while libdl is not supported
when libc is static.
Add build test to configure which checks if libdl is supported.
QMAKE_LIBS_DYNLOAD in "src/corelib/plugin/plugin.pri" is now used only
if libdl is available.
qt_linux_find_symbol_sys from qlibrary_unix is now used only if
QT_NO_DYNAMIC_LIBRARY is not defined.
Initially reported by Buildroot autobuilder here:
http://autobuild.buildroot.net/results/a85/a85a1839a45fb6102e53131ecc8f6dadf92bcdc2
Change-Id: I0397472456efdc4f3ab5f24d01253bee8048a9d1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
In a case of having a non English system locale, then the face and name of
the font may be localized but will not match up what is in the registry.
Therefore we need to try with the English name if is possible that there
is one, so in the case of when registerAlias is false we should try to get
the English name if necessary.
Change-Id: Id1064b6f5263677320374dbddfad852f30f041c5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Otherwise platform backingstores providing QImages with extra pixels
would break horribly. The only such platform is wayland for now.
Previously the need to support this case was masked by the RGBA8888
image conversion that happened always with wayland due to its ARGB32_Pre
format. With the recent improvements this is not done anymore and so
the problems became apparent.
Task-number: QTBUG-50894
Change-Id: I27d7a1c8e25d152ca1227af1e2c38f7d4b6acbab
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
This fixes the crash introduced by
75b705fec8. The drag only needs to be ended
on the hide if it is actually in the middle of dragging. This enables the
case of dragging the dock widget out with the mouse to continue to work.
Task-number: QTBUG-50890
Change-Id: I72309dd40ee670319f2ff607ae201c46f8de4652
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Also use the target window ("win") as context instead
of d->window.
Change-Id: I5b0fa3bb857526e4a4bc9c5e44670593da1dfe7c
Task-number: QTBUG-50487
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
A malformed bmp file header could specify a negative color table
size. The bmp handler would then return a QImage that claimed to be
valid, but actually was invalid, having an empty color table. This
would cause crash later, e.g. when attempting to paint it.
Change-Id: I7df7c40867557a82dbcee44c7de061226ff232c0
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
interface is a define under wince. This define is included even
with standard header includes already. It needs to be undefined
for using it.
Task-number: QTBUG-50853
Change-Id: Ie44681f03709848e9747a8aec11835c8d62aa409
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The depth cannot change. This means that RGB16 cannot be upgraded
to 8565 for example as that would be a 24 bit format whereas the
backingstores and the underlying platform may expect a 16 bit
format.
Task-number: QTBUG-50869
Change-Id: I648b39287d43a80fae8097a33bbf3b8bbdcb8816
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
The patch causes the window creation on reshowing nested QWidget
with native windows to create child windows with 0-parent handles,
which can have adverse effects on the various platforms.
The patch might be re-applied on top of
73c86fcb40.
This reverts commit 470c8b68df.
Task-number: QTBUG-43344
Task-number: QTBUG-50854
Change-Id: I2ad837c3800fc71cccf04d455d1b9c3600b233e7
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Set the right sub role (NSAccessibilitySecureTextFieldSubrole) and
return the bullet point character for the text contents. This alignes
the behavior with native widgets.
Change-Id: I7305e08dca61097dd8c050aed64c792c06de0a4d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
accessible\iaccessible2.cpp(1708,40) : warning: comparison of two values with different enumeration types ('IA2Role' and 'QAccessible::Role') [-Wenum-compare]
Q_STATIC_ASSERT(IA2_ROLE_COLOR_CHOOSER == QAccessible::ColorChooser);
Task-number: QTBUG-50804
Change-Id: I25a1f00fdbd687ff23f875542a6aa0cc0cab3d23
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
The enum needed a name to make that possible, of course.
The one overt int return -1 needed to be made explicitly Neither, too.
Change-Id: I3930bf03a7ee5e1619a1c74f9ca54faf6a6c5b2f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
If argumentTypes is NULL then it is indeed not equal to the address of
a local static variable, so there is no need to follow the NULL-check
with a check that it's not equal to that non-NULL address.
Change-Id: I62362db747c0620b2195f7997368f026f535d57c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
When the window flags are changed for the widget then it is possible to
minimize the dockwidget via the titlebar. This will cause it to be ready
to start a drag internally but since the dockwidget never gets a mouse
release event it doesn't end it. Therefore it ends up being in an invalid
state later on when restored, so the endDrag() needs to happen in the hide
event to ensure this is not an issue later on.
Change-Id: Ia84bee96b9eed49896869e6a15d4de6d01964264
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Normally setting the mode again and again on each application startup
is not desirable as it takes time and considerably affects the application
startup experience.
However, in some cases (like shutting down the X server) the output
gets powered down and there seems to be no way to detect this. Here
setting the mode again becomes necessary. Until there is a better
solution, add an environment variable QT_QPA_EGLFS_ALWAYS_SET_MODE
which, upon a non-zero value, leads to always calling drmModeSetCrtc.
The issue is not specific to Qt, the same is visible with the NV examples
as they try to minimize redundant mode set calls in the same manner.
Change-Id: If2b5e3fda74e077a747dd03cee65c936560a5026
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Similar to the existing methods for QDBusPlatformMenuItem. These methods
will be needed for implementing the D-Bus platform menu bar.
Change-Id: Iae3a5892b71fa9a7c72c323ee4b3ab2afd7d4d76
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Add support for ABS_MT_ORIENTATION value. Linux kernel multi-touch
protocol allows it to be in a wide range:
https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt,
but we need only to know whether the touch point rect is rotated
by 90 degress. So adjust the angle to the closest axis.
Change-Id: Ie20725dc4bef509e2f9b19571efc69502d00c019
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
It's only supposed to be included by clients of the library, and
confuses qmake's dependency resolution into thinking the header-only
features such as qtestkeyboard.h and qtestmouse.h are dependencies
of this source file.
Change-Id: I5fe73b752c1c491ee0088bced77f997696d96c62
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>