#include <qwidget.h>
#include <qapplication.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qpixmap.h>
#include "guiTools.h"
Include dependency graph for guiTools.cpp:

Go to the source code of this file.
Functions | |
| void | centerWindow (QWidget *window) |
|
|
Definition at line 29 of file guiTools.cpp. Referenced by TitleWidget::aboutProgram(), TitleWidget::albumStatistics(), and TitleWidget::handbook().
00030 {
00031 //get size and location of application window
00032 QRect appRec = qApp->mainWidget()->geometry();
00033 QRect windowRec = window->geometry();
00034
00035 //center this dialoag within application window
00036 int x, y;
00037 if(windowRec.width() < appRec.width())
00038 { x = appRec.x() + ((appRec.width() - windowRec.width())/2); }
00039 else
00040 { x = appRec.x(); }
00041 if(windowRec.height() < appRec.height())
00042 { y = appRec.y() + ((appRec.height() - windowRec.height())/2); }
00043 else
00044 { y = appRec.y(); }
00045
00046 window->move( QPoint( x, y) );
00047 }
|
1.3.4