How to access a member of a QButtonGroup by number?
-
Gerolf,
it is a gui. you already helped me with creating this gui in this thread:
http://developer.qt.nokia.com/forums/viewthread/9706what's the correct approach to get the ID?
-
the direct access from the class display doesn't work (I can't even select the andon class variable, of course)
and the slot thing doesn't work either. my app stops as there is a silly value for t, so it wasn't set by the signal)but I'd really rather write a get function or something like this in order to access this member variable, as this seems to be a useful thing to learn ;)
how would that work? -
gerolf, the advice to use a book I already got it a few posts earlier and I agree with it. this is something I already know even without the first time telling me.
what I don't know is how to solve my problem. so what would be really useful to me is probably an example how I could implement the getter.maybe someone can give me one?
-
Off-topic:
The point of helping for many people here (ok, at least for me, let me not pretend to speak for others here) is that it is a learning experience for everyone involved. Feeding you complete answers, also on non-Qt issues, does not qualify as such. That is why Gerolf and I suggest you learn C++ before trying your hand at Qt.I am sorry you have a deadline in a language and toolkit you know very little about, but that is your problem, not ours. Personally, I would have invested in a paid consultant for a situation like that. That would get you straight answers and timely responses, and ready-to-use pieces of code.
On-topic then:
Make Tag a property on the class: a private variable to keep the value (you could perhaps use your button group itself for that), a getter method to retreive the value, and a setter method to set it. The getter method will return the value of your private variable, while the setter one will manipulate its value (and its representation, if that is separate from each other). Optionally, you can add a changed signal for the value, to let other objects know that the value has been changed.