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

Removing stylesheet doesn't remove size constraints

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.11.2
    • 5.11
    • Widgets: Style Sheets
    • None
    • 856284d525f7c7958e76843cac46d718f5325275

    Description

      If you set size constraints via style sheet they should be removed when you remove the style sheet.

      Test case:

      #include <QtWidgets>
      #include <QDebug>
      
      int main (int a, char **b)
      {
          QApplication app(a, b);
          QWidget w;
          w.show();
          qDebug() << "Before everything: min_size=" << w.minimumSize();
      
          w.setStyleSheet("QWidget { min-height: 50; max-height: 50;} ");
          qDebug() << "After setting constraints: min_size=" << w.minimumSize();
      
          w.setStyleSheet("QWidget { min-height: 50; max-height: 50;} ");
          qDebug() << "After removing stylesheet: min_size=" << w.minimumSize();
      
          return 0;
      }
      
      

      Attachments

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

        Activity

          People

            iamsergio Sergio Martins
            iamsergio Sergio Martins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes