Hello
I am new to Qt
I have written a simple application and I want to get current position of the QMainWindow.
this is my code:

Qt Code:
  1. M::M(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::M)
  4. {
  5. ui->setupUi(this);
  6. msg.setText(QString::number("what returns the X or Y of the window?"));
  7. msg.exec();
  8. }
To copy to clipboard, switch view to plain text mode 

I searched a lot. There where topics about setting the position, not getting it.
I also tried geometry().x(), but it always returns 0 !!!
Please help me. I need this.
Best regards...