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
1
vote
1 answer

Pyside2 QAction triggers once automatically but not when user clicks the menu

I've created a simple GUI using qt designer and imported it into my python project. The main window comes up, and the menus/buttons are responsive, but I cannot manage to connect my QActions to custom functions (I did it for buttons though, and it…
Carlos Borau
  • 1,433
  • 1
  • 24
  • 34
1
vote
1 answer

How to make size of button in the LineEdit smaller?

I made the X button in the LineEdit, when i click on this button, the LineEdit is clear. But with my method, the X button looks a little big and not beautiful, I need to make it smaller. How I can do it? myLineEdit = new…
songvan
  • 369
  • 5
  • 21
1
vote
1 answer

How to change the color of a QAction that is in a toolbar?

I have a toolbar or there are several QActions. I would like to change the color of the QAction when it is selected so that the user can see the chosen action. The problem is that QAction is not a QWidget so we can not use stylesheet. Is there a way…
user8632386
1
vote
2 answers

PyQt5: one callback works, the other doesn't - why?

My research has included: PyQt reference to callable problem? Python PyQt callback never runs - how to debug? Passing extra arguments to PyQt slot I am building a linux 'launcher' program which currently has two callbacks. One simply launches the…
tscv11
  • 55
  • 1
  • 7
1
vote
0 answers

One QMenu for all QToolButton

I've created QToolBar which contains few QToolButton. Each QToolButton has QMenu which is one for all. And this menu has few actions. Ugly example: QToolBar bar; QMenu menu; QAction action1; menu.addAction(action1); QAction…
1
vote
2 answers

Turn off themeing of menus in Qt?

I've inherited a Qt project that had themed right-click menus (which look really weird on macOS). I removed the setStyleSheet() call from the QMenu, yet it still highlights only the text instead of the item's background and uses weird font sizes. Is…
uliwitness
  • 8,532
  • 36
  • 58
1
vote
1 answer

How to use QWebEnginePage::OpenLinkInNewTab [Qt5.8]

When I click on link to any question in my feed on Quora using this code, the link doesn't open but it doesn't print "Hello". Could you please tell me where am I wrong? I'm pretty sure that link on quora emits the OpenLinkInNewTab signal. Please…
user7771896
1
vote
3 answers

How to disconnect function from QAction?

I am developing a plugin for the GIS software, QGIS. I have a QAction icon which, when checked, connects layers in a group to a function whenever their visibility is toggled. Then when it is unchecked, it is supposed to disconnect these functions…
Joseph
  • 586
  • 1
  • 13
  • 32
1
vote
1 answer

Pyqt5 QAction triggered event error in Windows

I developed a GUI application with python and pyqt5 in Ubuntu 16.04. There is an QActionBar in application that have some clickable items. All of functionalities in Ubuntu works perfect. As I want to export executable file for MS Windows, I was…
Mahmood Kohansal
  • 1,021
  • 2
  • 16
  • 42
1
vote
1 answer

In QT5, how to open new window on click event on sub-menu item?

I am new to QT programming & UI designing. I want to open a new window when the user clicks on submenu or menu item. I can successfully open a new window when the user clicks on a button. Below the image of my main window. I want to open new window…
1
vote
1 answer

QAction Icon Change on Hover

In my project I display a QMenu with several QAction objects. I want the QAction icon to change when the user hovers over it. Here is my current code: QPixmap icons(":/icons/platformIcons.png"); QIcon icon; icon.addPixmap(icons.copy(0, 0, 16, 16),…
mrg95
  • 2,371
  • 11
  • 46
  • 89
1
vote
1 answer

How create QActions and their signals according to file

I am using python3 and PyQt4. I want to create a menu with actions, the number of which differs according to an array. I want each of them to save the corresponding information, saved in the array, to a variable. Creating variable number of events…
iagerogiannis
  • 337
  • 3
  • 16
1
vote
1 answer

How to access a QAction using the QtTest lib?

I have a pop-up menu in a QTableWidget (resultTable). In the constructor of my class I set the context menu policy: resultTable->setContextMenuPolicy(Qt::CustomContextMenu); connect(resultTable, SIGNAL(customContextMenuRequested(QPoint)), this,…
KelvinS
  • 2,870
  • 8
  • 34
  • 67
1
vote
1 answer

Why does QAction not have a default constructor?

Most classes in Qt have a default constructor. Many classes take a QObject* or QWidget* as constructor argument with default value nullptr. The class QAction also has such a constructor taking a QObject* as argument, but there is no default value.…
Ralph Tandetzky
  • 22,780
  • 11
  • 73
  • 120
1
vote
1 answer

Start and Stop thread using QAction toggled

I'm currently trying to build a PyQt5 app and it should consist of the main GUI and in the background there should be a different thread that should measure something in an infinite loop. And I want to start and stop this thread using a QAction or…
haxor789
  • 604
  • 6
  • 18