on xenial help sign in
rootObject can be null for a small moment after setSource is called
3fe1956Albert Astals Cid
src/ShellView.cpp+6−2
@@ -49,11 +49,15 @@ void ShellView::onWidthChanged(int w)
49 // The QResizeEvent we get still has the size of the first screen and since the resize move is triggered
49 // The QResizeEvent we get still has the size of the first screen and since the resize move is triggered
50 // from the resize event handler, the root item doesn't get resized.
50 // from the resize event handler, the root item doesn't get resized.
51 // TODO: Confirm the Qt bug and submit a patch upstream
51 // TODO: Confirm the Qt bug and submit a patch upstream
52+ if (rootObject()) {
52− rootObject()->setWidth(w);
53+ rootObject()->setWidth(w);
54+ }
53}
55}
54
56
55void ShellView::onHeightChanged(int h)
57void ShellView::onHeightChanged(int h)
56{
58{
57 // See comment in ShellView::onWidthChanged()
59 // See comment in ShellView::onWidthChanged()
60+ if (rootObject()) {
58− rootObject()->setHeight(h);
61+ rootObject()->setHeight(h);
62+ }
59}
63}