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. MDI application with multiple Forms
QtWS25 Last Chance

MDI application with multiple Forms

Scheduled Pinned Locked Moved Unsolved General and Desktop
19 Posts 4 Posters 3.9k 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.
  • N Nishanth
    20 Aug 2018, 05:49

    @jsulm I have explained why the MDI example doesn't provide the required solution to my problem in the previous threads. If it was just one widget as you told I would have got it over with, My requirement is multiple controls (widgets) which comprises of multiple text boxes and buttons in a UI form. and I have multiple UI forms.

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 20 Aug 2018, 05:51 last edited by
    #10

    @Nishanth I know. The thing is: all these widgets you are talking about are placed on some widget (parent widget), right? So, create a custom widget where you put all these widgets and then put this custom widget (parent widget) where you need it...

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

    N 1 Reply Last reply 20 Aug 2018, 06:00
    2
    • J jsulm
      20 Aug 2018, 05:51

      @Nishanth I know. The thing is: all these widgets you are talking about are placed on some widget (parent widget), right? So, create a custom widget where you put all these widgets and then put this custom widget (parent widget) where you need it...

      N Offline
      N Offline
      Nishanth
      wrote on 20 Aug 2018, 06:00 last edited by Nishanth
      #11

      @jsulm I have placed a MDIarea into the main window and have tried to load the forms created inside the main window, but it was not working. Maybe I am missing something here.
      Maybe I am not used to the terminology used here, so in Qt, UI forms are widgets, controls (textboxes, labels, etc..) are widgets?
      I will look around for the solution, hopefully should be able to figure it out.
      Thanks.

      J 1 Reply Last reply 20 Aug 2018, 06:04
      0
      • N Nishanth
        20 Aug 2018, 06:00

        @jsulm I have placed a MDIarea into the main window and have tried to load the forms created inside the main window, but it was not working. Maybe I am missing something here.
        Maybe I am not used to the terminology used here, so in Qt, UI forms are widgets, controls (textboxes, labels, etc..) are widgets?
        I will look around for the solution, hopefully should be able to figure it out.
        Thanks.

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 20 Aug 2018, 06:04 last edited by
        #12

        @Nishanth Did you check the documentation and MDI example?

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

        1 Reply Last reply
        2
        • N Nishanth
          20 Aug 2018, 05:30

          @mrjj Hi, I looked into the code you shared, it is not what I had in mind, I need the application to be menu driven.
          I should be able to choose the UI form based on the user selection in the menubar.
          For example I want to have Appmenu under which I will have the options, Login, form1, form2, form3, Logout, Exit.

          So at the app start the user will be shown the login form and once he logs in he will be able to choose any one of the forms from the menu or all the forms available in the menu.

          I would say the Login, form1, form2, form3 are all mdichild forms which are contained within the MDIParent whenever invoked. I am yet to come across an example which explains the process.

          I am not sure if stacked widgets is going to help me with that.

          The MDI example available with the Qt package doesnt use forms UI as it is a text editor, which has a MDI parent and the text editors being the MDI Childs. wish Qt had an example along the similar lines but with forms.

          Thanks for looking into the issue, if you find a solution please do post.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 20 Aug 2018, 06:14 last edited by mrjj
          #13

          @Nishanth
          Well you could switch pages in stack widget with menus.

          However, it sounds like you a really hooked on MDI.
          Note, though. they draw win 7 style on win 8/9.

          MDI can hold any widget, including forms.
          The process is the same as inserting any other widget.

          N 1 Reply Last reply 20 Aug 2018, 07:27
          3
          • M mrjj
            20 Aug 2018, 06:14

            @Nishanth
            Well you could switch pages in stack widget with menus.

            However, it sounds like you a really hooked on MDI.
            Note, though. they draw win 7 style on win 8/9.

            MDI can hold any widget, including forms.
            The process is the same as inserting any other widget.

            N Offline
            N Offline
            Nishanth
            wrote on 20 Aug 2018, 07:27 last edited by
            #14

            @mrjj I am looking at MDI as it has a familiar feel to a lot of desktop applications I use, and meets the requirement. I just have to find a good tutorial or an example for what I am looking for in QT. I guess I am having beginners trouble with Qt. Couple of examples that with the documentations are implemented in a different way which I feel will not work for me. going through them I might just land on some thing that helps me.
            Thanks.

            M 1 Reply Last reply 20 Aug 2018, 07:46
            0
            • N Nishanth
              20 Aug 2018, 07:27

              @mrjj I am looking at MDI as it has a familiar feel to a lot of desktop applications I use, and meets the requirement. I just have to find a good tutorial or an example for what I am looking for in QT. I guess I am having beginners trouble with Qt. Couple of examples that with the documentations are implemented in a different way which I feel will not work for me. going through them I might just land on some thing that helps me.
              Thanks.

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 20 Aug 2018, 07:46 last edited by
              #15

              @Nishanth
              Hi
              Can you perhaps show an image of such a desktop program you use?
              Might help us pinpoint exactly what you are after.
              Most app i use is not MDI in the old sense where is document is
              a floating window inside the app. but more like stacked widget where I switch views.

              Also check out
              http://doc.qt.io/qt-5/qdockwidget.html

              1 Reply Last reply
              1
              • N Offline
                N Offline
                Nishanth
                wrote on 20 Aug 2018, 15:35 last edited by Nishanth
                #16

                Qt Creator for one is a MDI application.. I think there are a lot of apps which are an MDI and I have seen desktop application like the one I am trying to develop in Qt developed in c#, vb.net for windows platforms as well.

                I have explained the requirement I am working on couple of times I really cannot be any more elaborate than I have been. Anyways thanks for your time. I am sure I will get to the solution.

                If I get a working solution I will maybe post a sample code later on. Till then the search is on.

                M 1 Reply Last reply 20 Aug 2018, 15:45
                0
                • N Nishanth
                  20 Aug 2018, 15:35

                  Qt Creator for one is a MDI application.. I think there are a lot of apps which are an MDI and I have seen desktop application like the one I am trying to develop in Qt developed in c#, vb.net for windows platforms as well.

                  I have explained the requirement I am working on couple of times I really cannot be any more elaborate than I have been. Anyways thanks for your time. I am sure I will get to the solution.

                  If I get a working solution I will maybe post a sample code later on. Till then the search is on.

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 20 Aug 2018, 15:45 last edited by
                  #17

                  @Nishanth
                  Yep, its a multi view application but not a MDI app in the traditional sense.
                  You can split a Editor view and see 2 or more at same time but the views do not have
                  captions and decorations.
                  For such design, QSplitter can be used to divide the client area into view.
                  You can also use QDockWidgets which also can support multiple views
                  and/or support floating windows.
                  http://doc.qt.io/qt-5/qtwidgets-mainwindows-dockwidgets-example.html

                  N 1 Reply Last reply 20 Aug 2018, 16:12
                  2
                  • M mrjj
                    20 Aug 2018, 15:45

                    @Nishanth
                    Yep, its a multi view application but not a MDI app in the traditional sense.
                    You can split a Editor view and see 2 or more at same time but the views do not have
                    captions and decorations.
                    For such design, QSplitter can be used to divide the client area into view.
                    You can also use QDockWidgets which also can support multiple views
                    and/or support floating windows.
                    http://doc.qt.io/qt-5/qtwidgets-mainwindows-dockwidgets-example.html

                    N Offline
                    N Offline
                    Nishanth
                    wrote on 20 Aug 2018, 16:12 last edited by
                    #18

                    @mrjj I am looking at developing a MDI application in as you put it “traditional sense” which is probably very simple when compared to how other mdi application are from the requirement I have posted. Whatever suggestions you have suggested are pretty neat but it doesn’t really help me with my requirement.
                    Thank you for taking the time to post.

                    M 1 Reply Last reply 20 Aug 2018, 16:17
                    0
                    • N Nishanth
                      20 Aug 2018, 16:12

                      @mrjj I am looking at developing a MDI application in as you put it “traditional sense” which is probably very simple when compared to how other mdi application are from the requirement I have posted. Whatever suggestions you have suggested are pretty neat but it doesn’t really help me with my requirement.
                      Thank you for taking the time to post.

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 20 Aug 2018, 16:17 last edited by mrjj
                      #19

                      @Nishanth
                      Ok, then MDI area is best fit. Its 100% traditional :)
                      alt text

                      You can use any form/widget for the inner content.
                      just use
                      QMdiSubWindow *addSubWindow(QWidget *widget, Qt::WindowFlags flags = Qt::WindowFlags());
                      to create new window where widget is your form object.

                      1 Reply Last reply
                      2

                      19/19

                      20 Aug 2018, 16:17

                      • Login

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