Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. sizepolicy
    Log in to post

    • UNSOLVED Resizing widgets in the window having minimumsize
      General and Desktop • sizepolicy qt c++ widget resize resizing minimum size • • Swati777999  

      1
      0
      Votes
      1
      Posts
      35
      Views

      No one has replied

    • UNSOLVED Button not collinear with QGroupBox
      General and Desktop • qpushbutton qgroupbox sizepolicy stackedwidget • • TUStudi  

      4
      0
      Votes
      4
      Posts
      221
      Views

      @TUStudi Try a cascading horizontal + vertical layout for your page. Could be an issue with the stretch of the last column, where your green button lives or the QGridLayout in general. Edit: Yeah, that's probably it. Gridlayouts can have "empty" cells... Your two groupBoxes with your options take two cells above the button, which takes one, but expands to full size. As soon as you hide the content (grpBox 2nd opt) of second column, the gridLayout only has three rows (grpBx radio, grpBx first, green btn), but the QGridLayout won't delete its second column, but will leave it just empty and this takes some (little) space. Probably exact that amount of space, the green button expands to the right (aligning to the outter border of your grid). So try horizontal + vertical layouts or check, if there really is some empty cell (which should be, since you don't take the widget but just hide it). QGridLayout::columnCount() should return (at least) 2 when your app is in "small" mode (and also 2 or 3 when you switch to "big")
    • SOLVED How to fit a QWidget children in a QWidget parent?
      General and Desktop • qwidget size geometry sizepolicy parent & child • • cristiano.narcisi  

      8
      0
      Votes
      8
      Posts
      2418
      Views

      @JonB I am passing to QML for this reason. There, placement and dimensioning of graph oblect is very easy to do. I like also the stong division between frontend a nd backend!!!
    • UNSOLVED Problem size policy in QStackedWidget
      General and Desktop • qstackedwidget sizepolicy • • Loic B.  

      14
      0
      Votes
      14
      Posts
      3126
      Views

      You're correct and that's a good question. What version of Designer are you using ?
    • SOLVED Resizing the widget(listwidget)
      General and Desktop • qtcreator resize sizepolicy listwidget • • Kinesis  

      10
      0
      Votes
      10
      Posts
      2402
      Views

      @jsulm I got this, thanks
    • UNSOLVED Widgets proportions in QSplitter
      General and Desktop • sizepolicy qsplitter stretch • • voltron  

      1
      0
      Votes
      1
      Posts
      723
      Views

      No one has replied

    • UNSOLVED I can't figure out what size polices to use to get widgets laid out the way I want
      General and Desktop • layout designer sizepolicy • • Guy Gizmo  

      3
      0
      Votes
      3
      Posts
      1111
      Views

      @VRonin said in I can't figure out what size polices to use to get widgets laid out the way I want: what layouts are you placing in this widget? I'm using QGridLayout
    • Initial size of QToolBox is not suitable for its content
      General and Desktop • sizepolicy sizehint qtoolbox • • thEClaw  

      11
      0
      Votes
      11
      Posts
      4996
      Views

      Can you run a little test ? What do you get if you call qDebug() << yourToolBox->sizeHint(); before and after it's shown ?
    • SOLVED [SOLVED] Help with size policy docked vs. undocked
      General and Desktop • sizepolicy dockwidget • • pmh4514  

      8
      0
      Votes
      8
      Posts
      1920
      Views

      very cool. I like it! thanks again
    • QToolBar - real Icon Size / Minimum Size
      General and Desktop • size qtoolbar qaction icon icons sizepolicy sizehint • • Cluosh  

      2
      0
      Votes
      2
      Posts
      2152
      Views

      The thing is that toolbars don't really display icons. They display widgets (that can have icons). By default when you add an action to a toolbar a QToolButton is created for it, but you are not limited to that and can add any widget e.g. an expanding line edit, combobox or a button with an icon and text. All of these can have different size policies, be expanding or have a custom stylesheet applied. All of this makes calculating such size not feasible because how would you calculate it if a widget can change its size. What I'm saying is that yours is a special, very specific case (with just icons), and as such you need to handle it yourself if you want to. To answer your questions: It's not one thing that adds the space. There are couple of aspects that can contribute. You can control some(or all?) of them with stylesheets e.g. set padding of the toolbar and toolbuttons to 0 and margins and borders of the toolbuttons. By default all of these depend on a style and will vary across computers. You also need to be careful to consider the size of the toolbar handle (if it's movable) as its size depends on the active style. You also need to consider that if the icon is narrower than the iconSize then there's gonna by space left anyway. nope, AFAIK it can vary from one item of the toolbar to another if you set it this way nope and just out of curiosity - why do you need that? The bar will display an arrow button that will let you see the overflowing items. Also such calculated size would be useless as the window can be resized and thus the toolbar too (unless you're doing some really fancy layout).
    • QMainWindow: size management of central widget and dock widgets
      General and Desktop • qmainwindow sizepolicy dockwidget • • dimonomid  

      1
      0
      Votes
      1
      Posts
      2654
      Views

      No one has replied

    • Fixed sizes widget
      General and Desktop • qwidget widget sizepolicy • • Vitek  

      2
      0
      Votes
      2
      Posts
      712
      Views

      Read about QWidget::setSizePolicy();
    • QStackedLayout and QStackedWidget always taking all available space
      General and Desktop • sizepolicy stretch qstackedlayout • • eduardomezencio  

      1
      0
      Votes
      1
      Posts
      724
      Views

      No one has replied

    • Square custom QWidgets inside QGridLayout inside QScrollArea
      General and Desktop • gridlayout sizepolicy scrollarea • • blashyrk  

      2
      0
      Votes
      2
      Posts
      1352
      Views

      Solution here if anyone runs into the same problem: http://stackoverflow.com/questions/30672183/square-custom-qwidgets-inside-qgridlayout-inside-qscrollarea
    • QLineEdit doesn't stretch to occupy full space in the layout
      General and Desktop • mac qlineedit qgridlayout sizepolicy stretch qtformac • • bharath144  

      2
      0
      Votes
      2
      Posts
      2334
      Views

      Hi, this is old now but in case someone else finds this: I managed to solve this problem by using setSizeConstraint(QtWidgets.QLayout.SetNoConstraint) for a layout holding the QLineEdit widget. Actually it wasn't the layout holding the widget, but the layout holding that layout, so you may need to experiment to find out where you need to make this update (or just use SetNoConstraint for all your layouts) I hope this helps someone!