Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Hide shorcut text of QMenu Action and more ;)



  • I ve looking for an answer all over the internet but i dont seem to get one...

    i ve tried changing the stylesheet but i think there's no option to do what i want

    in the documentation i ve read that the action has: (icon-text-shorcut text), so what i want is to disable/hide the shorcut text

    basically i want Ctrl+F to disappear from the menuAction for example :/

    The second question is...i want to only show windowTitle and windowIcon
    so far i have this
    @mainWin->setWindowFlags (Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);@

    but the icon doesnt appears..(i dont want the close/help/min/max buttons to appear)

    thanks!



  • For your first question, this can helps:

    (QAction::) void setVisible ( bool )

    yourAction.setVisible (false);

    "This property holds whether the action can be seen (e.g. in menus and toolbars)."

    http://developer.qt.nokia.com/doc/qt-4.8/qaction.html#visible-prop

    Your second question is a hard thing...



  • For your second question:

    No buttons in title bar:
    setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint);

    But this is platform DEpendent! (mac osx...)



  • hi thank`s for your reply, but...

    i want the action to be visible in the menu, i just dont want the Ctrl+F thing to appear, i just need

    [icon][action text]

    for the seccond option, no icon was showed :(





  • 1st.:

    findAction->setShortcut(tr("Ctrl+F"));

    I've seen now the doc about this, but i cannot see any solution :S


    2nd.:

    "platform DEpendent"

    What is your OS?



  • Windows :/

    I ve read the documentation too, but i dont get any solution..i thought maybe with stylesheet of QMenu but i dont know... thanks for trying dude i really appreciate the help


Log in to reply