hello every one,
i'm meeting problem with QMessageBox ,
i can't locate the box window to the middle of the screen,
it's change position depend on the message box size,

below is my code , but it not work after i need to change language
till now, i'm doing the stupid thing is:
1.Run the program first time, get the real messagebox:
Qt Code:
  1. QMessageBox message(QMessageBox::Information, "",
  2. QObject::tr("Test QMessageBox Size"),
  3. QMessageBox::NoButton ,
  4. this, Qt::FramelessWindowHint);
  5.  
  6. message.exec();
  7.  
  8. QString sss ;
  9. sss.sprintf(" Test QMessageBox Size w=%d h=%d",message.width(),message.height());
  10. qDebug() << sss ;
To copy to clipboard, switch view to plain text mode 

2.After i get the message output "sss"
"Test QMessageBox Size w=242 h=103"
, setFixedSize(242, 103) of the message box
and move the message on the middle of the screen before exec()
Qt Code:
  1. QMessageBox message(QMessageBox::Information, "",
  2. QObject::tr("Test QMessageBox Size"),
  3. QMessageBox::NoButton ,
  4. this, Qt::FramelessWindowHint);
  5.  
  6. message.setFixedSize(242, 103);
  7. message.move((window_w-message.width())/2,(window_h-message.height())/2);
  8.  
  9. message.exec();
To copy to clipboard, switch view to plain text mode 
which window_w and window_h are the window width, height.


it's worked well , but now i need to involve the multi-language using .qm file ,
after translate to other language, the box size changed by the text ,
(the length of text changed , and the box size changed)
therefore the messagebox not on the middle of screen again,
is there any way to let the messagebox always on the middle of screen no matter the MessageBox size?

thanks for your patience ,
any response is appreciate!