title: Getting mouse click location of a label in qt
body: <p>I googled around and found <a href="http://www.linuxquestions.org/questions/programming-9/qt-widget-suitable-for-displaying-an-image-and-getting-mouse-click-position-673808/" rel="noreferrer">this forum thread</a> in which the OP seems to have had the exact problem I am having. The question is, how would I inherit from <code>QLabel</code> and reimplement the mousepressed event? I'm guessing it would be something like this:</p>
  
  <pre><code>class CustomLabel : public QLabel
  {
  public:
      //what about the constructors?
      void mousePressEvent ( QMouseEvent * ev );
  }
  
  void CustomLabel::mousePressEvent ( QMouseEvent * ev )
  {
      QPoint = ev-&gt;pos();
      //I want to have another function get the event position.
      //How would I achieve this? It's void!
      //Is there perhaps some way to set up a signal and slot with the position?
  }
  </code></pre>
  
  <p>And after I have successfully created a <code>CustomLabel</code> class, how would I be able to put it in design view?</p>