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. Child dialog in a mail dialog.
QtWS25 Last Chance

Child dialog in a mail dialog.

Scheduled Pinned Locked Moved General and Desktop
19 Posts 5 Posters 7.0k 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.
  • F Offline
    F Offline
    fluca1978
    wrote on last edited by
    #9

    So you are not searching to display a dialog window, you are trying to display different widgets depending on the user selection on the left panel bar. There are different ways to achieve it, one it could be to use a stack layout. As you mentioned, take the config dialog example and implement it in a similar way. Just create a set of top level widgets that are containers for your right side widgets and display the top level containers when needed.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      deepak_smcet
      wrote on last edited by
      #10

      is there any other way to do it except using stacked containers? any simpler way? the reason i am using dialog is because i could make use to editor to place other items on it. but in the example, all the other controls are created dynamically.

      regards
      D

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #11

        Using a [[doc:QStackedWidget]] is really quite simple. You can do it completely using Qt Designer even, without writing code. No need to create dynamic controls.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #12

          @
          m_pChildDlg->setWindowFlags(Qt::Popup);
          @

          is most likely to cause your trouble. Popups usually go away when they loos focus (what happens by clicking the main window). Just make it a regular window/widget and you're done.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • D Offline
            D Offline
            deepak_smcet
            wrote on last edited by
            #13

            hello volker,

            you are right but it did not solve the problem,

            if i set it to
            @pChildDlg = new ClildDialog(this);
            pChildDlg->setModal(false);
            pChildDlg->setWindowFlags(Qt::Widget);@

            and then call

            @ QPoint p(this->window()->geometry().topLeft());
            pChildDlg->move(p);
            pChildDlg->show();@

            the widget is not shown.

            but if i set it to
            @ pChildDlg->setWindowFlags(Qt::Window);@

            the dialog is shown but has border on it, i used the property 'WindowTitleHint' to clear some of those. yes after setting above flag it does not go away, but when i move the main window it does not move with it. i want it to be stick to main window just like button and other dialogs.

            is there any way to upload small source file here in the post, i dont see such option

            @Andre,

            i will try your suggestion soon and update the post soon
            regards
            D

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #14

              You have a completely independent window with your popup. To move it together with your mainwindow, you need to reimplement moveEvent and move your popup by the same amount as your mainwindow.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • D Offline
                D Offline
                deepak_smcet
                wrote on last edited by
                #15

                humm,

                i just a read a post here
                http://lists.trolltech.com/qt-interest/2002-12/msg01080.html
                which says that
                "Dialogs are ALWAYS toplevel widgets and are NEVER children of other widgets. If you specify a parent in a dialog it is only for positional reasions"

                i think this is my mistake, i am trying to use a dialog as a widget. i mean i am trying to make it children of other dialog.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #16

                  That "positional reason" is only for the initial display of the dialog.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • F Offline
                    F Offline
                    fluca1978
                    wrote on last edited by
                    #17

                    I'm totally unable to understand what you are trying to achieve...

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #18

                      [quote author="fluca1978" date="1323178212"]I'm totally unable to understand what you are trying to achieve...[/quote]

                      This is how I understood it:

                      • there should be a non-modal toplevel window (e.g. like a search/replace window of a word processor), so that both the main window and the popup are functional at the same time
                      • the second window is supposed to move together with the main window in case the latter is moved

                      The problem was that by using the wrong window flags, the popup was closed when clicking into the main window.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        andre
                        wrote on last edited by
                        #19

                        [quote author="fluca1978" date="1323178212"]I'm totally unable to understand what you are trying to achieve...[/quote]

                        Hence the request to send a sketch that we can look at...

                        1 Reply Last reply
                        0

                        • Login

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