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. At the paint event after applying the style sheet to the button
Qt 6.11 is out! See what's new in the release blog

At the paint event after applying the style sheet to the button

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

    I applied a stylesheet to the button.
    And in that class I declared a paintEvent and painted the line.

    If you check after execution, all applied style sheets will disappear.
    Is there a way to draw the drawline with the stylesheet preserved?

    cf49d356-9474-4eb4-919e-341a3e978d9e-image.png

    a2b5f36b-443c-4e89-a6ca-a00991f94753-image.png

    Pl45m4P 1 Reply Last reply
    0
    • I IknowQT

      I applied a stylesheet to the button.
      And in that class I declared a paintEvent and painted the line.

      If you check after execution, all applied style sheets will disappear.
      Is there a way to draw the drawline with the stylesheet preserved?

      cf49d356-9474-4eb4-919e-341a3e978d9e-image.png

      a2b5f36b-443c-4e89-a6ca-a00991f94753-image.png

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @IknowQT

      Why you need stylesheet when you use the paintEvent anyway? How does your paintEvent look like? Do you call the base implementation of QPushButton::paintEvent afterwards? It could overwrite your custom style


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      2

      • Login

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