Navigation

    Qt Forum

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

    • UNSOLVED What is "hint" and for what is it good for?
      General and Desktop • size sizehint • • firen  

      4
      0
      Votes
      4
      Posts
      69
      Views

      @firen Read "Size Hints and Size Policies" in https://doc.qt.io/qt-5/qwidget.html
    • UNSOLVED 自訂的QWidget無法用adjustSize取的在layout裡的size
      Chinese • qwidget pyqt5 pyqt sizehint adjustsize • • darrenleeleelee1  

      1
      0
      Votes
      1
      Posts
      136
      Views

      No one has replied

    • SOLVED How to resize QListView row to index widget size
      General and Desktop • resize qlistview view row sizehint • • sm4ll-3gg  

      8
      0
      Votes
      8
      Posts
      4095
      Views

      @sm4ll-3gg said in How to resize QListView row to index widget size: what I should read to better understand Model / View / Delegate programming? Basically everything I know comes from Advanced Qt Prgramming: Creating Great Software with C++ and Qt4 It is normal to set new delegate for each item if I need to show heterogeneous data in list? No. What I would do is create a QStackedWidget with the possible combinations, use that as base and display the correct page based on the data in the index
    • SOLVED Wrong rich text height (QTextDocument) in item rendered by custom item delegate
      General and Desktop • linux windows qitemdelegate sizehint rich text • • michalos  

      2
      0
      Votes
      2
      Posts
      1639
      Views

      Terribly sorry, but it turned out to be my fault all along. The line responsible was: textDoc.setDocumentMargin(0); in the sizeHint() method.
    • Initial size of QToolBox is not suitable for its content
      General and Desktop • sizepolicy sizehint qtoolbox • • thEClaw  

      11
      0
      Votes
      11
      Posts
      4994
      Views

      Can you run a little test ? What do you get if you call qDebug() << yourToolBox->sizeHint(); before and after it's shown ?
    • QToolBar - real Icon Size / Minimum Size
      General and Desktop • size qtoolbar qaction icon icons sizepolicy sizehint • • Cluosh  

      2
      0
      Votes
      2
      Posts
      2151
      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).
    • pyqt delegate text wrapping sizeHint and paint
      General and Desktop • delegate paint sizehint • • lukeQt  

      1
      0
      Votes
      1
      Posts
      1385
      Views

      No one has replied