Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Displaying multiple dialog on the same window(Qt5.14)

    Tools
    4
    10
    447
    Loading More Posts
    • 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.
    • R
      RAKULO last edited by

      I designed a standard dialog box that generates QDialog by clicking pushButton. Now I want each pop-up dialog box to be displayed in the main window one at a time (not as a separate window). What should I do? thank you very much!

      The picture is what it looks like now:
      2021-05-12 17-48-54 的螢幕擷圖.png image url)

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        Do you mean you do not want your QDialog to act as a usual dialog ?

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

        R 1 Reply Last reply Reply Quote 1
        • R
          RAKULO @SGaist last edited by

          @SGaist Sorry for the late reply. I hope that the dialog box function after clicking can be embedded in the label on the right instead of popping up a dialog box. I hope you understand what I mean. Thank you very much!

          jsulm 1 Reply Last reply Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion @RAKULO last edited by

            @RAKULO said in Displaying multiple dialog on the same window(Qt5.14):

            I hope that the dialog box function after clicking can be embedded in the label on the right instead of popping up a dialog box.

            I fail to understand this.
            Do you want to show a dialog or not?
            Or do you want an editable label?

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

            R 1 Reply Last reply Reply Quote 1
            • R
              RAKULO @jsulm last edited by

              @jsulm Sorry I didn't make it clear, I want to show the "function" of the dialog in the right label, not a pop-up dialog.THX!!

              JonB jsulm 2 Replies Last reply Reply Quote 0
              • JonB
                JonB @RAKULO last edited by

                @RAKULO
                So set the text of the label instead of showing the dialog?

                1 Reply Last reply Reply Quote 0
                • jsulm
                  jsulm Lifetime Qt Champion @RAKULO last edited by

                  @RAKULO said in Displaying multiple dialog on the same window(Qt5.14):

                  I want to show the "function"

                  What do you mean by "function"? Do you want to enter a value directly in the label?

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

                  R 1 Reply Last reply Reply Quote 1
                  • R
                    RAKULO @jsulm last edited by

                    @jsulm Thank you for your reply! I want to display the respective function of each dialog box in the right label after clicking the corresponding button. For example, the color dialog box can set the color, the font dialog box can set the font, and the input dialog box can enter text... But they are not displayed in the new dialog box but displayed on the label on the right!

                    JonB jsulm 2 Replies Last reply Reply Quote 0
                    • JonB
                      JonB @RAKULO last edited by JonB

                      @RAKULO
                      This is a slightly strange interface, but one of:

                      • Have the dialog raise a signal when its button is pressed. Have the window connect a 8slot* to that, and update the desired corresponding label.
                      • Allow the dialog to exit when the button pressed. Have the caller --- the place which invoked the dialog --- read the button/value the user selected, and have it 9the caller) update the label on the widget.

                      Does this address your requirement?

                      1 Reply Last reply Reply Quote 0
                      • jsulm
                        jsulm Lifetime Qt Champion @RAKULO last edited by jsulm

                        @RAKULO You can use https://doc.qt.io/qt-5/qstackedwidget.html in that "right label" to select a widget corresponding to the clicked button. In each widget you implement the interface you need like selecting color or font. I don't know a way to integrate a dialog into a widget, so you will have to implement these UI interfaces by yourself.
                        Since Qt is open source you can also check the code for the dialog you need to see how you can implement these interfaces.

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

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post