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 resize the QDockWidget?
Forum Updated to NodeBB v4.3 + New Features

How to resize the QDockWidget?

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 9.1k 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.
  • Y Offline
    Y Offline
    yunxiaodong
    wrote on last edited by
    #1

    I cant find the way to resize a QDockWidget in QMainWindow.

    I love peace.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rokemoon
      wrote on last edited by
      #2

      You can use "resize":http://doc.qt.nokia.com/latest/qwidget.html#size-prop

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        yunxiaodong
        wrote on last edited by
        #3

        The function QWidget::resize() is no use for QDockWidget which in QMainWindow.Because QDockWidget controled by the Layout of QMainWindow.

        I love peace.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rokemoon
          wrote on last edited by
          #4

          [quote author="yunxiaodong" date="1313485153"]The function QWidget::resize() is no use for QDockWidget which in QMainWindow.Because QDockWidget controled by the Layout of QMainWindow.[/quote]
          Yes, you are right when QDockWidget in layout resize() don't work it work only if the widgets are floating (i.e. not docked). Sorry for misunderstanding.

          1 Reply Last reply
          0
          • EddyE Offline
            EddyE Offline
            Eddy
            wrote on last edited by
            #5

            I don't know what you want to do exactly.

            you could try
            setminimumsize()

            Qt Certified Specialist
            www.edalsolutions.be

            1 Reply Last reply
            0
            • Y Offline
              Y Offline
              yunxiaodong
              wrote on last edited by
              #6

              In my application, input width and height,and I set the dockwidget use this two pama.

              I love peace.

              1 Reply Last reply
              0
              • EddyE Offline
                EddyE Offline
                Eddy
                wrote on last edited by
                #7

                Does it mean that when you alter these parameters, the contents of your dockwidget changes? eg. more widgets, longer text in widgets...It seems strange to handle sizes this way.Since you are in a layout the contents of the widgets will drive the size of the dock.

                Can you elaborate some more on your usecase? Why do you want the sizes to change using these parameters?

                Qt Certified Specialist
                www.edalsolutions.be

                1 Reply Last reply
                0
                • Y Offline
                  Y Offline
                  yunxiaodong
                  wrote on last edited by
                  #8

                  When my application closing, I save the current state of this mainwindow's dockwidgets to xml, next time the app start up, i restore the state of this mainwindow's dockwidgets accroding xml.

                  I love peace.

                  1 Reply Last reply
                  0
                  • EddyE Offline
                    EddyE Offline
                    Eddy
                    wrote on last edited by
                    #9

                    form the "docs :":http://doc.qt.nokia.com/4.7/qmainwindow.html#storing-state

                    Storing StateQMainWindow can store the state of its layout with saveState(); it can later be retrieved with restoreState(). It is the position and size (relative to the size of the main window) of the toolbars and dock widgets that are stored.

                    Qt Certified Specialist
                    www.edalsolutions.be

                    1 Reply Last reply
                    0
                    • Y Offline
                      Y Offline
                      yunxiaodong
                      wrote on last edited by
                      #10

                      yes,you side it. I knew this method before,but saveState() cant get more details. i need more details,such as toolbar name, detail of every action in toolbar and so on. so i must realize by myself. my application is framework-plugin.

                      I love peace.

                      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