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
Forum Updated to NodeBB v4.3 + New Features

custom progress threading

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 364 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 14 Jun 2021, 08:02 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?

    J 1 Reply Last reply 14 Jun 2021, 08:10
    0
    • I IknowQT
      14 Jun 2021, 08:02

      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?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 14 Jun 2021, 08:10 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 14 Jun 2021, 23:15 last edited by
        #3

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

        J 1 Reply Last reply 15 Jun 2021, 05:12
        0
        • I Offline
          I Offline
          IknowQT
          wrote on 15 Jun 2021, 02:20 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
            14 Jun 2021, 23:15

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

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 15 Jun 2021, 05:12 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 15 Jun 2021, 06:46 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

              1/6

              14 Jun 2021, 08:02

              • Login

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