title: How to get the row/column location of a widget in a QGridLayout?
body: <p>I made an own GridPushButton class to store the buttons position in gridlayout. The parent is <code>QPushButton</code>. I have a problem with asking it's x and y coordinates in window (like x:654, y:768). I thought it will be inherited from base class, but it doesn't. Now i have two options:</p>
  
  <ol>
  <li><p>Use the original <code>QPushButton</code> class and somehow get its position in gridlayout (like x:0, y:1 if it's in the first row and second column) or</p></li>
  <li><p>Use my GridPushButton and somehow get the x and y coordinate in window.  </p>
  
  <pre><code>class GridPushButton : public QPushButton
  {
  Q_OBJECT
  public:
    GridPushButton(int coordX, int coordY, QWidget *parent = 0);
    int coordinateX() { return _coordX; }
    int coordinateY() { return _coordY; }
  
  protected:
    int _coordX;
    int _coordY;
  };
  </code></pre></li>
  </ol>
  
  <p>This is my class. I tried to make a new private variable and give it the <code>QPushButton::x()</code>, but doesn't work. Any idea to get the x and y coordinate from parent? 
  Or any idea to get the <code>QPushButtons</code> position in GridLayout?</p>