Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Example for configuration dialog with qlistwidget and qstackedwidget ?
Forum Updated to NodeBB v4.3 + New Features

Example for configuration dialog with qlistwidget and qstackedwidget ?

Scheduled Pinned Locked Moved Solved Qt for Python
10 Posts 4 Posters 2.9k Views 1 Watching
  • 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.
  • N Offline
    N Offline
    NonNT
    wrote on 25 Oct 2019, 10:22 last edited by
    #1

    Hi,

    I'm looking for an example of how to develop a configuration dialog with qlistwidget and qstackedwidget.

    Thanks

    J 1 Reply Last reply 25 Oct 2019, 11:15
    0
    • N NonNT
      25 Oct 2019, 10:22

      Hi,

      I'm looking for an example of how to develop a configuration dialog with qlistwidget and qstackedwidget.

      Thanks

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 25 Oct 2019, 11:15 last edited by
      #2

      @NonNT Qt is full of examples: https://doc.qt.io/qt-5/qtexamplesandtutorials.html
      https://doc.qt.io/qt-5/qsettings.html
      https://doc.qt.io/qt-5/qtwidgets-tools-settingseditor-example.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • N Offline
        N Offline
        NonNT
        wrote on 3 Nov 2019, 14:42 last edited by
        #3

        Thanks for your reply.

        I was looking for an example like this:

        config-dialog.png

        QListWidget and QStackedWidget

        I found an older example here:
        https://www.tutorialspoint.com/pyqt/pyqt_qstackedwidget.htm

        J 1 Reply Last reply 4 Nov 2019, 05:55
        0
        • N NonNT
          3 Nov 2019, 14:42

          Thanks for your reply.

          I was looking for an example like this:

          config-dialog.png

          QListWidget and QStackedWidget

          I found an older example here:
          https://www.tutorialspoint.com/pyqt/pyqt_qstackedwidget.htm

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 4 Nov 2019, 05:55 last edited by
          #4

          @NonNT It looks rather like https://doc.qt.io/qt-5/qtabwidget.html

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • N Offline
            N Offline
            NonNT
            wrote on 4 Nov 2019, 20:59 last edited by
            #5

            I think, its like this:

            config-dialog-qt.png

            1 Reply Last reply
            0
            • N Offline
              N Offline
              NonNT
              wrote on 4 Nov 2019, 21:54 last edited by NonNT 11 Apr 2019, 22:03
              #6

              Screenshot is the options dialog of Qt Creator.

              Then its like this:

              QVBoxLayout
                  QHBoxLayout
                      QVBoxLayout
                          QLineEdit
                          QListWidget | QTreeWidget
                      QVBoxLayout
                          QLabel
                          QTabWidget | QStackedWidget
                  QDialogButtonBox
              
              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 4 Nov 2019, 22:09 last edited by
                #7

                You had it correctly, the first time. The QStackedWidget will be used to switch between the various widgets that are related to the selection you have in the QListWidget.

                In the example you have, the QTabWidget is part of the widget that that is related to the Kits. That "KitsWidget" is contained in the QStackedWidget.

                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
                1
                • N Offline
                  N Offline
                  NonNT
                  wrote on 4 Nov 2019, 22:27 last edited by
                  #8

                  @SGaist Thanks.

                  The example is the options dialog of Qt Creator.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 4 Nov 2019, 23:27 last edited by
                    #9

                    @Denni-0 one example would be a configuration dialog which can be dynamically extended using plugins. Each plugin can provide its own configuration widget. In this case why should the dialog start fiddling with a QTabWidget ? Each configuration widget is that: one widget. The fact that it uses QTabWidget internally because it has several different aspects to configure or simply one QLineEdit is an implementation detail. Hence the combination of a QListView/Widget and a QStackedWidget which current index depends on the selected item in said QListView/Widget.

                    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
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 6 Nov 2019, 16:27 last edited by
                      #10

                      The idea behind a preference widget like shown here is that for each entry in the QListWidget, you have an independent widget shown. Hence the use of QStackedWidget. The fact that there might be a QTabWidget in one or more of these widgets is a technical detail. This allows you to design freely these widget without having to modify the dialog to fiddle with adding and removing tabs each time you click a different item in the list widget.

                      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
                      1

                      • Login

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