Commit 8defa8a7 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

QmlJSDebugger: Use QWidget::window to get to the top-level

Simplifies the code a bit.
parent 8d22d687
......@@ -541,17 +541,15 @@ bool QDeclarativeViewObserver::showAppOnTop() const
void QDeclarativeViewObserver::setShowAppOnTop(bool appOnTop)
{
if (data->view) {
QWidget *rootWidget = data->view;
while (rootWidget->parentWidget())
rootWidget = rootWidget->parentWidget();
Qt::WindowFlags flags = rootWidget->windowFlags();
QWidget *window = data->view->window();
Qt::WindowFlags flags = window->windowFlags();
if (appOnTop)
flags |= Qt::WindowStaysOnTopHint;
else
flags &= ~Qt::WindowStaysOnTopHint;
rootWidget->setWindowFlags(flags);
rootWidget->show();
window->setWindowFlags(flags);
window->show();
}
data->showAppOnTop = appOnTop;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment