Custom Widget with input from ui like menubar

  • hey i am writing a custom widget which is like the menubar and need it to be as accesiible as the native menubar is . how do i take input from ui. is there any example available to make a custom widget from qmenubar

  • please someone help me on this

  • Lifetime Qt Champion


    What do you want to achieve ? Isn't deriving from QMenuBar a solution ?

  • yes i am working with that only but i want it to work like the same way in qtdesigner yoo as it normally does

    like just typing the name and a menu being formed .

    i was thinking of just overriding the method addMenu(Qstring)
    but the problem is how do i relect all this to the ui especially yhe drop down menus will and i want to also add functions other than add separator to the ui interface. i am new to all this so can you please help

    thank you

  • Lifetime Qt Champion

    Do you want to do that from a running application ?

  • no in the designer only like the windows menubar works . the type here function and the add separator function ,plus i want the user to be able to add some more of my custom items , at the ui design stage

  • Lifetime Qt Champion

    What custom items are you thinking of ? A menu bar should only contain menu entries else you start breaking user interface guidelines or maybe aiming at the wrong widget

  • no actually i was wanting to add menu items only but in not the standard pattern but like the megamenu that we see on webpages . i have been able to build a megamanu from code but i have to use it in many applicatioon so i want to transform it into a pludin in designer so that the usage becomes simpler

  • i think the first step will be to replace the default menu by my menu automatically . can you suggest on how to do this . i think this will be neccessary as mainwindow only supports one menubar

Log in to reply

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