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

QTreeView + setColumnWidth + StyleSheet + QStackedWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.4, 6.6.1
    • Widgets: Style Sheets
    • None
    • Windows

    Description

      Good morning,
      since I installed the QT version 6.6.1/6.5.4 I have encountered anomalous behavior.

      If I use a QStackedWidget, a QTreeView, use stylesheets and try to set the size of the tree view columns, this happens:

      1) I set the stylesheet in main.cpp;
      I create the MainWindow.

      With this declaration the columns are sized to 100 and my settings are not respected.

      2) If I remove the style sheet in main.cpp everything works correctly;

      3) leaving the style sheet, to make everything work I have to:
      in the MyWidget class, to the QTreeView, I have to pass the stacked widget as parent and not this;
      in the MainWindow class I have to create the container, call setCentralWidget, create the MyClass instance and pass the stacked widget contained in the container as a parent.

      I attach a small example project.
      In the MainWindow.cpp file activate the define NO_ERROR to make the program work correctly.

      In Qt version 6.6.0 everything worked correctly.

      I tried the one suggested in BUG120418 but it doesn't work.

      Attachments

        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
            dario_ Dario Baffioni
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes