Questions tagged [qaction]

The QAction class, part of the Qt framework, provides an abstract user interface action that can be inserted into widgets.

Documentation can be found here

145 questions
3
votes
1 answer

Qt - Creating Icon Button

I'm trying to create buttons similar to zoom-in, zoom-out on Google Maps; I want buttons that are only as big as the icon: http://codegeekz.com/wp-content/uploads/google-maps-jquery.jpg (I'm sorry for not posting the image, not enough reputation…
Kyle
  • 33
  • 1
  • 4
3
votes
1 answer

How to execute a function when a tray icon menu action is pressed?

int main( int argc, char* argv[] ) { QApplication oApp( argc, argv ); QAction *action1; QMenu menu; QSystemTrayIcon TrayIcon( QIcon("favicon.ico") ); TrayIcon.show(); action1= new QAction("action1", NULL); …
stefan
  • 133
  • 1
  • 1
  • 6
3
votes
1 answer

Qt 5.4 OS X how to use a QAction in both a QMenu and a QToolBar, but show the icon only in the QToolbar

Using Qt 5.4 on OS X (Yosemite), I have a QAction that has an icon. I want the icon to show in the QToolbar that I add the action to. This works fine. However, I do NOT want the icon to show in the QMenu that I add the action to. How do I do…
David Burson
  • 2,947
  • 7
  • 32
  • 55
3
votes
2 answers

Extract menu action data in receiving function or slot

In my menu, I am setting data to the menu actions. How can I extract that data in my slot? Or even better, instead of connecting a slot, can I also connect a member function that is able to extract the action data (like in the 1st connect)? The…
user2366975
  • 4,350
  • 9
  • 47
  • 87
3
votes
0 answers

How to add native icons in Qt action?

this is my Qt code openAction = new QAction("Open", this); openAction->setShortcut(QKeySequence::Open); I know I could add a Icon for this Action by this openAction->setIcon(QIcon("file path from source file")); But I hope I could add Native icon…
midCat
  • 123
  • 4
  • 13
3
votes
2 answers

How to reimplement triggered() signal in pyqt for a QAction?

I'm using Python with PyQt, for my interface, and Yapsi, for add plugins. Yapsy found all my plugins and add all to a menu in my mainWindow. Each plugin, is activated with triggered signal. This signal for a QAction don't have params and I need know…
j.barrio
  • 1,006
  • 1
  • 13
  • 37
2
votes
1 answer

PyQt5: Can QAction function be triggered via QPushButton

I have created a right-click menu function where all the right-click functions are linked to a QAction Eg: self.contextMenu =…
Sean Ang
  • 37
  • 5
2
votes
1 answer

QAction's icon doesn't show in QMenu

I had a working program in Qt4. After porting it to Qt5, the QActions' icons no longer show in the QMenu; only the text shows. The icons show ok in the toolbar, but not in the menu. I've already set the app to disable "AA_DontShowIconsInMenus" to…
DrewD
  • 21
  • 3
2
votes
1 answer

How can I get trigger signal for disabled QAction element?

I have disabled QAction menu element: QAction *item = new QAction(itemTitle); item->setEnabled(false); I use SLOT connection to call function after element was pressed, but it's works only for enabled elements: QObject::connect(item,…
semanser
  • 2,310
  • 2
  • 15
  • 33
2
votes
1 answer

Prevent a QMenu from closing when one of its QAction is not triggered

I have a QMenu and Several QWidgetActions, with checkboxes, when I try to click on any area of the QMenu, the menu get closed. I would like to prevent that. Here is how I do the actions and the menus. QWidgetAction* action = new…
احمد
  • 113
  • 1
  • 2
  • 7
2
votes
1 answer

identify a trigger of QAction

below I quoted my code. The problem is easy to describe. selectedItem->text is not the right way to differ what action was selected in the menu. How to do it right? void RView::ShowContextMenu(const QPoint& pos) // this is a slot { // for most…
tux007
  • 282
  • 1
  • 3
  • 17
2
votes
1 answer

Is there a way to show tooltip on disabled QWidget

I have a Qt form, where I have a button and menu. For various reasons I can disable certain elements, e.g button or some actions in the menu. Is there a way I could show a tooltip or when the mouse is hovered over the disabled button or menu item…
Serge
  • 1,027
  • 14
  • 21
2
votes
1 answer

Simple ribbon: how to use QActions within QTabBar?

I'm trying to implement simple tabbed interface with Qt5. I use QTabWidget with QToolBars placed inside its tabs and I add QActions to the QToolBars. That works but causes the following issue: any action remains accessible only while its parent tab…
Vercetti
  • 437
  • 1
  • 6
  • 17
2
votes
1 answer

How to interactively add widgets using QAction in Pyside/Pyqt without using layout management?

I'm trying to make a tool window for Maya, in which I can right-click anywhere, and if I click 'add', a rectangle widget shows up at my cursor position. Now my right-click functionality works. I can also get my cursor position in addPicker()…
2
votes
2 answers

connect QAction to slot

I'm trying to understand why QObject::connect sometimes does the job and why sometimes it does not. i would be really happy about anykind of help, i already did a lot of google/Documentation reading/ and looking for possible dublicates of the…
Philipp
  • 137
  • 1
  • 2
  • 11
1
2
3
9 10