Sunday 15 September 2013

Qt QPushbutton:hover not work -



Qt QPushbutton:hover not work -

the next qt codes:

mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent),ui(new ui::mainwindow) { ui->setupui(this); ui->result_button->setstylesheet("qpushbutton{border:none}; qpushbutton:hover{border-image:url(:/images/splitter_button_left)}"); }

when hover mouse on result_button, image not display. why? , how create button transparent when hovering show?

your stylesheet wrong. should be:

ui->result_button->setstylesheet("qpushbutton{border:none;} qpushbutton:hover{border-image:url(:/images/splitter_button_left);}");

note positions of ; characters.

qt

No comments:

Post a Comment