[Development] Qt Quick Controls: MenuStyle subMenuOverlap

Nurmi J-P jpnurmi at digia.com
Sat Feb 22 19:02:46 CET 2014


On 22 Feb 2014, at 18:47, Fabien Castan <fabcastan at gmail.com> wrote:

> Hi,
> 
> I'm using QtQuick with Qt 5.2 on ubuntu 13.10 and by default there is a problem with menu and submenu.
> There is a little spacing between the menu and the submenu. So when you go from the menu to the submenu, you leave the main menu before entering into the submenu... so the menu is closed!
> 
> The problem comes from the menu style. I don't know why but it uses "QtQuick/Controls/Styles/Base/MenuStyle.qml" and not "Styles/Desktop/MenuStyle.qml".
> 
> If I hack the "Styles/Desktop/MenuStyle.qml" and put "subMenuOverlap: -3" instead of -1. It works fine.
> 
> So I have 3 questions:
> - Is there a known bug about submenu overlap?
> - Why is the "Base" style used instead of the "Desktop"?
> - Is there a way to override the subMenuOverlap from my qml item?

Hi,

QGuiApplication is a likely cause for the Base style getting chosen. The desktop style uses QStyle from the QtWidgets module and thus requires QApplication. What comes to styling menus, MenuStyle has been made public in Qt 5.3.0.

--
J-P Nurmi




More information about the Development mailing list