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

Setting stylesheet breaks consistency between platforms

    XMLWordPrintable

Details

    • Linux/X11, WebAssembly, Windows

    Description

      Reproducer attached. It's a QCalendarWidget embedded in a QWidget and manged by QVHoxLayout. The problem is that the rendering result is different on desktop (say Windows or Linux) and on WASM. This is how it looks on desktop:

      Although it is little weird already (text in quite many cells are elided), all of cells are rendered. But this is how it looks on WASM:

      Many cells are just empty.

      I assume it is stylesheet breaking the size hints and/or layout somehow. Since everything works just fine if you comment out

      QString style = QString::fromStdString(szCss);
      

      Or, you can also give the main QWidget a larger size, i.e. uncomment

      main->resize(main->size() * 2);
      

      So my rough guess is that the style (especially those defined in pixels) may confuse widget sizing somehow.

      Attachments

        1. image-2025-01-21-18-03-04-366.png
          8 kB
          Luqiao Chen
        2. image-2025-01-21-18-04-18-979.png
          42 kB
          Luqiao Chen
        3. QTBUG-133031.7z
          1 kB
          Luqiao Chen
        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
            luqiaochen Luqiao Chen
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes