How to Map member variables with Qt Widgets?
Hi all,
I want to map some member variables with Qt Widgets . For example i have 2 QLineEdit contrtols for hours and minutes , I want to update currosponding members whenever these 2 widgets are getting changed , Is there any mechanism in Qt to do this?
Re: How to Map member variables with Qt Widgets?
Yeah, what about signals and slots?
Re: How to Map member variables with Qt Widgets?
How to achieve this using signals and slots?
Re: How to Map member variables with Qt Widgets?
Connect the line edit's textChanged signal to a slot in your class and in there just assign the new text to the member variable.
The signal will get emitted each time the text changes.
Re: How to Map member variables with Qt Widgets?
Thank you for your valuable reply,
Is there any other straight mechanism to do this?
Re: How to Map member variables with Qt Widgets?
Quote:
Originally Posted by
rajeshs
Thank you for your valuable reply,
Is there any other straight mechanism to do this?
Well, this is the most easiest one.
You could also try QSignalMapper if you have a lot of line edits, but it is also based on signal/slots.