Best way to implement a nested menu?



  • Hello!

    I am just developing an Android application which should run a compass and many more.
    Therefore I want to implement a nested menu.

    It should look something like this:

    @MainMenu
    -> Compass
    -> Settings
    (List of settings, i.e. textfield,...)
    ...
    -> Calibration
    -> Navigation
    -> Settings
    @

    The user should be able to touch the "device-back-button" // back-image on the device to get back to the previous menu item.

    I just started to implement the StateMachineFramework in my application to be able to easily turn on and off my sensors and network connections. I also found this page (http://qt-project.org/wiki/QML-Application-Structuring-Approaches) with kind of loader approach.

    With my current knowledge, I would combine this StateMachineFramework (QHistoryState...) with something else ("something else" currently missing in my head :D) to create such a menu.

    I am not sure that this is the best approach to implement such a menu.

    I hope you could give me some tips.

    Thanks in advance.



  • /push

    ...maybe there is someone who can answer my question now :)



  • /update

    I just used ListModels and a ScrollView+ListView to implement my menu.
    Currently I am using a delegate "menuItemDelegate" and a "editItemDelegate".
    If I use the first one, everytime I click on a ListElement of a ListModel, I read a property "menuModelId" & "menuDelegateId" and then I set the current ListView-model to that new model and delegate. So I am switching trough the menu.
    Second delegate displays the ListElement-properties and give the possibility to open a text editor and change the property values. (After changing, I use the QStorage Class to save the value on harddisk)

    I'm sure that is NOT the best approach, but it works fine for the moment.

    (My menu only needs to be replaced at the same position. If you need a menu like in iOS with the "swipe animation to the left", my approch will not meet your requirements)

    I would be very thankful if someone could post a better approach for this.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.