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. Designing in QtCreator.
Forum Updated to NodeBB v4.3 + New Features

Designing in QtCreator.

Scheduled Pinned Locked Moved General and Desktop
13 Posts 5 Posters 4.6k 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.
  • G Offline
    G Offline
    goblincoding
    wrote on last edited by
    #2

    I'm not entirely sure I understand what you mean. Do you mean that your main window doesn't fit onto your screen or is it simply too big an issue trying to manage all the elements of your main window?

    If your problem is the former, you may have to re-design and move some of the functionality to separate forms that will be shown when the user triggers a specific action (if it doesn't fit on your monitor, it probably won't fit on your user's either).

    If the problem is the latter, perhaps you should consider creating separate custom widgets, each with their own designer form, that you can add to your main widget to create your main window.

    http://www.goblincoding.com

    1 Reply Last reply
    0
    • U Offline
      U Offline
      utcenter
      wrote on last edited by
      #3

      When your UI gets too cramped a good solution is to use the "outliner" the window on top of the properties on the left that shows a tree of all UI elements, you can use it to select elements as well as to drag and drop elements onto other elements like you do in the UI editor.

      I wouldn't recommend organizing different panels into separate widgets because that will make accessing different UI elements harder, you have to create a bunch of extra signals and slots and such. There is absolutely no point in doing so unless you plan to reuse those "panels" - if not, it just adds inconvenience, more typing, more connections. Do not make modular something you don't need to be a module, and you can still access every item through the ui pointer directly.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Ketan Shah
        wrote on last edited by
        #4

        Hi,

        Thanks for your reply.
        Actually my main window consists of many UI elements.
        So while designing I am unable to locate that element which I want to edit/design/modify as there are many elements on top of each other.
        What I want to know is while editing a particular element is there any way that can hide all other elements?

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goblincoding
          wrote on last edited by
          #5

          [quote author="Ketan Shah" date="1358329825"]Hi,
          Thanks for your reply.
          Actually my main window consists of many UI elements.
          So while designing I am unable to locate that element which I want to edit/design/modify as there are many elements on top of each other.[/quote]

          Could you post a screenshot of what you mean? I find it hard to visualise your problem.

          [quote author="Ketan Shah" date="1358329825"]What I want to know is while editing a particular element is there any way that can hide all other elements?[/quote]

          Not as far as I know...

          http://www.goblincoding.com

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            QMartin
            wrote on last edited by
            #6

            Hello!

            I think you can do it with "foreach":http://doc.qt.digia.com/qt/containers.html#the-foreach-keyword, looking for all widgets except the current one, and calling ->hide() on every other. Maybe something like

            @foreach (QWidget *widget, QApplication::topLevelWidgets())
            {
            if (!wigdet->hasFocus())
            widget->hide();
            }@

            Hope it helps.

            Regards

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              QMartin
              wrote on last edited by
              #7

              Mmmm sorry, you want to do it before execution? I agree with goblincoding, the most similar thing to that is to disable every widget, but they aren't hidden.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                Ketan Shah
                wrote on last edited by
                #8

                !http://s13.postimage.org/4mrrvmjxz/test.pnghttp://(Test)!

                I have uploaded the screenshot of my Ui file, please check it.
                The Ui file consists of 3 groupboxes, each groupbox contains some elements.
                The problem is when I want to modify/redesign GroupBox1, I am not able to see it.
                So my question is how can I hide GroupBox and GroupBox2, when I want to redesign GroupBox1? The same goes for other elements too.
                Hope now my question is clear.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goblincoding
                  wrote on last edited by
                  #9

                  OK, now it all makes sense. Your problem is that you aren't making use of Qt's layout system. Have a look at the "widgets and layouts":https://qt-project.org/doc/qt-4.8/widgets-and-layouts.html documentation and pay special attention to "layout management":https://qt-project.org/doc/qt-4.8/layout.html

                  That should help you solve your problem :)

                  EDIT: If you really want to have widgets "on top of each other", have a look at "QStackedWidget":https://qt-project.org/doc/qt-4.8/qstackedwidget.html

                  http://www.goblincoding.com

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    pke62
                    wrote on last edited by
                    #10

                    Or even "QStackedLayout":http://qt-project.org/doc/qt-4.8/qstackedlayout.html.

                    • Phil
                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      Ketan Shah
                      wrote on last edited by
                      #11

                      Hi,

                      Thanks @goblincoding and @pke62 for your replies. It worked.
                      But now I have one more problem while using QStackedWidget.
                      How can I hide the borders of QStackedWidget that appears on all the four sides of it?

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

                        If I understand you correctly, it sounds as if you still aren't using layouts correctly, please see "this previous post":https://qt-project.org/forums/viewthread/23776/#110704 for links to more information.

                        http://www.goblincoding.com

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          pke62
                          wrote on last edited by
                          #13

                          [quote author="goblincoding" date="1358514448"] If you really want to have widgets "on top of each other", have a look at "QStackedWidget":https://qt-project.org/doc/qt-4.8/qstackedwidget.html[/quote]

                          In the documentation for QStackedWidget referenced above by goblincoding, look for:

                          setFrameShadow ( Shadow )
                          setFrameShape ( Shape )
                          setFrameStyle ( int )

                          • Phil
                          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