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. How to import ui file containing frame to mainwindow?
Forum Updated to NodeBB v4.3 + New Features

How to import ui file containing frame to mainwindow?

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 1.5k 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.
  • Q Offline
    Q Offline
    Q139
    wrote on 9 Nov 2016, 20:43 last edited by
    #1

    Hi,
    Id like to reduce lines of code in mainwindow by seperating it to frames via seperate ui files.
    Is it correct way and is it possible to import those frames visibly to mainwindow ui file for positioning?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Nov 2016, 21:47 last edited by
      #2

      Hi,

      What exactly would you like to factor out of your main window ?

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

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        Q139
        wrote on 10 Nov 2016, 07:10 last edited by
        #3

        To seperate lines of code that are created via ui designer to multiple files for improving readability.
        So far i already have very long speghtti code mainwindow , but i am planning to add even more code.
        Most is created by by clicking "go to slot..." button in ui designer.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 10 Nov 2016, 07:43 last edited by
          #4

          Depending on what your are putting in your main window, you should design custom widgets properly. Just loading ui files is possible but it's likely not what you want to do.

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

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            Q139
            wrote on 10 Nov 2016, 12:43 last edited by Q139 11 Oct 2016, 12:44
            #5

            Easyest would be if other ui files coud be visually displayed and moved in mainwindow ui file while editing, but not sure if thats possible.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 10 Nov 2016, 21:12 last edited by SGaist 11 Oct 2016, 21:13
              #6

              If you want that, two possibilities:

              • Designer plugin
              • Widget promotion

              Easiest is the second option but you won't have the exact visual of your widget on screen.

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

              Q 1 Reply Last reply 11 Nov 2016, 18:14
              1
              • S SGaist
                10 Nov 2016, 21:12

                If you want that, two possibilities:

                • Designer plugin
                • Widget promotion

                Easiest is the second option but you won't have the exact visual of your widget on screen.

                Q Offline
                Q Offline
                Q139
                wrote on 11 Nov 2016, 18:14 last edited by Q139 11 Nov 2016, 18:17
                #7

                @SGaist Yes promotion work flawlessly but is it possible to also visualize while editing ui or il have to use my wetware to visuzlize it?
                Is it also possible to direct the auto generated code of "go to slot..." to cpp file other than mainwindow in order to reduce lines of code in single file?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 11 Nov 2016, 23:04 last edited by
                  #8

                  If you want all the visual support then write a plugin for designer.

                  If your slot only makes sense in your custom widgets then implement the slots in them.

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

                  1 Reply Last reply
                  1

                  7/8

                  11 Nov 2016, 18:14

                  • Login

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