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. All Application Resizing
Forum Updated to NodeBB v4.3 + New Features

All Application Resizing

Scheduled Pinned Locked Moved General and Desktop
12 Posts 6 Posters 5.0k 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.
  • A Offline
    A Offline
    alexspin
    wrote on last edited by
    #1

    Hi all,
    I have write an application for XP in a 1024x768 screen and now I have to resize it on 800x600. How can I do this simply, I have to resize all of the element one by one?
    All of the form I have done with Qt Creator 1.2.0 based on Qt 4.5.2.

    Thanks.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kkrzewniak
      wrote on last edited by
      #2

      Give more info please, have you used any layout management?

      Me, Grimlock, not "nice dino". ME BASH BRAINS!

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on last edited by
        #3

        Be sure to use QLayouts throughout (or anchors if using QML) and it should just work (tm).

        Edit: Just saw you are using Qt 4.5.x so ignore my QML comment.

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alexspin
          wrote on last edited by
          #4

          I'm a newbie of Qt, I've just put some objects in the mainwindow form with the creator.
          How can be used layouts?

          Thanks!

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

            How to use layouts is described in the doc, e.g. "here":http://doc.qt.nokia.com/4.7/layout.html

            Although, if you press F1 in QtCreator you will get the online help which also describes how to build UIs with layouts in QtCreator.

            If you are in the form ui editor, you can select some elements and press on of the layout buttons in the toolbar...

            Nokia Certified Qt Specialist.
            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

            1 Reply Last reply
            0
            • A Offline
              A Offline
              alexspin
              wrote on last edited by
              #6

              I don't use layout, I adjust manually every elements in the form.

              In the object tree the widget have a break layout symbol.

              If I don't use layout management how can I resize it?

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                ZapB
                wrote on last edited by
                #7

                Then maybe you should use layouts? They are much easier than the alternative. What is your reason for not using layouts?

                If you insist on not using them then you will need to override the resizeEvent() function in your mainwindow and manually position your widgets when your are notified by means of the above virtual function.

                I really suggest you look into using layouts.

                Nokia Certified Qt Specialist
                Interested in hearing about Qt related work

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  alexspin
                  wrote on last edited by
                  #8

                  I don't use because I need to copy a particular layout of an other program.

                  If I use layout I can resize completely the form? For example if I have a text with a font size in a QLabel, the font size is scaled also?

                  For the manually position and resize of the widgets, is there some function to do this in a loop? For example like the "for each" cycle of the visual basic?

                  Thanks.

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    ZapB
                    wrote on last edited by
                    #9

                    What is in the other program's layout that you cannot achieve with Qt layouts? Do you have a screen shot of what you are trying to achieve?

                    Nokia Certified Qt Specialist
                    Interested in hearing about Qt related work

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

                      Every toolkit has its own means of laying out items. It's not a very clever idea to force the habits of another toolkit into the new. Better adapt to the new ons. In case of Qt and designer, this is using layouts. There are good tutorials in the docs:

                      • "Layout Management":http://doc.qt.nokia.com/latest/layout.html for a general introduction
                      • "A Quick Start to Qt Designer":http://doc.qt.nokia.com/latest/designer-quick-start.html
                      • "Designer Manual":http://doc.qt.nokia.com/latest/designer-manual.html
                      • "Using Layouts in Qt Designer":http://doc.qt.nokia.com/latest/designer-layouts.html

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

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        kunashir
                        wrote on last edited by
                        #11

                        You can use function @ resize @ of widget, but It is not good idea.
                        Easy rework to layout.

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          alexspin
                          wrote on last edited by
                          #12

                          Ok, I see the tutorials and use the layout.

                          Thanks all for the infos!

                          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