[Kde-bindings] Qyoto. How to declare and to pass a signal as method parameter?
alex
alexandr.vodorez at gmail.com
Fri Sep 7 13:17:56 UTC 2012
Hi. Please help me with signals.
I am trying to migrate code from C++ to C#. This is an example from Qt
(Qt/4.8.2/examples/animation/animatedtiles/main.cpp)
In C++ has the following code:
class Button : public QGraphicsWidget
{
...
signals:
void pressed();
...
}
Then a signal "pressed()" is passed as a parameter to the function
rootState->addTransition
Button *ellipseButton = new Button(QPixmap(":/images/ellipse.png"),
buttonParent);
QState *rootState = new QState;
QAbstractTransition *trans = rootState->addTransition(ellipseButton,
SIGNAL(pressed()), ellipseState);
I can't understand how to write it to C#.
class Button: QGraphicsWidget
{
...
protected pressed() <-- ??? How to properly declare a signal?
...
}
At first I thought do not use signals, and instead use the C# events:
event EventHandler pressed;
But in any case, don't know that I need to pass to the function :(
rootState->addTransition(ellipseButton, SIGNAL("<--??? What to write
here?"), ellipseState);
Please help me with a problem.
With best regards
Alexandr Vodorez
More information about the Kde-bindings
mailing list