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

QWindowsStyle when changing stylesheet with QProgressBar adds duplicate pointer to bars list

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.6.1
    • 4.5.3
    • Widgets: Style Sheets
    • None
    • 537bff8c020c8fd2c150b2821d1cc035ee96f84f

    Description

      In the QWindowsStyle there is a List of pointers to existing QProgressBars. Each time you change the stylesheet of a copy of each QProgressBars pointers will be added to this list. QWindowsStyle should see if the list contains the pointer already before appending.

      Attached is a test case that demonstrates this. Watching the size of the bars list from inside QWindowsStyle::timerEvent will show the growth.

      --- src/gui/styles/qwindowsstyle.cpp  2009-12-01 15:05:07.112689436 +0100
      +++ src/gui/styles/qwindowsstyle.cpp        2009-12-01 14:56:35.947190348 +0100
      @@ -222,7 +222,9 @@
           case QEvent::StyleChange:
           case QEvent::Show:
               if (QProgressBar *bar = qobject_cast<QProgressBar *>(o)) {
      -            d->bars << bar;
      +            if (!d->bars.contains(bar)){
      +                d->bars << bar;
      +            }
                   if (d->bars.size() == 1) {
                       Q_ASSERT(d->animationFps> 0);
                       d->animateTimer = startTimer(1000 / d->animationFps);
      

      Attachments

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

        Activity

          People

            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            janichol Andy Nichols
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes