PDA

View Full Version : QToolButton pressed effect



chenxuelian
26th February 2010, 09:07
Hi everyone,
i have some questions to ask you.when a toolbutton pressed, as everyone know, it moves down 1px.
but i want to get an effect that when a toolbutton pressed ,it moves up 1px.please ,how can i do.

chenxuelian
26th February 2010, 09:35
i use CSS,but not succeed.
QToolButton:pressed {
position:absolute;
top: 20px;
left: 50px; /* shift it a bit */
}

zgulser
26th February 2010, 11:11
Hi,

You can do it as chenxuelian suggested, but if you want all your tool buttons to have this property, you can do something like the following;


QString styleSheet = "QToolButton:pressed{ position:absolute;top: 20px;left: 50px; /* shift it a bit */ };"
QApplication::instance()->setStyleSheet(styleSheet);

chenxuelian
3rd March 2010, 07:03
thanks for your answer,but useing css not succeed