how to set focus on widget if it is selected??
Hi All,
I've created some small window ( derived from Qwidget), and place it in top of another QWidget. My requirment is ,If i select any small window then it should be focused and border need to be green. I override the paintevent(0 methode and did like following.
Code:
this->setStyleSheet("border: 2px solid Red");
this->setFocus();
But its not working? Can any bold tell me how to achive this.?
Thank u all.
Re: how to set focus on widget if it is selected??
Donot set style sheet in painEvent .
You only need to set the stylesheet initially.
Code:
border: 3px solid green;
}
But if you use stylesheet, you will need to set its background and other things too. It simply wont draw border on top of the widget.
Re: how to set focus on widget if it is selected??
Quote:
Originally Posted by
aamer4yu
Donot set style sheet in painEvent .
You only need to set the stylesheet initially.
Code:
border: 3px solid green;
}
But if you use stylesheet, you will need to set its background and other things too. It simply wont draw border on top of the widget.
HI i set the style sheet in c'tor. still its not changing the border. Ny other way to focus on a widget if it selected as in above descriptiuon?????
Re: how to set focus on widget if it is selected??
Hi All.
Till nw i'm not stick with this problem. Plz help.