after a few hours of playing around, I manage to make it work, problem is it has to be done after the mainwindow is painted, with a timer i used the following code

Qt Code:
  1. void MainWindow::timer()
  2. {
  3. QRect myrec = myview->geometry();
  4. QRect myrec2 = myview->frameGeometry();
  5. int y1 = myrec.y();
  6. int x1 = myrec.x();
  7. int x2 = myrec2.x();
  8. int y2 = myrec2.y();
  9. mydialog->move(x1-x2,y1-y2);
  10. }
To copy to clipboard, switch view to plain text mode