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. Working on multiple screen issue
Forum Updated to NodeBB v4.3 + New Features

Working on multiple screen issue

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 3 Posters 743 Views 2 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.
  • K Offline
    K Offline
    Kira
    wrote on 3 Feb 2020, 05:02 last edited by
    #1

    Hello All,
    My problem is similar to the given issue.
    https://forum.qt.io/topic/56168/how-to-handle-multiple-screens-on-the-gui/4
    Currently, I am using stacked widgets, but I need to switch within the screen.
    There is a solution mentioned in the forum, is there an example referring the same
    or is there any other alternative solution since it was discussed long back.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 3 Feb 2020, 08:11 last edited by mrjj 2 Mar 2020, 08:12
      #2

      Hi
      The stacked widget approach is still the one to use for any design using a concept of "pages"

      For wizard like design, there is also
      https://doc.qt.io/qt-5/qwizard.html

      So what is the actual issue you have?

      K 1 Reply Last reply 3 Feb 2020, 08:21
      2
      • M mrjj
        3 Feb 2020, 08:11

        Hi
        The stacked widget approach is still the one to use for any design using a concept of "pages"

        For wizard like design, there is also
        https://doc.qt.io/qt-5/qwizard.html

        So what is the actual issue you have?

        K Offline
        K Offline
        Kira
        wrote on 3 Feb 2020, 08:21 last edited by
        #3

        @mrjj: Thanks for the reply.
        Currently, I have a main window with a stack widget.
        I have inserted five widgets, ie. 5 pages of stacked widgets.
        Each widget has its own independent functionality.
        Now suppose there is a push button on page1 using which I have to call page4
        How this is possible?
        For example, the child widget won't have an idea about the parent widget.

        J 1 Reply Last reply 3 Feb 2020, 08:43
        0
        • K Kira
          3 Feb 2020, 08:21

          @mrjj: Thanks for the reply.
          Currently, I have a main window with a stack widget.
          I have inserted five widgets, ie. 5 pages of stacked widgets.
          Each widget has its own independent functionality.
          Now suppose there is a push button on page1 using which I have to call page4
          How this is possible?
          For example, the child widget won't have an idea about the parent widget.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 3 Feb 2020, 08:43 last edited by jsulm 2 Mar 2020, 08:44
          #4

          @Kira said in Working on multiple screen issue:

          How this is possible?

          Connect the signal to a slot in the container widget (I guess MainWindow?) where you activate the page 4?

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

          K 1 Reply Last reply 3 Feb 2020, 08:54
          2
          • J jsulm
            3 Feb 2020, 08:43

            @Kira said in Working on multiple screen issue:

            How this is possible?

            Connect the signal to a slot in the container widget (I guess MainWindow?) where you activate the page 4?

            K Offline
            K Offline
            Kira
            wrote on 3 Feb 2020, 08:54 last edited by
            #5

            @jsulm: Ok thanks understood.
            I was referring to one of the comments mentioned by the moderator in the given link:
            https://forum.qt.io/topic/56168/how-to-handle-multiple-screens-on-the-gui/4
            "I would give it a generic addScreen(Screen) function and then load them at runtime. This way you would design main window and each screen separately in the designer keeping them nice and separate*."
            Any comments on that :)

            J 1 Reply Last reply 3 Feb 2020, 09:01
            0
            • K Kira
              3 Feb 2020, 08:54

              @jsulm: Ok thanks understood.
              I was referring to one of the comments mentioned by the moderator in the given link:
              https://forum.qt.io/topic/56168/how-to-handle-multiple-screens-on-the-gui/4
              "I would give it a generic addScreen(Screen) function and then load them at runtime. This way you would design main window and each screen separately in the designer keeping them nice and separate*."
              Any comments on that :)

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 3 Feb 2020, 09:01 last edited by
              #6

              @Kira That post refers to creating the widgets dynamically if I understand it correctly
              I'm still not sure about your exact use case: do you create the "screen" dynamically?

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

              1 Reply Last reply
              2
              • M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 3 Feb 2020, 09:08 last edited by mrjj 2 Mar 2020, 09:09
                #7

                Hi
                I think the other tread just talk about using full UI enabled widgets with .cpp and .h
                Just like MainWindow is. based on QWidget instead. ( as base class)

                That allows you to handle all functionality inside its .cpp file and not stuff all logic from pages into the mainwindow.

                So to allow such self-contained Widgets to change page you need to define some new signals pr page it can emit and then
                mainwin can do the page flipping. Or a small controller object if you wish to keep it really clean.

                K 1 Reply Last reply 3 Feb 2020, 09:10
                2
                • M mrjj
                  3 Feb 2020, 09:08

                  Hi
                  I think the other tread just talk about using full UI enabled widgets with .cpp and .h
                  Just like MainWindow is. based on QWidget instead. ( as base class)

                  That allows you to handle all functionality inside its .cpp file and not stuff all logic from pages into the mainwindow.

                  So to allow such self-contained Widgets to change page you need to define some new signals pr page it can emit and then
                  mainwin can do the page flipping. Or a small controller object if you wish to keep it really clean.

                  K Offline
                  K Offline
                  Kira
                  wrote on 3 Feb 2020, 09:10 last edited by
                  #8

                  @mrjj : Ok thanks :)

                  M 1 Reply Last reply 3 Feb 2020, 09:15
                  0
                  • K Kira
                    3 Feb 2020, 09:10

                    @mrjj : Ok thanks :)

                    M Offline
                    M Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on 3 Feb 2020, 09:15 last edited by
                    #9

                    @Kira

                    Ok so thats why he talks about addScreen(Screen) as if we use a custom Widget as the page then
                    we need to use promotion or insert via code.

                    If you need to be able to jump to random pages, from a page, i will recommend you use a tag name instead of the raw int index
                    as then inserting or remove pages later will not break the jumping.

                    K 1 Reply Last reply 3 Feb 2020, 09:19
                    0
                    • M mrjj
                      3 Feb 2020, 09:15

                      @Kira

                      Ok so thats why he talks about addScreen(Screen) as if we use a custom Widget as the page then
                      we need to use promotion or insert via code.

                      If you need to be able to jump to random pages, from a page, i will recommend you use a tag name instead of the raw int index
                      as then inserting or remove pages later will not break the jumping.

                      K Offline
                      K Offline
                      Kira
                      wrote on 3 Feb 2020, 09:19 last edited by
                      #10

                      @mrjj : Tag name?

                      M 1 Reply Last reply 3 Feb 2020, 09:22
                      0
                      • K Kira
                        3 Feb 2020, 09:19

                        @mrjj : Tag name?

                        M Offline
                        M Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on 3 Feb 2020, 09:22 last edited by mrjj 2 Mar 2020, 09:23
                        #11

                        @Kira

                        Well i mean - use a name instead of the raw index.

                        like
                        emit GotoPage( "EditPage" )
                        versus
                        emit GotoPage( 6 )

                        if you would ever change the flow or add new pages in the middle its nice
                        not to have to change all the index around the interface.

                        I used a dynamic property for this. you can also use Widget objectname

                        K 1 Reply Last reply 3 Feb 2020, 09:27
                        0
                        • M mrjj
                          3 Feb 2020, 09:22

                          @Kira

                          Well i mean - use a name instead of the raw index.

                          like
                          emit GotoPage( "EditPage" )
                          versus
                          emit GotoPage( 6 )

                          if you would ever change the flow or add new pages in the middle its nice
                          not to have to change all the index around the interface.

                          I used a dynamic property for this. you can also use Widget objectname

                          K Offline
                          K Offline
                          Kira
                          wrote on 3 Feb 2020, 09:27 last edited by
                          #12

                          @mrjj : Ohh sure thanks :)

                          1 Reply Last reply
                          0

                          1/12

                          3 Feb 2020, 05:02

                          • Login

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