Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Adding a QProgressbar makes my app cpu consumption pass from 0% to 75-80% of a core

Adding a QProgressbar makes my app cpu consumption pass from 0% to 75-80% of a core

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aidaqt
    wrote on last edited by
    #1

    Hi,

    I'm adding a small QProgressbar to my app, but now I'm realizing that it is taking almost a core. I've read about some bugs related but I cant fix or workaround this issue. Any chances?

    -QT 4.8.4
    -Windows 7

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Maybe you just update it too frequently? Some code would be useful.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aidaqt
        wrote on last edited by
        #3

        I never update it, it is only a default QProgressBar added with the QT Designer.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aidaqt
          wrote on last edited by
          #4

          @int main(int argc, char *argv[])
          {
          QApplication a(argc, argv);
          pruebasqt w;

          QGraphicsDropShadowEffect* wndShadow = new QGraphicsDropShadowEffect;
          wndShadow->setBlurRadius(9.0);
          wndShadow->setColor(QColor(0, 0, 0, 90));
          wndShadow->setOffset(5);
          w.setGraphicsEffect(wndShadow);

          w.setWindowFlags( Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint);
          w.setAttribute(Qt::WA_TranslucentBackground);

          w.setStyleSheet("QWidget{ background: red;}");

          w.show();
          return a.exec();
          }
          @

          Being "pruebasqt" a default QMainWindow with one QProgressBar. This makes 100% of one core in my computer (An Intel Xeon with 8 cores and 26 Gb RAM)

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aidaqt
            wrote on last edited by
            #5

            Can anyone reproduce this behaviour? I think this could be a bug.

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              Hi,

              Does it still happen if you upgrade to Qt 4.8.5?

              What happens if you delete lines 6 to 15?

              What happens if you don't add the QProgressBar?

              What are the related bugs that you've found?

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • A Offline
                A Offline
                aidaqt
                wrote on last edited by
                #7

                https://bugreports.qt-project.org/browse/QTBUG-20880

                The problem appears when combining the setGraphicsEffect with a QProgressBar. Can you reproduce this?

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  aidaqt
                  wrote on last edited by
                  #8

                  Full compilable version:

                  @
                  #include <QtGui/QApplication>
                  #include <QGraphicsDropShadowEffect>
                  #include <QProgressbar>

                  int main(int argc, char *argv[])
                  {
                  QApplication a(argc, argv);

                  QWidget* w = new QWidget();
                  w->setGeometry(40,40,1600,1000);
                  QProgressBar* qp = new QProgressBar(w);
                  qp->setValue(99);

                  QGraphicsDropShadowEffect* wndShadow = new QGraphicsDropShadowEffect;
                  w->setGraphicsEffect(wndShadow);

                  w->show();
                  return a.exec();
                  }
                  @

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved