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

possible stackoverflow calling setWindowFlag() in style polish & unpolish

    XMLWordPrintable

Details

    • All

    Description

      When a style is calling QWidget::setWindowFlag() inside polish/unpolish to set e.g. Qt::NoDropShadowWindowHint it might create an endless loop when there is also a stylesheet involved.

      main.cpp:

      QComboBox cbx;
      cbx.show();
      a.setStyleSheet("blub");
      

      Then add something like this in style polish/unpolsih (see e.g. https://codereview.qt-project.org/c/qt/qtbase/+/613492)

      polish(QWidget* widget) {
          widget->setWindowFlag(Qt::NoDropShadowWindowHint, true);
      }
      unpolish(QWidget* widget) {
          widget->setWindowFlag(Qt::NoDropShadowWindowHint, false);
      }
      

      This gives a stackoverflow like this:

      Attachments

        For Gerrit Dashboard: QTBUG-133332
        # Subject Branch Project Status CR V

        Activity

          People

            chehrlic Christian Ehrlicher
            chehrlic Christian Ehrlicher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change