0

I'm coding with Python and using PySide6 library, for GUI I use QT Creator 10 and porting it to Python with a solution found here:StackOverflow solution

I've created, in QTCreator, several slots for the menu items, with this layout, here is an example: Sender: actionHome - Signal: triggered() - Receiver: mainW - Slot: changeMainMenu()

The changeMainMenu() function receives the signal and executes the code inside it. The problem is that the QMainWindow (named mainW) has a QStachedWidget inside it that changes pages according to the selected menu item. The problem is that I don't know how to get the name of the clicked menu item so I can direct the stackedWidget to the appropriate page!! The problem is that I don't know how to get the name of the clicked menu item so I can direct the stackedWidget to the appropriate page!! in fact, the purpose of the function is to call other functions for each page in order to manage its content.

I also tried to set the slot to setFocus() to the triggered() signal and create a function named like that in the code, but in this case I can't get the signal from the GUI, even setting the focusPolicy for the menu items!!! I could create as many functions and therefore slots as there are menu items, but I would like to be able to receive the name of the selected menu item also because I could use it for other application solutions.

Wolverine
  • 11
  • 1

0 Answers0