EditDialog: Fix window positioning

The old code somehow stopped working for me...
This commit is contained in:
Martin Kleusberg
2015-08-23 18:16:52 +02:00
parent 5d652db147
commit e833e49130

View File

@@ -53,7 +53,7 @@ void EditDialog::showEvent(QShowEvent*)
{
// Whenever the dialog is shown, position it at the center of the parent dialog
QPoint center = mapToGlobal(rect().center());
QDialog* parentDialog = qobject_cast<QDialog*>(parent());
QMainWindow* parentDialog = qobject_cast<QMainWindow*>(parent());
if(parentDialog)
{
QPoint parentCenter = parentDialog->window()->mapToGlobal(parentDialog->window()->rect().center());