From afae7f931c0786eeef2730da2a17a92c6e4ac180 Mon Sep 17 00:00:00 2001 From: warwick Date: Mon, 11 Mar 2002 08:18:47 +0000 Subject: [PATCH] Sometimes there is no main widget. --- win/Qt/qt_win.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index 31143681a..63f6dcfca 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -163,6 +163,7 @@ static void centerOnMain( QWidget* w ) { QWidget* m = qApp->mainWidget(); + if (!m) m = qApp->desktop(); QPoint p = m->mapToGlobal(QPoint(0,0)); w->move( p.x() + m->width()/2 - w->width()/2, p.y() + m->height()/2 - w->height()/2 );