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. custom progress threading
QtWS25 Last Chance

custom progress threading

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 357 Views
  • 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    1d22c455-0d2b-47b4-90c8-a06e18ec3519-image.png

    Python changes the progress to setstylesheet, so how do I do it in c++? I changed the values one by one through the thread, but I can't tell if the screen is not updated.

    Has anyone experienced anything similar to me? It's the style attribute of the qframe.

    QFrame
    {
    background-color: qconicalgradient(cx:0.5, cy:0.5, angle:90, stop:0.749 rgba(54, 74, 118, 0), stop:0.750 rgba(4, 174, 151, 255));
    border-radius:150px;
    }

    In Python, you only need to change the value of the stop. How can you do it in a c++ environment?

    jsulmJ 1 Reply Last reply
    0
    • I IknowQT

      1d22c455-0d2b-47b4-90c8-a06e18ec3519-image.png

      Python changes the progress to setstylesheet, so how do I do it in c++? I changed the values one by one through the thread, but I can't tell if the screen is not updated.

      Has anyone experienced anything similar to me? It's the style attribute of the qframe.

      QFrame
      {
      background-color: qconicalgradient(cx:0.5, cy:0.5, angle:90, stop:0.749 rgba(54, 74, 118, 0), stop:0.750 rgba(4, 174, 151, 255));
      border-radius:150px;
      }

      In Python, you only need to change the value of the stop. How can you do it in a c++ environment?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @IknowQT said in custom progress threading:

      How can you do it in a c++ environment?

      In the same way you do it in Python. Style-sheets have nothing to do with Python or C++. You should show your current C++ code.
      "I changed the values one by one through the thread" - do you mean from another thread? If so, then this is NOT supported! Only GUI thread is allowed to change the UI.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • I Offline
        I Offline
        IknowQT
        wrote on last edited by
        #3

        What did you do?
        Do I have to define the paintEvent(QPaintEvent*e) function and put redraw code in it?

        jsulmJ 1 Reply Last reply
        0
        • I Offline
          I Offline
          IknowQT
          wrote on last edited by
          #4

          c1ec7c61-1dbf-4803-a5ad-72dfcb6a4d10-image.png

          68b3b542-0434-42b3-a59c-c37942dd01bd-image.png

          Thanks for the answers. I drew it on the back using the drawPie function.
          But after drawing it in the back, I think I'm a little short of a pixel.
          And since I drew it on the back of the shadow, it looks a little dark even if it's the same color.
          The bright one on the top is applied as a style sheet. The dark one is drawn as a paint function. Is there a way to make it look as neat as the style sheet?

          1 Reply Last reply
          0
          • I IknowQT

            What did you do?
            Do I have to define the paintEvent(QPaintEvent*e) function and put redraw code in it?

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @IknowQT said in custom progress threading:

            What did you do?
            Do I have to define the paintEvent(QPaintEvent*e) function and put redraw code in it?

            Why paint event? You were talking about setting style-sheet? So, do the same you did in Python in C++.
            "I think I'm a little short of a pixel" - not sure what you mean, if you want anti-aliasing then set QPainter::Antialiasing via https://doc.qt.io/qt-5/qpainter.html#setRenderHint

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2
            • I Offline
              I Offline
              IknowQT
              wrote on last edited by
              #6

              Thank you. It's all worked out!

              Let me ask you one more question. There's a translucent background in QFrame.

              QFrame
              {
              border-radius:150px;
              background-color: rgb(54, 74, 128, 120);
              }

              If I do drawpie, I want to put it on a translucent layout. Now I'm drawing in the back, so it's darker than th

              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