Skip to content
  • 0 Votes
    9 Posts
    6k Views
    SGaistS

    Use QScreen::availableGeometry. It provides the geometry excluding window manager reserved areas.

  • 0 Votes
    7 Posts
    1k Views
    Chris KawaC

    @Eric-Singer Because my suggestion is not to limit the size of the parent but rather to limit what the layout reports as the minimum size required. minimumSize() returns the minimum amount of space the widget needs to provide so that the layout can fit all the widgets inside it.
    maximumSize() is the size beyond which the layout can't reasonable grow the widgets inside.

    Maximum size is not useful for this case. Your problem is that the parent widget grows too much and it grows because the minimum size of the layout grows i.e. the minimum amount of space required to lay out the widgets inside grows.
    If you return a fake limit, one that is smaller than the sum of all the widgets inside, the parent will be able to keep its size despite all the children in the layout not fitting (visually they will be cropped). You could, for example, return the minimum of the base implementation's value that calculates it based on the content size and some constant value of yours, beyond which you don't want to grow.

    To be honest that's pretty much what a scroll area does and I think the suggestion given by @SGaist is a better one as it already does that work for you.

  • 0 Votes
    3 Posts
    941 Views
    M

    @raven-worx I will look into platform specific code. Thank you.

  • 0 Votes
    4 Posts
    3k Views
    ValentinMicheletV

    @Wilk said:

    The reason that it did not work with QMainWindow or QWidget is that those classes does not implement fullScreen as full featured property - it can not be set with setFullScreen() slot.

    I see, thanks for the precision.

    @Wilk said:

    Thanks alot

    No problem, I hope your bug report will be helpful for other people.