Hello,

Qt Code:
  1. QDialog dlg( this );
  2. dlg.show();
To copy to clipboard, switch view to plain text mode 

as result dialog window showed in random place,
can I show the dialog in main window central position?

now, for this task I use the following code:
Qt Code:
  1. QDialog dlg( this );
  2. moveToCenter( &dlg );
  3.  
  4. void SMainWindow::moveToCenter( QWidget* child )
  5. {
  6. if ( child->parentWidget( ) )
  7. {
  8. QSize szParent = child->parentWidget( )->size( );
  9. QPoint ptChild = QPoint( ( szParent.width( ) - child->size( ).width( ) ) / 2,
  10. ( szParent.height( ) - child->size( ).height( ) ) / 2 );
  11. child->move( ptChild );
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 

There are other ways?