athulms
19th October 2011, 11:34
how to call a function when i enter and leave a qpushbutton.
I have to change the style sheet on enter and leave of pushbutton.
It works in stylesheets
ui->savename->setStyleSheet("QPushButton{background-repeat:no-repeat; background:none; border:none; background-image: url(images/PlayernamesaveOff.png);} QPushButton:hover{background-repeat:no-repeat; background:none; border:none; background-image:url(images/PlayernamesaveOn.png)};");
when i resize my window resize event is called. I resize event i change the size of my pushbutton also.Since the picture does not resize i used seticon property and set the image as scaled pixmap. Its works but i cannot apply the mouse over and leave effects
I have to change the style sheet on enter and leave of pushbutton.
It works in stylesheets
ui->savename->setStyleSheet("QPushButton{background-repeat:no-repeat; background:none; border:none; background-image: url(images/PlayernamesaveOff.png);} QPushButton:hover{background-repeat:no-repeat; background:none; border:none; background-image:url(images/PlayernamesaveOn.png)};");
when i resize my window resize event is called. I resize event i change the size of my pushbutton also.Since the picture does not resize i used seticon property and set the image as scaled pixmap. Its works but i cannot apply the mouse over and leave effects