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. Can't promote custom QDialog in Qt Designer
Forum Updated to NodeBB v4.3 + New Features

Can't promote custom QDialog in Qt Designer

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 740 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.
  • M Offline
    M Offline
    murphy607
    wrote on last edited by
    #1

    Hi all,
    I'm starting with ui-development in Qt and ran in this Problem
    I'm using Qt-Designer (Linux/5.15.3).
    I try to promote a custom QDialog class, but QtDesigner lacks the option to promote QDialog
    Other widgets can be promoted, but not QDialog
    18634aef-e241-4ba5-bf2d-1668601b1b49-image.png
    Is this simply not possible or am I missing something?

    TIA

    1 Reply Last reply
    0
    • M murphy607

      @mpergand thanks for your answer.
      From my understanding, I need to overrride the 'done' method in Order to stop the dialog from closing if for example the input validation fails.
      Therefore I derived my custom dialog.

      M Offline
      M Offline
      mpergand
      wrote on last edited by mpergand
      #4

      @murphy607
      When you create your dialog, you use your custom class, isn't it ?
      you do;
      MyDialog* dial=new MyDialog();
      and the interface is created by setUpUi()
      The ui file doesn't create the root widget by itself.

      1 Reply Last reply
      4
      • M Offline
        M Offline
        mpergand
        wrote on last edited by mpergand
        #2

        It doesn't make much sense to promote top level widgets like QDialog or QMainWindow.

        M M 2 Replies Last reply
        1
        • M mpergand

          It doesn't make much sense to promote top level widgets like QDialog or QMainWindow.

          M Offline
          M Offline
          murphy607
          wrote on last edited by
          #3

          @mpergand thanks for your answer.
          From my understanding, I need to overrride the 'done' method in Order to stop the dialog from closing if for example the input validation fails.
          Therefore I derived my custom dialog.

          M 1 Reply Last reply
          1
          • M murphy607

            @mpergand thanks for your answer.
            From my understanding, I need to overrride the 'done' method in Order to stop the dialog from closing if for example the input validation fails.
            Therefore I derived my custom dialog.

            M Offline
            M Offline
            mpergand
            wrote on last edited by mpergand
            #4

            @murphy607
            When you create your dialog, you use your custom class, isn't it ?
            you do;
            MyDialog* dial=new MyDialog();
            and the interface is created by setUpUi()
            The ui file doesn't create the root widget by itself.

            1 Reply Last reply
            4
            • M mpergand

              It doesn't make much sense to promote top level widgets like QDialog or QMainWindow.

              M Offline
              M Offline
              montanaviking
              wrote on last edited by
              #5

              @mpergand Ummm.... Why not? What if I have a Qdialog which is used stand-alone in one case, i.e. for testing purposes, then I want to place the whole Qdialog into a parent Qdialog? What is the proper way to proceed then?

              Pl45m4P 1 Reply Last reply
              0
              • M montanaviking

                @mpergand Ummm.... Why not? What if I have a Qdialog which is used stand-alone in one case, i.e. for testing purposes, then I want to place the whole Qdialog into a parent Qdialog? What is the proper way to proceed then?

                Pl45m4P Offline
                Pl45m4P Offline
                Pl45m4
                wrote on last edited by
                #6

                @montanaviking said in Can't promote custom QDialog in Qt Designer:

                What is the proper way to proceed then?

                The proper way is not to do this.
                You don't place a QDialog inside another QDialog, makes no sense and is bad design.
                There are better alternatives to achieve whatever you are trying to do.


                If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                ~E. W. Dijkstra

                1 Reply Last reply
                2

                • Login

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