title: Trouble Connecting QPushButton Signal to QGraphicsView Slot
body: <p>I'm having trouble connecting a signal in a <code>QPushButton</code> to a slot in my <code>QGraphicsView</code>.</p>
  
  <p>My Push Button Header:</p>
  
  <pre><code>class Button : public QPushButton {
  
      Q_OBJECT
  
      public://public constructors / destructors
  
          Button(Game_state * game_state, QWidget *parent = 0);
          ~Button();
  
      protected://signals / slots etc QT 
          void mousePressEvent(QMouseEvent * event);//
  
      signals:
          void updated() { std::cout &lt;&lt; "HELLO FROM THE UPDATED METHOD" &lt;&lt; std::endl;}
  
      protected:
          Game_state * game_state;//this is the global gamestate method
          char * action_name;//this is the application name that is responsible for setting the game_state so the game controller knows what to delete / update
  
  };
  </code></pre>
  
  <p>You need the <code>Q_Object</code> macro to compile this with slots, but when I compile I keep getting a vtable reference not found like follows:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "vtable for Button", referenced from:
        Button::~Button()in buttons.o
        Button::~Button()in buttons.o
        Button::~Button()in buttons.o
        Button::Button(Game_state*, QWidget*)in buttons.o
        Button::Button(Game_state*, QWidget*)in buttons.o
  </code></pre>
  
  <p>When I take out the macro, I can compile it fine, but I keep getting this error when I run:</p>
  
  <pre><code>Object::connect: No such signal QPushButton::updated() in implementation/game_controller.cpp:11
  </code></pre>
  
  <p>My <code>game_controller</code> extends <code>QGRaphicsView</code> and here is my code where I am attempting to connect the Button:</p>
  
  <pre><code>this-&gt;button = new Button(game_state);
  this-&gt;proxy = new QGraphicsProxyWidget();
  this-&gt;proxy = this-&gt;scene-&gt;addWidget(this-&gt;button);
  
  connect(this-&gt;button, SIGNAL(updated()), this, SLOT(update()));
  </code></pre>
  
  <p>Any help would be greatly appreciated </p>