<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>You need to make 2 steps:</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>1. Mark your signal like this:</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new
 roman,new york,times,serif; background-color: transparent; font-style: normal;">[Q_SIGNAL]<br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>protected void pressed()</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>{<br></span><span class="tab">    ...</span><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">}<br><span></span></div><div><br></div><div>2. Use the following syntax for your signal:</div><div>        rootState.addTransition(ellipseButton, SIGNAL("<span>pressed</span>()"), ellipseState);</div><div style="color: rgb(0, 0, 0);
 font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">    that is, you write your method name and signature as a string and pass that to the </span>SIGNAL method.<br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> alex <alexandr.vodorez@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> kde-bindings@kde.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, September 7, 2012 4:17 PM<br> <b><span style="font-weight:
 bold;">Subject:</span></b> [Kde-bindings] Qyoto. How to declare and to pass a signal as method parameter?<br> </font> </div> <br>
Hi. Please help me with signals.<br><br>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)<br>In C++ has the following code:<br><br>class Button : public QGraphicsWidget<br>{<br>...<br>signals:<br>    void pressed();<br>...<br>}<br><br>Then a signal "pressed()" is passed as a parameter to the function rootState->addTransition<br><br>Button *ellipseButton = new Button(QPixmap(":/images/ellipse.png"), buttonParent);<br>QState *rootState = new QState;<br>QAbstractTransition *trans = rootState->addTransition(ellipseButton, SIGNAL(pressed()), ellipseState);<br><br>I can't understand how to write it to C#.<br><br>class Button: QGraphicsWidget<br>{<br>...<br>protected pressed() <-- ??? How to properly declare a signal?<br>...<br>}<br>At first I thought do not use signals, and instead use the C# events:<br>event EventHandler pressed;<br>But in any case, don't know that I
 need to pass to the function :(<br>rootState->addTransition(ellipseButton, SIGNAL("<--??? What to write here?"), ellipseState);<br><br>Please help me with a problem.<br><br>With best regards<br>Alexandr Vodorez<br><br>_______________________________________________<br>Kde-bindings mailing list<br><a ymailto="mailto:Kde-bindings@kde.org" href="mailto:Kde-bindings@kde.org">Kde-bindings@kde.org</a><br><a href="https://mail.kde.org/mailman/listinfo/kde-bindings" target="_blank">https://mail.kde.org/mailman/listinfo/kde-bindings</a><br><br><br> </div> </div>  </div></body></html>