QSizePolicy::Fixed and QGraphicsLayoutItem - confusion



  • When I use QGraphicsLayouts, and SizePolicy "fixed", which of the sizeHints is actually used?

    In the enum QSizePolicy::Policy, the policy "Fixed" is described as:

    bq. The QWidget::sizeHint() is the only acceptable alternative, so the widget can never grow or shrink (e.g. the vertical direction of a push button).

    However, for a QGraphicsLayoutItem, no sizeHint() exists - the overload requires that a specific sizeHint (either minimum, maximum or preferred) is returned.

    In consequence, if I want to use the "Fixed" policy, do I

    • just set the preferred size, or
    • set minimum and maximum size, or
    • set minimum, maximum AND preferred size
      ?

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.