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:
ui(new Ui::M)
{
ui->setupUi(this);
msg.
setText(QString::number("what returns the X or Y of the window?"));
msg.exec();
}
M::M(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::M)
{
ui->setupUi(this);
QMessageBox msg;
msg.setText(QString::number("what returns the X or Y of the window?"));
msg.exec();
}
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...
Bookmarks