<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[The new MenuStyle in Qt 5.3 doesn&#x27;t show sub menu indicator Image]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm trying to apply custom style to the "Menu":<a href="http://qt-project.org/doc/qt-5/qml-qtquick-controls-menu.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-5/qml-qtquick-controls-menu.html</a> object, with the new "MenuStyle ":<a href="https://qt-project.org/doc/qt-5/qml-qtquick-controls-styles-menustyle.htmlobject" target="_blank" rel="noopener noreferrer nofollow ugc">https://qt-project.org/doc/qt-5/qml-qtquick-controls-styles-menustyle.htmlobject</a>. The "checkmarkIndicator" shows up (although, the indentation and layout seems incorrect and cannot be modified). But the "submenuIndicator" component doesn't even show up properly; only the top part becomes visible and the rest gets cut off. If I make the font pixels of the Label really large and the make each MenuItem's row height really high, only then the entire "submenuIndicator" Image set comes to view (anchored to the bottom of the row). This was with Qt 5.3 MSVC 2012 OpenGl 32bit, on Windows 7 (haven't had the chance to test it extensively on Linux/Mac yet).</p>
<p dir="auto">I'm pasting the code from my test app here, for reference. Any help would be appreciated. Thanks.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/import">@<bdi>import</bdi></a> QtQuick 2.0<br />
import QtQuick.Controls 1.0<br />
import QtQuick.Controls.Styles 1.2<br />
import QtQml 2.2    // for Instantiator</p>
<p dir="auto">Rectangle {<br />
width: 600<br />
height: 600</p>
<pre><code>Rectangle {
    id: clickableRect
    focus: true

    color: "red"
    width: 300
    height: 300
    anchors.centerIn: parent

    ExclusiveGroup {
        id: myGroup
    }

    Menu {
        id: myMenu

        style: MenuStyle {
            id: myMenuStyle

            frame: Rectangle {
                border.color: "#E7E6E8"
            }

            itemDelegate.background: Rectangle {

                border.color: "#E7E6E8"
                anchors.leftMargin: 15

                color: {
                    if ( styleData.selected) return "lightblue";
                    else return "white";
                }
            }

            itemDelegate.label: Label {

                color: {
                    if (!styleData.selected) return "grey";
                    else return "white";
                }
                text: styleData.text
                font.pixelSize: 25 // If this value is really high (e.g. 70), then the row height of each MenuItem increase AND ONLY THEN, does submenu indicator image show up

                //anchors.leftMargin: 10 // doesn't do anything
            }

            itemDelegate.checkmarkIndicator: Rectangle {
                //CANNOT specify the alignment or layout for this component. But at least it shows up entirely
                color: "blue"
                anchors.rightMargin: 15

                Image {
                    fillMode: Image.Tile
                    source: {
                        if (styleData.checked) {
                            return "menu_selected_checkmark.png";
                        } else {
                            return "";
                        }
                    } // source
                }
            }

            itemDelegate.submenuIndicator: Image {
                // This image doesn't even show up properly. Only the top half of the image shows up. But if the row height of each menu item is increased (by having a LARGE font pixel size), only then it shows properly
                source: "menu_submenu_arrow_icon.png"
                fillMode: Image.Tile
            }

        }

        MenuItem {
            checkable: true
            exclusiveGroup: myGroup
            text: "Item 0"
        }
        MenuItem {
            checkable: true
            exclusiveGroup: myGroup
            text: "Item 0"
        }
        Menu {
            title: "Submenu"
            MenuItem {
                checkable: true
                exclusiveGroup: myGroup
                text: "Sub menu Item 0"
            }

            MenuItem {
                text: "Sub menu Item 1"
                checkable: true
                exclusiveGroup: myGroup
            }
        } // Sub Menu item

    } // Menu

} // Rectangle

MouseArea {
    anchors.fill: parent
    onClicked: {
        //myFocusScope.focus = false;
        clickableRect.focus = false;
        myMenu.popup();
    }
}
</code></pre>
<p dir="auto">}@</p>
]]></description><link>https://forum.qt.io/topic/42663/the-new-menustyle-in-qt-5-3-doesn-t-show-sub-menu-indicator-image</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 11:17:44 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/42663.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Jun 2014 17:20:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to The new MenuStyle in Qt 5.3 doesn&#x27;t show sub menu indicator Image on Thu, 19 Jun 2014 14:31:39 GMT]]></title><description><![CDATA[<p dir="auto">Haven't found any response / solution yet; reported the following bug so that I don't forget later on: <a href="https://bugreports.qt-project.org/browse/QTBUG-39758" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt-project.org/browse/QTBUG-39758</a></p>
]]></description><link>https://forum.qt.io/post/232514</link><guid isPermaLink="true">https://forum.qt.io/post/232514</guid><dc:creator><![CDATA[qt_sur]]></dc:creator><pubDate>Thu, 19 Jun 2014 14:31:39 GMT</pubDate></item></channel></rss>