The QMenuBar class, part of the Qt framework, provides a horizontal menu bar.
Questions tagged [qmenubar]
84 questions
22
votes
6 answers
Setting Mac OSX Application Menu menu bar item to other than "Python" in my python Qt application
I am writing a GUI application using python and Qt. When I launch my application on Mac, the first menu item in the Mac menu bar at the top of the screen is "Python". I would prefer the application name there to be the name of my application. How…

Christopher Bruns
- 9,160
- 7
- 46
- 61
21
votes
4 answers
How to iterate through a menu's actions in Qt?
I'm working in a project where I need to open (show or popup) automatically the items in the QMenuBar.
Let's say I have the next menu bar:
File Edit Help
-op1 -op1 -op1
-op2 -op2 -op2
To set an action (show…

Hermandroid
- 2,120
- 4
- 29
- 35
10
votes
6 answers
MenuBar Not Showing for Simple QMainWindow Code, Qt Creator Mac OS
I have been having problems adding a menu item to the built in menu bar in a Qt desktop application. I copied the code provided in the QMainWindow class reference documentation for creating a menu to a very simple application. Unfortunately, it did…

joshf
- 251
- 1
- 3
- 6
8
votes
4 answers
Qt Stylesheets: How to apply style to menus? How to remove blue tinge around QTextEdit?
I am trying to make the menubar a gradient black colour and that works fine, except for the menu headings.
Here's the stylesheet i'm using:
QString styleSheet = "QMenuBar{background: qlineargradient(x1:0,x2:0,y1:0,y2:1,stop:0 #cccccc, stop:0.4…

W.K.S
- 9,787
- 15
- 75
- 122
7
votes
1 answer
adding submenu in pyqt QWidget
I know its very basic question but I am little bit confused, probably I am forgetting something.
I am trying to add a sub menu "Preview" to the "Tools" in the QMenuBar()
so far this is what I am trying to do
tools =…

Ciasto piekarz
- 7,853
- 18
- 101
- 197
7
votes
2 answers
Stacking QPushButtons on the other side of a QMenuBar
I want to stack some QPushButton objects on the other side of my QMenuBar.
This is how my window looks now:
And this is how I want it to look like (I've photoshopped the image):
I know that in the motif widget style, the help menu is aligned to…

iTayb
- 12,373
- 24
- 81
- 135
6
votes
2 answers
Why does this slot get called twice?
My problem is that when I click on an item in a QMenuBar, the corresponding slot gets called twice. I'm using Qt 4.8.1. I'm not using Qt Designer nor the "auto-connection" feature. Here is my code snippet :
#include
#include…

pintoch
- 2,293
- 1
- 18
- 26
4
votes
5 answers
Qt add menuBar, menus, and sub menus to QMainWindow
I have a hard time adding menu Bar, menus and sub menus to Qt QMainWindow programmatically.
The following code produces an error:
QWidget::setLayout: Attempting to set QLayout "" on QMainWindow "", which already has a layout
Notes :
*.The main…

Joseph Ali
- 345
- 1
- 5
- 11
4
votes
2 answers
Adding and localizing menu items in the main menu of a Qt application menubar
So first of all here is a screenshot of the said menu of Evernote, localized in French:
[]
As you can see, all the menu items in the main menu (by main menu I mean the one whose name is the application name, like here it is Evernote) are localized…

SexyBeast
- 7,913
- 28
- 108
- 196
4
votes
2 answers
Menubar is only shown after app/desktop switch on MacOS using Qt5
Using the following example code the native menu on MacOS 10.9.5 using Qt 5.3.2 does not show up when starting the application. The former menu remains visible but no actions can be performed with this toolbar. If I switch to another application or…

kingofthehill3
- 41
- 3
4
votes
2 answers
How to set buttons in QMenuBar at right corner in Qt5?
I need to add two buttons at right side of QMenuBar (in left usual menu items) and change it icons time by time. Is it possible?

Robotex
- 1,064
- 6
- 17
- 41
4
votes
1 answer
QMenuBar and QMenu doesn't show in Mac OS X
I'm using Qt 4.7.4 on Mac OS X 10.7.4, and I'm trying to add a QMenuBar and a QMenu to my application without success.
When looking for examples, I found the Basic Layouts and the screenshot of the interface on Windows displays the File menu, which…

karlphillip
- 92,053
- 36
- 243
- 426
3
votes
2 answers
pyqt5 default native menu text on MacOS
Is there a way to change default menu title for native menu on MacOS for a simple pyqt5 app?
I'm trying to change "Python" menu entry on above image. Is there a way to rename it? Can I hide it somehow?
This code prints only "File":
menubar =…

gangabass
- 10,607
- 2
- 23
- 35
3
votes
1 answer
How to make a menu bar used in filter in qtablewidget be scrollable in pyqt5?
I am really new to pyqt and this question maybe silly. Any help, I would really appreciate. I have this code I get from this page where it codes in filtering a qtablewidget. This code works perfectly fine to my desired filtering output. However I…

Alvin Lorejas
- 115
- 6
3
votes
1 answer
QWidgetAction : how to make the menu disappear after the user completes his input
In my QMenuBar, I have several menus.
One of those menus has a QWidgetAction in it.
It shows up fine, but the problem is that once the user completes his input, I want the menu to disappear (as is the normal behavior for a classical…

houbysoft
- 32,532
- 24
- 103
- 156