Questions tagged [qstackedwidget]

The QStackedWidget class provides a stack of widgets where only one widget is visible at a time. QStackedWidget can be used to create a user interface similar to the one provided by QTabWidget.

The QStackedWidget class provides a stack of widgets where only one widget is visible at a time.

Official information can be found here.

96 questions
2
votes
2 answers

slide QStackedWidget page

How can i slide QtWidgets.QStackedWidget pages on QPushButton.clicked as shown in below image (in right) ? action: on left button press QStackedWidget page index will set to 0 & on right button press QStackedWidget page index will set to 1
Ruchit
  • 661
  • 1
  • 6
  • 19
2
votes
1 answer

setCurrentWidget applied after the end of a clicked signal

When I create slots by name with this kind of syntax: on__clicked(); If I want to display a particular widget Inside this function it won't display until it reaches the end of the function. That is, when I create the following…
Sebastien
  • 21
  • 1
2
votes
1 answer

How to connect QTreeWidget and QStackedWidget in PyQt4?

I'm sorry but just a beginner of Python. I just want to change index of QStackedWidget by the item click of QTreeWidget. I searched for the tutorials of SIGNAL and SLOT online, but just cannot solve the problem. The parameters in QTreeWidget signal…
Mersper
  • 107
  • 8
2
votes
1 answer

How can I show different pages in one window by PyQt5?

As you can see, I create a window with left buttons, but I don't know how to use QStackedWidget to show different views after pressed every button. I searched several similar questions, but they were not useful for me. I am new to PyQt5. I add my…
Peak Lu
  • 37
  • 1
  • 9
2
votes
1 answer

QStackedLayout in Qt Designer

I can use a QStackedWidget fine in Qt Creator, but it has buttons that allow the user to change the current page. I only want to do that programmatically. Unfortunately there doesn't seem to be a Stacked Layout anywhere in the form editor. Is there…
Timmmm
  • 88,195
  • 71
  • 364
  • 509
2
votes
1 answer

"QStackedWidget.setCurrentIndex": It does not work or error mark

I'm doing a program with graphical interface using PyQt5 . I want to do is that when the user presses certain button, this change widget and show other options. For this I decided to use QStackedWidget, and all my interface build it from the QT5…
Alc René
  • 21
  • 1
  • 3
2
votes
1 answer

Pass arguments to constructor of widget within QStackedWidget

I have a graphical application written in C++ using Qt for an embedded device, which uses a QStackedWidget holding a number of UI widgets. The UI is all designed in Qt Creator's designer tool. When the user navigates through the device's application…
SionHughes
  • 128
  • 11
2
votes
1 answer

QStackedWidget::setCurrentIndex() changes scene viewport

I'm having a problem with an unwanted viewport (QGraphicsView) update caused by calling QStackedWidget::setCurrentIndex(), the QStackedWidget instance is not part of the scene. This does not happen on all scenes, it seems that only the bigger ones…
Aurélien
  • 57
  • 1
  • 8
2
votes
3 answers

How to change contents of QMainWindow dynamically

I have a QMainWindow that starts out with nothing but a menubar with a menu that has two options. When the first is clicked the window should be populated with QLabels and various input widgets to recieve data. When the second option is clicked the…
Vinc
  • 695
  • 2
  • 10
  • 26
1
vote
1 answer

Do I need to setParent to nullptr before deleting QWidget that's owned by QStackedWidget

I have a QStackedWidget which has a bunch of static "pages" but in a couple of cases one page needs to be recreated when it's switched to. Currently I have something like this: void InsetNavigator::Navigate(InsetPage *page) { auto current_page =…
gfree
  • 479
  • 7
  • 16
1
vote
1 answer

Adding windows to a QStackedWidget in Qt designer doesn't work as expected

I am currently working on a project that involves developing a GUI, that I can send emails to someone and if I need I should be able to save it on a database. The GUI has two pages, the senders credentials are entered in first page and the email is…
tad
  • 117
  • 7
1
vote
1 answer

Dynamically modifying multiple instances of the same widget via QStackedWidget

I am unable to dynamically change the layout/elements of multiple instances of a QStackedWidget. The full code below enables one to toggle a button which when clicked will create a QFrame with the respective name of the button that was toggled and…
1
vote
1 answer

How to dynamically add widget inside a QStackedWidget

In order to replicate the problem I have I prepared a small verifiable example. I have 2 QStackedWidgets inside a QGroupBox with a couple more components as shown below: I created another widget called QBoxForm which carries a QComboBox only. This…
Emanuele
  • 2,194
  • 6
  • 32
  • 71
1
vote
0 answers

Constructing complex GUI with PyQt5 QStackWidget

So essentially, I want to use treeView toplevel selection as trigger for changing QStackWidget 1 page and child selection as trigger for changing QStackWidget 2 page as shown in the image. Earlier, I used selectedindexes function to get selection…
RealRK
  • 315
  • 3
  • 19
1
vote
1 answer

How to connect Qtoolbutton and QStackedWidget (Both are in same frame)

I created a Window in which there are 4 different QToolButtons and it is outside QStackedWidget. When I click on the first QToolButton which is Balance Inquiry as shown in the image then the contents of Balance Inquiry should be shown and similarly…