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. QtWidgets - Create a typical project based GUI
Forum Updated to NodeBB v4.3 + New Features

QtWidgets - Create a typical project based GUI

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 396 Views 1 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
    MichaelH
    wrote on last edited by
    #1

    Hi guys,

    i am quite new to GUI developement and especially to qt.
    What i would like to make is a GUI that has a menu and a toolbar on top, but the rest of the window is empty at the beginning.
    So far so good, thats not a problem for me.

    If i then click at "File->Project->open" in my GUI i want do create a few windows within the empty space of the main window.
    For example one window that shows a tree structure, one window with tools, and another one where graphical data is shown.

    These windows should be placed at specific places with specific sizes in the main window, but i do also want the ability to drag them out of place.

    So i want something that feels a little bit like a CAD software or a typical project based software.
    What i mean by project based that is that you can open and close projects from the main window, and windows will be created and destroyed dynamically depending on whether a project is open or not.

    1.) Are docks the right tools to use?

    2.) if so, can i create a window_x.ui for every dock and then create and place these windows dynamically at runtime?

    3.) if this is not the way to do it, it would be nice if someone would have a hint what topics i should research

    Thanks,
    Michael

    M 1 Reply Last reply
    0
    • M MichaelH

      Hi guys,

      i am quite new to GUI developement and especially to qt.
      What i would like to make is a GUI that has a menu and a toolbar on top, but the rest of the window is empty at the beginning.
      So far so good, thats not a problem for me.

      If i then click at "File->Project->open" in my GUI i want do create a few windows within the empty space of the main window.
      For example one window that shows a tree structure, one window with tools, and another one where graphical data is shown.

      These windows should be placed at specific places with specific sizes in the main window, but i do also want the ability to drag them out of place.

      So i want something that feels a little bit like a CAD software or a typical project based software.
      What i mean by project based that is that you can open and close projects from the main window, and windows will be created and destroyed dynamically depending on whether a project is open or not.

      1.) Are docks the right tools to use?

      2.) if so, can i create a window_x.ui for every dock and then create and place these windows dynamically at runtime?

      3.) if this is not the way to do it, it would be nice if someone would have a hint what topics i should research

      Thanks,
      Michael

      M Offline
      M Offline
      MichaelH
      wrote on last edited by
      #6

      If anyone is wondering, i have used QDockWigets to show informations on the side of the GUI and in the center of the gui i have used a Multiple Document Interface (you can find something in the online documentations under "mdi") to show multiple windows.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bob64
        wrote on last edited by
        #2

        If you are new to this, the best approach is probably to try to make a few little examples to try out the features you want to use. For example:

        • Make a simple app with some menus. Focus on adding items to the menus and attaching them to some "action". Don't worry too much about what the actions are - you just want something that will give you some visual feedback. Perhaps print some different text in a text widget in your main window area depending on which item clicked.
        • If you want the docking behaviour, learn how to use QDockWidget, but just use simple windows - maybe just fill each with a different colour or something.
        • If you want a tree control, make a little project where a QTreeWidget fills your main window and concentrate on how to populate it with data. (You may find, as you become more familiar with Qt , and your requirements become more concrete, that you actually need to use QTreeView for the extra flexibility that it offers.)

        Even before doing any of this you may need to work through some tutorials to familiarise yourself with some of the basic concepts in Qt. One of the key things is "slots and signals", which is the mechanism that allows you to link some user-initiated GUI event (e.g., click a button, select a menu item), to some handler that needs to respond to that event.

        1 Reply Last reply
        1
        • M Offline
          M Offline
          MichaelH
          wrote on last edited by
          #3

          Well at first thank you for the answer.

          I have already read into Signals and Slots a little bit and also simple button clicking and doing stuff like that is no problem.
          I just wonder if QDockWidget is the right thing for me. But it looks like it's just fine.
          Also i am not quite sure about adding new .ui files and how to place them on a main window just with the code.

          I have only used the design editor for gui elements and wonder about layouts and on how to properly put windows inside of another window just with c++ code.

          B Pl45m4P 2 Replies Last reply
          0
          • M MichaelH

            Well at first thank you for the answer.

            I have already read into Signals and Slots a little bit and also simple button clicking and doing stuff like that is no problem.
            I just wonder if QDockWidget is the right thing for me. But it looks like it's just fine.
            Also i am not quite sure about adding new .ui files and how to place them on a main window just with the code.

            I have only used the design editor for gui elements and wonder about layouts and on how to properly put windows inside of another window just with c++ code.

            B Offline
            B Offline
            Bob64
            wrote on last edited by
            #4

            @MichaelH I have never really used Designer, so I'm afraid I don't know anything about integrating .ui files. Perhaps someone else can help with that. In general, though, it is not too difficult to programmatically layout a Qt UI. The documentation page has some good information and links to examples.

            1 Reply Last reply
            0
            • M MichaelH

              Well at first thank you for the answer.

              I have already read into Signals and Slots a little bit and also simple button clicking and doing stuff like that is no problem.
              I just wonder if QDockWidget is the right thing for me. But it looks like it's just fine.
              Also i am not quite sure about adding new .ui files and how to place them on a main window just with the code.

              I have only used the design editor for gui elements and wonder about layouts and on how to properly put windows inside of another window just with c++ code.

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

              @MichaelH said in QtWidgets - Create a typical project based GUI:

              I have only used the design editor for gui elements and wonder about layouts and on how to properly put windows inside of another window just with c++ code

              Do you really mean "windows"? Or just "widget"?
              You can design a widget in QtDesigner, add this class to your project and put it in your layout afterwards. It will look like the ui widget then.


              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
              0
              • M MichaelH

                Hi guys,

                i am quite new to GUI developement and especially to qt.
                What i would like to make is a GUI that has a menu and a toolbar on top, but the rest of the window is empty at the beginning.
                So far so good, thats not a problem for me.

                If i then click at "File->Project->open" in my GUI i want do create a few windows within the empty space of the main window.
                For example one window that shows a tree structure, one window with tools, and another one where graphical data is shown.

                These windows should be placed at specific places with specific sizes in the main window, but i do also want the ability to drag them out of place.

                So i want something that feels a little bit like a CAD software or a typical project based software.
                What i mean by project based that is that you can open and close projects from the main window, and windows will be created and destroyed dynamically depending on whether a project is open or not.

                1.) Are docks the right tools to use?

                2.) if so, can i create a window_x.ui for every dock and then create and place these windows dynamically at runtime?

                3.) if this is not the way to do it, it would be nice if someone would have a hint what topics i should research

                Thanks,
                Michael

                M Offline
                M Offline
                MichaelH
                wrote on last edited by
                #6

                If anyone is wondering, i have used QDockWigets to show informations on the side of the GUI and in the center of the gui i have used a Multiple Document Interface (you can find something in the online documentations under "mdi") to show multiple windows.

                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