Qt - style sheet for custom mouse button hangs and is pressed

I would like to have an invisible button, but when the user hovered over it, I would like to have a blue color, and when he clicks on it, I would like to have a darker blue color.

After doing some research, I realized that I can use the stylesheets function, but im new on Qt, and I have no experience in Qt, so I would rather ask and find out.

+8
stylesheet qt button
source share
1 answer
yourBtn->setStyleSheet("QPushButton{background:url(:/Resources/pause_nor.png);border:0px;}" "QPushButton:hover{background:url(:/Resources/pause_over.png);border:0px}" "QPushButton:pressed{background:url(:/Resources/pause_over.png); position: relative;top: 1px; left: 1px;}"); 
+11
source share

All Articles