The QMenu class, part of the Qt framwork, provides a menu widget for use in menu bars, context menus, and other popup menus.
Questions tagged [qmenu]
252 questions
0
votes
1 answer
Is it possible to respond to a click on a tiop level menu item?
Is it possible to respond to a click on a top level menu item? For example, referring to the image below, is it possible to run code when the "Help" menu item is clicked?
If so, how do I do that?
Thank you.

Michael Vincent
- 1,620
- 1
- 20
- 46
0
votes
1 answer
Python and Qt : Retrieving branch names in multi-leveled QMenu
Having trouble finalizing a dynamic QMenu tree.
The structure and format is perfect, but what remains missing is the return of all branch names when triggering the end-action.
The only implement I have tried with ANY trend toward a solution is the…

Katalpa
- 159
- 2
- 9
0
votes
1 answer
Having a QToolButton w/ Menu being checked if any of the checkable QActions within that menu is checked
Say I have a QToolButton with a delayed action showing a menu. Said menu contains a number of checkable actions. In this particular case it's a button activating a zooming tool, and there are 3 zooming modi QActions available, organized in a…

datenwolf
- 159,371
- 13
- 185
- 298
0
votes
1 answer
QPushButton with menu - drop from right side
I have a long QPushButton (well, a subclass of one) with a menu attached. The drop-down menu indicator is on the right side of the button, but when pressed the menu drops down from the bottom-left corner. This seems to me like it will be clunky and…

Nicolas Holthaus
- 7,763
- 4
- 42
- 97
0
votes
1 answer
Updating the contents in QMenu 'live'
I have a UI in which it consists of a few QPushButton and a QLineEdit and currently I am having trouble to 'update' the contents within this QMenu that was attached onto a QPushButton.
So assumingly, if there are already 2 cameras in my scene, and…

dissidia
- 1,531
- 3
- 23
- 53
0
votes
1 answer
How can I make a QMenuBar item appear over its QMenu
First of all, I'm fairly new with Qt and Qt Creator so go easy if this is a stupid question.
I was practicing using Qt Creator, playing around with css styles. In particular, I'm trying to get the menubar and its menus to look something like this…

YmFzZTY0
- 109
- 1
- 9
0
votes
2 answers
Grabbing text from qMenu selection
I am trying to get the selection that was listed in the qMenu and based on the user selection from the qMenu - camSelBtn, it will display the selection into a qLineEdit - currentCamTxt
However while I am able to get the menu working, the selection…

dissidia
- 1,531
- 3
- 23
- 53
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
1 answer
Invoke QContextMenuEvent programmatically to show a QMenu
I want to pop up a not collapsed QMenu on a QWidget without user interaction. At the moment, I get the QMenu on the otherwise empty QWidget after a right click. Is there any way to invoke a contextMenuEvent(QContextMenuEvent *event) signal…

Natalie
- 445
- 2
- 5
- 18
0
votes
1 answer
Making menu of QToolButton pop on the left instead of bottom ? Is it possible?
Is it possible to have the QMenu popup on the left of QToolButton instead of the bottom.
I am currently doing something like this
QMenu *menu_contacts = new QMenu("Contacts",this);
menu_contacts->setStyleSheet(menu_sheet.c_str());
QAction…

MistyD
- 16,373
- 40
- 138
- 240
0
votes
1 answer
How to use QSignalMapper for a list of QAction items
I am developing a code snippet to perform similar, not identical actions when I click on the sub menu item list. Please check the attached snapshot. QSignalMapper is the best solution to connect multiple signals to the same slot.
But I am not able…

cappy0704
- 557
- 2
- 9
- 30
0
votes
1 answer
Getting seleted menu item
I am implementing run time menu on a button(QPushButton) in my app user has to make choice between ftp and http when he click on upload button.
QMenu menu(this);…

bhupinder
- 315
- 1
- 6
- 23
0
votes
1 answer
QMenu being displayed outside the main window
I'm using a custom QGraphicsWidget and when I right click on it I want to bring up a menu. I'm starting it like this:
void myQGraphicsWidget::mousePressEvent(QGraphicsSceneMouseEvent *event){
if(event->button() & Qt::RightButton){
const…

RidesTheShortBus
- 31
- 6
0
votes
1 answer
QTableWidget - QMenu Context Menu - AddAction slots not calling functions
I'm trying to call a function via a context menu embedded inside of a QTablewidget. It does not call the function in the slot. Could I be missing something ? The context menus do appear but clicking does nothing.
QMenu *contextMenu = new QMenu;
…

rreeves
- 2,408
- 6
- 39
- 53
0
votes
1 answer
Menu in the system tray doesn't have every QActions
I am running osx mountain lion (10.8.3) and when I run the code in the link below, I have a menu with only one action...
https://gist.github.com/Supm4n/8c705154b8586618f4cc
the other strange thing is that when I compile with only one action other…

Supm4n
- 3
- 3