[Interest] qtquickcontrols question

Damian Ivanov damianatorrpm at gmail.com
Thu Nov 7 07:53:03 CET 2013


Thanks Shawn for the clarification.

>That's rather old, about an earlier iteration of the component set that we are shipping with Qt 5.x (x >= 1). > Menu is now multi-purpose and therefore has replaced ContextMenu.
ok. how can I show the menu then :) ?

Window {

    id: window1


    width: 400

    height: 400

    minimumWidth: 400

    minimumHeight: 400

    title: "child window"

    MouseArea {

        anchors.fill: parent

        acceptedButtons: Qt.RightButton

        onPressed: contextMenu.show()

    }

    Menu {

        id: contextMenu

        enabled: true

        title: "blabla"

        MenuItem {

            text: "Copy"

            shortcut: "Ctrl+C"

            onTriggered: copy()

        }

        MenuItem {

            text: "Paste"

            shortcut: "Ctrl+V"

            onTriggered: paste()

        }


   }

}



2013/11/7 Rutledge Shawn <Shawn.Rutledge at digia.com>:
>
> On 6 Nov 2013, at 4:49 PM, Damian Ivanov wrote:
>
>> Hi,
>>
>> I have a question :)
>> http://blog.qt.digia.com/blog/2011/08/26/toplevel-windows-and-menus-with-qt-quick/
>
> That's rather old, about an earlier iteration of the component set that we are shipping with Qt 5.x (x >= 1).  Menu is now multi-purpose and therefore has replaced ContextMenu.
>
> http://qt-project.org/doc/qt-5.1/qtquickcontrols/qml-qtquick-controls1-menu.html
>
>> I'm trying to use a ContextMenu inside a Window { } but it is an
>> unknown type? why? How can I use Menu { } Items inside a Window { } .
>> I would also use ApplicationWindow but I need quite every option
>> Window { } provides (modality, window flags and stuff)
>
> ApplicationWindow is actually a Window with some extra stuff (menubar, toolbar etc.) so all the same properties are still available.
>
> http://qt-project.org/doc/qt-5.1/qtquickcontrols/qml-qtquick-controls1-applicationwindow.html



More information about the Interest mailing list