Set an object name matching the Widget on QWidgetWindow.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Tue, 26 Jul 2011 08:32:30 +0000 (10:32 +0200)
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>
Tue, 26 Jul 2011 08:34:27 +0000 (10:34 +0200)
To aid debugging.

Change-Id: I841a59a60a0de504eef140debc5e55ee5f15d7f7
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-on: http://codereview.qt.nokia.com/2167
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/widgets/kernel/qwidget.cpp

index 76218a9..d48d5ae 100644 (file)
@@ -9556,6 +9556,18 @@ void QWidget::ensurePolished() const
         QChildEvent e(QEvent::ChildPolished, const_cast<QWidget *>(this));
         QCoreApplication::sendEvent(d->parent, &e);
     }
+#ifdef Q_WS_QPA
+    if (d->extra && d->extra->topextra && d->extra->topextra->window
+        && d->extra->topextra->window->objectName().isEmpty()) {
+        QString on = objectName();
+        if (on.isEmpty()) {
+            on = QString::fromUtf8(metaObject()->className());
+            on += QLatin1String("Class");
+        }
+        on += QLatin1String("Window");
+        d->extra->topextra->window->setObjectName(on);
+    }
+#endif
 }
 
 /*!