PDA

View Full Version : Control name



sonuani
21st February 2008, 11:15
hi,
I want to get the Object name of the control which has the current focus.
How to do that?

jpn
21st February 2008, 12:03
See

QApplication::focusWidget()
QWidget::focusWidget()
QObject::objectName()

sonuani
22nd February 2008, 06:38
I need to use the object name which has current focus in a switch case.
I tried in many ways to use it.But not getting it properly.
Plz tell me how to use it.

jpn
22nd February 2008, 06:42
In C++ you cannot use strings in switch case statement. What are you trying to do in the first place?

sonuani
22nd February 2008, 07:23
Hi,
Is there anything other than Object name to identify a control in qt.

jpn
22nd February 2008, 07:35
Could you answer my question? What are you trying to do?

sonuani
22nd February 2008, 10:24
I have a list of QLineEdit widgets.
If i click and enter some data into a particular QLineEdit then some manipulations have to be done based on whichever control i click

jpn
22nd February 2008, 10:28
I have a list of QLineEdit widgets.
If i click and enter some data into a particular QLineEdit then some manipulations have to be done based on whichever control i click
You have to help us to help you. "Some manipulation" doesn't tell too much. Anyway, have you noticed that QLineEdit supports QValidator?