title: Qt designer: Custom code for custom actions
body: <p>I've been looking around and I didn't found anything yet, except old doc for Qt3 with version 3.x of qt designer.</p>
  
  <p>I'll leave an example, not that I can't give code as my project is GPL but for simplicity.</p>
  
  <p><strong><em>Example:</em></strong> You are designing a GUI for your application. You insert some buttons in the GUI, and you want those buttons do something with a logic that <em>maybe</em> is already written.</p>
  
  <p><strong><em>Question:</em></strong> How do you add or set this code in a way that the button when it's checked will fire that code?</p>
  
  <p>I don't want to connect widgets with signals/slots. My approach was to create a custom action in the action editor, and connect the desired button to that action hoping to find a way to write the code for that action. I could define its name, its icon (?), and so on. But I need to write its logic/code.</p>
  
  <p>I read some <a href="http://www.cs.usfca.edu/~afedosov/qttut/" rel="nofollow">documentation</a> that instructs you to create a C++ header file, but it seems deprecated for the new Qt Designer version  (4.7.3). The other vast resource I found about my question are all about conecting signals between default objetc actions. I repeat that is not what I need/want.</p>
  
  <p>My question born from the fact that I don't want to edit the generated .py. I sense that it MUST be a way to set a file (custom code, header file, etc) with the custom action code but honestly, I can't find anything yet.</p>
  
  <p>In case of a negative answer (that is, "not possible to do so"), It would be nice to hear some advice for "hacking" the code. I really don't like to modify the generated .py and it seems ugly to do something like: <code>ui.callback</code> in my code.</p>
  
  <p>Regards,</p>