Is there a general rule for the moment of invocation of onX methods in Qt in regard to
1. object's state change
2. side effects?
Is there a general rule for the moment of invocation of onX methods in Qt in regard to
1. object's state change
2. side effects?
The on_XX-methods in Qt are a mechanism introduced in Qt 4.0 to connect hand written code to designer generated form classes. See http://doc.trolltech.com/4.5/qmetaob...ectSlotsByName
In the name of the method, you see wether the name of the signal is written in the past (clicked) or in the future (aboutToBeClicked). Most objects only provide signals that are emitted AFTER the state has changed, e.g. clicked, triggered
It's nice to be important but it's more important to be nice.
Thanks for your answer. I did not mean on_X methods you refer to, however. I meant for example
andQt Code:
To copy to clipboard, switch view to plain text mode
Qt Code:
void QAbstractTransition::triggered () [signal]To copy to clipboard, switch view to plain text mode
I'd expect
Qt Code:
protected: virtual void QAbstractTransition::transitionEvent(QTransitionEvent *event) = 0;To copy to clipboard, switch view to plain text mode
Horse sense is the thing that keeps horses from betting on people. --W.C. Fields
Ask Smart Questions
To rephrase your question:
How is a method that is marked as [pure virtual protected] in Qt docs declared in the Qt source code?
If that is the question why don't you look in the source code ?
If that is not the question forget my post .
And where did you find QAbstractTransition:nTransition(QEvent *event)? there is no such thing in Qt sources and Qt Assistant. Only onX methods are in WebCore which wasn't designed by Trolls, just ported would be my guess.
So it's hard to say what is the general rule for onX methods in Qt as there are no such methods in Qt (at least in my Qt sources 4.5.0). But Im guessing from the method declaration you pasted that it's just an event handler so it is invoked when event loop is processing events which should be processed in that onX method.
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
Bookmarks