Questions tagged [qmenu]

The QMenu class, part of the Qt framwork, provides a menu widget for use in menu bars, context menus, and other popup menus.

Documentation can be found here (Qt4) and here (Qt5).

252 questions
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
3 answers

Qt almost same main menu entries

I'm using c++ Qt library and I want to do something which would do : connect(actionB11, SIGNAL(triggered()), this, SLOT(SetSomething(1, 1))); connect(actionB12, SIGNAL(triggered()), this, SLOT(SetSomething(1, 2))); connect(actionB21,…
0
votes
2 answers

QAction won't connect to my slot

I'm trying to make an IHM with Qt, and I started by making a basic menu (File,Edit...). So far, I have my menu containing "File", which then display "New Project, Open Project, Exit". Look great, but my problem is I can't seem to trigger these…
Crumble
  • 5
  • 4
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
1 answer

how the menu is supposed to be popped up - Qt

i'm reading a book about Qt, there is an example about how to pop up the history menu, the text says "when this method is invoked it pops up a menu whose items correspond to the web pages the user has visited", but i don't really see how we make the…
Paul
  • 6,108
  • 14
  • 72
  • 128
-1
votes
1 answer

python pyqt5 Replace QMenu in QToolButton

File: ui.py # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit…
Chris P
  • 2,059
  • 4
  • 34
  • 68
-1
votes
1 answer

QMenu font size for different DPI for windows

I tried to make a custom QWidgetAction. That works fine. However... on windows with different DPI the font in the menu changes in non-obvious ways. 100% -> pointSize = 8 125% -> pointSize = 9 150% -> pointSize = 9 (so I was not able to fit some…
Kapitan
  • 73
  • 8
-1
votes
1 answer

Set the right-arrow icon of a specific QMenu in Qt

I am trying to change the icon of a QMenu's right arrow. The following QSS rule works QMenu::right-arrow { image: url(icons:icon_name.svg); } However, it changes the right arrows of all QMenus. I want to select only QMenus that have some…
Borislav-K
  • 11
  • 2
-1
votes
1 answer

QMenu not execing at correct position first time

I have this very strange issue regarding a QMenu and its position when execing. Here is the code for my subclassed QMenu: DockItemContextMenu::DockItemContextMenu(QWidget *parent) : QMenu(parent){ style = qApp->style(); QPointer
Blanky
  • 63
  • 9
-1
votes
1 answer

Show/Hide of QMenu

I created the Start Menu by inheriting QMenu. I want to show and hide it using QPropertyAnimation in sliding style Problem: Show & hide are working fine when I call them explicitly(on click of start button). But when I click outside of start menu it…
Jai
  • 1,292
  • 4
  • 21
  • 41
-2
votes
1 answer

QWidgetAction in QMenu are un-checkable if it has menu within

I am trying to implement tri-state checkboxes into a QMenu. My menu hierarchy will be something like: menuA |-- a101 |-- a102 menuB |-- b101 Where the first tier (menuA, menuB) are of tri-state checkboxes while its sub items are normal…
Teh Ki
  • 455
  • 1
  • 3
  • 14
1 2 3
16
17