Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using buttons from a QStackedLayout main widget in the current widget

Using buttons from a QStackedLayout main widget in the current widget

Scheduled Pinned Locked Moved General and Desktop
qstackedwidgetsqstackedwidgetqstackedlayout
4 Posts 2 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jorge
    wrote on 8 Jun 2015, 17:53 last edited by Jorge 6 Aug 2015, 18:00
    #1

    Hello,
    I've used the QStackedLayout because of the display convenience that it supports, in which it shows only one widget at a time.
    The way I have set it up is by using a main widget, which holds the QStackedLayout, and adding the needed widgets accordingly.
    Then, I have set up two QPushButton in the main widget and tested them by using them to navigate.
    The question is,
    Is there a way to use said buttons in the added widgets? I intend to use them, for example, to validate a login and to give the main control to the main widget.
    If that idea is wrong, however, I too would like to know.
    Thanks in advance.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Jun 2015, 20:44 last edited by
      #2

      Hi and welcome to devnet,

      Do you mean QWizard style ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply 8 Jun 2015, 22:29
      0
      • S SGaist
        8 Jun 2015, 20:44

        Hi and welcome to devnet,

        Do you mean QWizard style ?

        J Offline
        J Offline
        Jorge
        wrote on 8 Jun 2015, 22:29 last edited by
        #3

        @SGaist Yes.
        However, I've used buttons on each widget accordingly... Would that be better or worse than using a QWizard style layout?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 Jun 2015, 21:39 last edited by
          #4

          It really depends on your application. One thing to keep in mind is that these buttons should not know what's in e.g. your login widget. They should be enabled when appropriate. Otherwise you are going to have a pretty hard to maintain widget there if you add more "pages".

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          8 Jun 2015, 17:53

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved