January 16, 2012

KillGabio KillGabio
Lab Rat
41 posts

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

  1. 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!

6 replies

January 16, 2012

broadpeak broadpeak
Hobby Entomologist
360 posts

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…

January 16, 2012

broadpeak broadpeak
Hobby Entomologist
360 posts

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…)

January 16, 2012

KillGabio KillGabio
Lab Rat
41 posts

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 :(

January 16, 2012

KillGabio KillGabio
Lab Rat
41 posts

example: ctrl+f OUT!

January 16, 2012

broadpeak broadpeak
Hobby Entomologist
360 posts

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?

January 16, 2012

KillGabio KillGabio
Lab Rat
41 posts

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

 
  ‹‹ How to extract a resource from qrc (Solved)      Is there notification when event loop starts? ››

You must log in to post a reply. Not a member yet? Register here!