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. qwidget resize function
Forum Update on Monday, May 27th 2025

qwidget resize function

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 2.4k Views
  • 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
    geor
    wrote on 8 Aug 2016, 13:24 last edited by
    #1

    hello,
    Let's say i resize a widget to(700,700) and it's inside a widget that is inside a scroll area why is the size that is set not independant of the screen? on a smaller screen it will set a smaller height...
    How can I make it independent?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Aug 2016, 21:40 last edited by
      #2

      Hi,

      How did you put that widget inside that other widget inside that scroll area ?

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

      G 1 Reply Last reply 9 Aug 2016, 13:26
      2
      • S SGaist
        8 Aug 2016, 21:40

        Hi,

        How did you put that widget inside that other widget inside that scroll area ?

        G Offline
        G Offline
        geor
        wrote on 9 Aug 2016, 13:26 last edited by
        #3

        @SGaist there is a widget that is the main widget of the mainwindow(called widgettest) inside it there is 5 subwidgets each having a subSubwidget insde them
        I tam trying to resize the subSub widgets

        scroll = new QScrollArea(this);// seting Main Window as the parent of the widget that contains evrithing                       
        this->setCentralWidget(scroll);// setiing that widget as the central widget;
        scroll->setWidget(ui->widgettest);// widget test is the random widget that contains evrithing
        scroll->setWidgetResizable(true);// this makes the iwdgets as big as possible
        

        but my question when you resize a widget is with resize(int w, int h) is w and h in pixels? or something else? is the reize independent of the screnn? if I do subsubwidget->resize(500,500); it's always gonna be 500 pixels by 500?

        also main window applys a layout to the widgettest and idget test applys a layout to the subwidgets and the subsubwidgets have a layout inside the sub widgets wich delete at run time to resize..

        thank you

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 Aug 2016, 20:54 last edited by
          #4

          It's in pixel.

          QMainWindow doesn't apply any particular layout. It will resize the central widget if you resize the window.

          If you want to handle the size of your sub-sub widget by hand, you should not put it in a layout otherwise it's the layout manager that will manage the size and position of it.

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

          G 1 Reply Last reply 10 Aug 2016, 13:28
          1
          • S SGaist
            9 Aug 2016, 20:54

            It's in pixel.

            QMainWindow doesn't apply any particular layout. It will resize the central widget if you resize the window.

            If you want to handle the size of your sub-sub widget by hand, you should not put it in a layout otherwise it's the layout manager that will manage the size and position of it.

            G Offline
            G Offline
            geor
            wrote on 10 Aug 2016, 13:28 last edited by
            #5

            @SGaist yes but the thing is that I delete the layout of the sub widget of the subsubwidget and then reaply it after I resize the subsubwidget you think I should not reaplly it? the ting is my subwidget has a minimum size of 1000 pixels I dont understand why on a smaller sccreen it does not take that minimum size and shrinks to 800..

            M 1 Reply Last reply 10 Aug 2016, 13:35
            0
            • G geor
              10 Aug 2016, 13:28

              @SGaist yes but the thing is that I delete the layout of the sub widget of the subsubwidget and then reaply it after I resize the subsubwidget you think I should not reaplly it? the ting is my subwidget has a minimum size of 1000 pixels I dont understand why on a smaller sccreen it does not take that minimum size and shrinks to 800..

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 10 Aug 2016, 13:35 last edited by mrjj 8 Oct 2016, 13:35
              #6

              @geor
              just a thought
              did u call setMinimumH/W on the widget?

              1 Reply Last reply
              1

              1/6

              8 Aug 2016, 13:24

              • Login

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