Nominate our 2022 Qt Champions!

Draw partial background and dot on QPushButton

  • In my application I want to display quite some info on a QPushbutton by partially coloring the background, see - Coloring the left upper corner grey, the main body yellow, and drawing the small dot in the bottom right corner each identifies a certain setting, and each of them can independently of each other occur.

    How can I achieve such things? Do I need to turn to QPainter?

  • Lifetime Qt Champion


    Yes, QPainter is a good way to achieve that. Depending on the number of different colors you want to use, you could use pre-rendered images and only write the text at the right place.

    Hope it helps.

Log in to reply