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
QtWS25 Last Chance

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.
  • georG Offline
    georG Offline
    geor
    wrote on 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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

      georG 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

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

        georG Offline
        georG Offline
        geor
        wrote on 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
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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

          georG 1 Reply Last reply
          1
          • SGaistS SGaist

            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.

            georG Offline
            georG Offline
            geor
            wrote on 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..

            mrjjM 1 Reply Last reply
            0
            • georG geor

              @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..

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

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

              1 Reply Last reply
              1

              • Login

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