title: Position pop up window over a QWidget in runtime
body: <p>I know there are answers, but they don´t satisfy my question. It´s not working for me.</p>
  
  <p>I have a simple custom widget called PopUp.
  It inherits the SmartPanel which is a styled panel and just contains:</p>
  
  <pre><code>setWindowFlags( Qt::Window | Qt::FramelessWindowHint );
  setAttribute(Qt::WA_QuitOnClose, true);
  setAttribute( Qt::WA_TranslucentBackground );
  </code></pre>
  
  <p>It shows a window that should appear over a button you push that pops it up or closes. if you enter and get out of it, it closes by itself.</p>
  
  <p>I tried:</p>
  
  <p><strong>A) Making it child of the button</strong>, so where the button moves, it moves. Obviously should work. Well. Doesn´t work at all... It always stays on 0,0 on the top left corner of the window. I even move the window , the button moves and the popup stays the same... even being it´s child!.</p>
  
  <pre><code>SmartPopUp::SmartPopUp( QWidget *parent): SmartPanel(parent)
  {
     setContentsMargins(30,10,20,20);
     hide();
     QVBoxLayout* lyt = new QVBoxLayout();
     setLayout(lyt);
   }
  </code></pre>
  
  <p><strong>B) Save inside a link to the assoc. widget</strong>, to get its position. Getting position of the widget doesn´t work properly. Don´t know why...</p>
  
  <pre><code>SmartPopUp::SmartPopUp( QWidget* associatedWidget, QWidget *parent): SmartPanel(parent)
  {
    associatedWidget_ = associatedWidget;
    setContentsMargins(30,10,20,20);
    hide();
  
    QVBoxLayout* lyt = new QVBoxLayout();
    setLayout(lyt);
  }
  </code></pre>
  
  <p>How to make it move together with the changing position of the button?</p>