Re: Set a ToolButton Hovered
Re: Set a ToolButton Hovered
Create a QHoverEvent manually and send it like this.
Re: Set a ToolButton Hovered
Re: Set a ToolButton Hovered
can u set these stylesheets while keyPressEvent() occurs ..? but i think hover is only used on mouse event ... ! but can u change the pseudo state of button manually ..
Re: Set a ToolButton Hovered
Hello Sir ,
the Stylesheets are applied to the buttons already & its working fine with mouse events.
My requirement is to change the state i.e. from unselected button to the hovered button without moving mouse over it.
The button should be in hovered state .
In other words , just need to shift focus from one button to another when we press a arrow keys , like we set in other languages like setTabOrder() in HTML , setTabIndex()
Re: Set a ToolButton Hovered
Quote:
Originally Posted by
vajindarladdad
In other words , just need to shift focus from one button to another
Setting focus is different from hovering. Did you try what I suggested ?
1 Attachment(s)
Re: Set a ToolButton Hovered
Hi All & YogeshGokul,
I tried what you all suggested but it is still not working .
I have attached a trial project in which i have created the object of QHoverEvent & invoking the event.
Please... Please let me know where i am going wrong.
This is the function where i want to make the QToolButton Hovered.
Code:
{
QPoint newPos
(toolButton
->pos
().
x()+5,toolButton
->pos
().
y()+10);
qDebug("ToolButton Position %d %d",newPos.x(),newPos.y());
qDebug("Cursor Position %d %d",oldPos.x(),oldPos.y());
qDebug("In Widget::keyPressEvent");
}