How to select one widget in multipled widgets layout?
-
!http://i46.tinypic.com/v6ntj4.png(Picture)!
I put 3 widgets in the layout . I want to select one , then use the toolbar to operate on the selected one .I am new to Qt , if anybody can help me?
Thank you! -
Hello.
I guess you may try method hasFocus or something like this to find out, which widget is selected. -
enum "the 3 widgets in the layout"
use hasFocus to check which one
bool "hasFocus":http://qt-project.org/doc/qt-4.8/qwidget.html#focus-prop () const
bool hasEditFocus () const
-
thank you.
If I select the widget,i want to highlight it to let the user he has selected it.
I have tried setFocus and hasFocus,but it doesn't work.[quote author="noregister" date="1340257665"]
enum "the 3 widgets in the layout"use hasFocus to check which one
bool "hasFocus":http://qt-project.org/doc/qt-4.8/qwidget.html#focus-prop () const
bool hasEditFocus () const
[/quote]
-
thank you.
If I select the widget,i want to highlight it to let the user he has selected it.
I have tried setFocus and hasFocus,but it doesn't work.[quote author="Wilk" date="1340248674"]Hello.
I guess you may try method hasFocus or something like this to find out, which widget is selected.[/quote] -
Hi, highlighting must be done by you.
So, which types of widget do you use? Custom ones? Then just change the background color in focusInEvent and focusOutEvent.