title: Qt - How to override a widget?
body: <p>I've created a form using the Qt designer which includes a QToolButton.<br>
  I can turn it using <code>ui-&gt;favouriteToolButton</code>.<br>
  I used the designer because it's much more simple then code all the gui.</p>
  
  <p>Problem is that specifically for this <code>ToolButton</code> i want to code by creating its own class:</p>
  
  <pre><code>class FavouriteMenu : public QToolButton
  {
      Q_OBJECT
  
  public:
      explicit FavouriteMenu(QWidget *parent = 0);
      //~FavouriteMenu();
  
  private:
      QMenu *menu;                                        //MENU
      QAction *addToBookmarkAct;
      QAction *editBookmarkAct;
  
  ...
  </code></pre>
  
  <p>I want to be able to override <code>ui-&gt;favouriteToolButton</code> with a new instance of FavouriteMenu.
  How can i do it?</p>