Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-121536

Consider ways to handle fixed size widgets on systems where this is unsupported

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • Widgets: Layout
    • None
    • All

    Description

      Setting a minimum and maximum size on a QWidget is basically treated as a hint, but is currently not documented as such. Sometimes the platform (e.g. on fullscreen platforms) will not support the size constraints, and we need to find a way to recover. The typical recovery in Qt is currently to resize the window the system preference and break the min/max constraints.

      The QWindow::setMinimumSize docs accounts for this and calls the size a hint for the system. But for QWidget the documentation says more strictly that the widget will never be smaller than its minimum size.

      So the question is what to do on platforms where we cannot respect the minimum/maximum size.

      This came up recently in QTBUG-121445: A recent change on Wayland caused it to apply the same recovery as on other platforms, because neglecting to respect the system's requirements on this is considered a protocol error and the connection to the compositor will shut down, hence the application will crash. Unfortunately, this is experienced as a regression on compositors which previously chose to ignore the protocol error and let the application have its way.

      There is a lot of discussion on QTBUG-121445 which is relevant to this. In the end, the suggestion was that QWidget should respect the size constraints even if the underlying window does not (so if the window is smaller, then it will be clipped). So basically the same behavior as putting the widget into a different top-level window without adding it to a layout. This would cause the implementation to follow the QWidget docs and existing apps which make assumptions based on this promise will continue to work when ported to the non-compliant platforms.

      Alternatively, we could update the documentation to match QWindow and also document how to implement the cropping mechanism using the existing API.

      Since the discussion was confined to a very platform-specific crowd, we're making this to bring the discussion to those in a position to make the decision here.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              esabraha Eskil Abrahamsen Blomfeldt
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes