The QMenuBar class, part of the Qt framework, provides a horizontal menu bar.
Questions tagged [qmenubar]
84 questions
0
votes
1 answer
Qt: QAction doesn't appear in menu if the constructor string starts with the substring "about"
Are certain strings treated differently by the QAction constructor? This is very strange - if the QString in the constructor begins with "About" that seems to make the QAction invisible in the menu.
This snipped is within a method of a child class…

daj
- 6,962
- 9
- 45
- 79
0
votes
2 answers
QMenuBar only contains inactive menu items on OS X
For some reason all my menu bar items are greyed out when I use the native menu bar on OS X Mavericks:
I create the menu actions using the following code:
newAct = new QAction(tr("&New"),…

André Hoffmann
- 3,505
- 1
- 25
- 39
0
votes
1 answer
Select first QMenu from QMenuBar using ALT key
I'm having the folowing problem: I want the first QMenu from QMenuBar to be selected when I press the ALT key.
I saw that if I create a new project and I create some QMenu objects and add them to the QMenuBar I get the desired behavior, but I'm…

AndreiTuicu
- 11
- 2
0
votes
1 answer
How to catch click on QMenuBar
I want to catch the click on my QMenuBar that is in QMainWindow, so I have subclassed QMenuBar and I have overrided the mousePressEvent function, but now when I click on menu, the submenus doesn't display them.
An idea ?

Marc Lamberti
- 763
- 2
- 9
- 24
0
votes
1 answer
How to implement Menu bar inside QGraphicsView?
I have a QGraphicsView which shows images dynamically. I also used fitInView feature to resize the window. Now I need to add the menu bar at the top of the QGraphicsView. How to implement this? Please help. I am new in Qt

indira
- 6,569
- 18
- 65
- 80
0
votes
1 answer
Close QMenuBar item automatically
I need to know if there is a way to close an opened QMenuBarItem in Qt.
I mean, if I Open a Menu, I want a QTimer to be able to close the QMenuBar after some time.
I am starting a QTimer when I click a menu (like "File"), and in the QTimer's…

Hermandroid
- 2,120
- 4
- 29
- 35
-1
votes
2 answers
How to display icon and text together in PYQT5 menubar
So, i want to display both the text and the ICON as a menubar item.
I have used the below statement as:
self.helpMenu = menubar1.addMenu(QtGui.QIcon("home.png"),"&TEXT")
But this displays only the icon and not the text.
So need help to fix it

Viren mahajan
- 23
- 7
-1
votes
1 answer
Why QFontMetrics return rect with cropped width in Windows 7?
I paint some text in subclassed menubar. And QFontMetrics return rectangle with cropped width. This happens in Windows 7. But it works as I expect in Debian with KDE. Why is it happen and how can I fix it?
class MainMenuBar : public…

Ufx
- 2,595
- 12
- 44
- 83
-1
votes
1 answer
Creating a custon slot for a QMenu
I'm new in Qt World)
I created a new Qt Application in MSVC 2008
Using Qt Creator added controls I need and one of them is QMenuBar
As I understend the equivalent of CallBack(C#) is Slot in Qt.
I culdn't find any information how to create a custom…

Ruslan F.
- 5,498
- 3
- 23
- 42