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. [Solved]Repaint widget after qss
Forum Updated to NodeBB v4.3 + New Features

[Solved]Repaint widget after qss

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.7k 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.
  • R Offline
    R Offline
    Ruzik
    wrote on last edited by
    #1

    Hellow!
    I have qss code:
    @QPushButton[checked=false]{
    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
    stop: 0 #8cfa25, stop: 1 #68d601);
    border-radius: 4px;
    border: 1px solid #8f8f91;
    min-height: 60px;
    min-width: 60px;
    }
    QPushButton[checked=true]{
    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
    stop: 0 #fa9090, stop: 1 #d66c6c);
    border-radius: 4px;
    border: 1px solid #8f8f91;
    min-height: 60px;
    min-width: 60px;
    }@
    When i click on the button, there is no repaint and button lukes like uncheked, but it is cheked
    How can i fix it?
    In advance many thanks for your help!

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Hi Ruzik,

      Are you sure, the button is checkable?
      Pressing the button is not checking it automatically.

      It must have the property

      @
      checkable = true
      @

      And I'm not 100% sure, whether clicking a checkable button also checks it, it should do, but I'm not sure.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Ruzik
        wrote on last edited by
        #3

        The Button was chekable
        To this worke after pressing of pushButton we must call method QWidget::setStyleSheet("")

        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