0

I am currently working in Qt Designer and i am trying to make button change the index of QStackWidget with click signal.

I entered signal editor mode and connected Button to QStackWidget, This is what i got:

As you see in the picture, setCurrentIndex(int) is grayed out, If i choose any signal from QPushButton, there is nothing associated with changing page.

Sorted Question:

How can i change the page in QStackedWidget using a button? (In Qt Designer).

ShellRox
  • 2,532
  • 6
  • 42
  • 90

1 Answers1

3

That is not possible directly with Qt Designer, because QButton click signal doesn't send any index or argument, and setCurrentIndex(int) need an argument to chose change the index.
You have to do it using signal/slot in C++ code, or use an other widget like QSpinBox which emit a signal with an integer argument.

ahmed
  • 5,430
  • 1
  • 20
  • 36
  • Im using pyQt bindings whenever i finish code, Is there any Qt code for that? so i will edit it when modified. – ShellRox Apr 12 '16 at 20:00