Qt World Summit: Register Today!

QPushButton setForeGroundRole

  • I have a push button that I want the test rendered in the Link colour.

    So I did:


    but the text colour stubbornly remained grey. Is this a bug or am I doing this wrong?


  • @Perdrix
    The styles don't have to call foregroundRole() to determine the text color role, so setForegroundRole may not always be effective.
    From the doc:

    Note that styles are free to choose any color from the palette. You can modify the palette or set a style sheet if you don't achieve the result you want with setForegroundRole().

Log in to reply