QGtk3Dialog::show(): add missing null-check to avoid warnings

Or else QObject::connect() warns about 'invalid null parameter' when
showing parentless dialogs.

Task-number: QTBUG-55298
Change-Id: I39b1dfc81e5da0c793c86cff763f946db15c13ae
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
J-P Nurmi 2016-08-13 17:17:56 +02:00
parent 6cc02ce6c8
commit 2e2b32a9ab

View File

@ -117,8 +117,10 @@ void QGtk3Dialog::exec()
bool QGtk3Dialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
{
connect(parent, &QWindow::destroyed, this, &QGtk3Dialog::onParentWindowDestroyed,
Qt::UniqueConnection);
if (parent) {
connect(parent, &QWindow::destroyed, this, &QGtk3Dialog::onParentWindowDestroyed,
Qt::UniqueConnection);
}
setParent(parent);
setFlags(flags);
setModality(modality);