Changeset View
Changeset View
Standalone View
Standalone View
krunner/view.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | |||||
170 | { | 170 | { | ||
171 | connect(m_qmlObj->rootObject(), SIGNAL(widthChanged()), this, SLOT(resetScreenPos())); | 171 | connect(m_qmlObj->rootObject(), SIGNAL(widthChanged()), this, SLOT(resetScreenPos())); | ||
172 | setMainItem(qobject_cast<QQuickItem *>(m_qmlObj->rootObject())); | 172 | setMainItem(qobject_cast<QQuickItem *>(m_qmlObj->rootObject())); | ||
173 | } | 173 | } | ||
174 | 174 | | |||
175 | void View::slotFocusWindowChanged() | 175 | void View::slotFocusWindowChanged() | ||
176 | { | 176 | { | ||
177 | if (!QGuiApplication::focusWindow()) { | 177 | if (!QGuiApplication::focusWindow()) { | ||
178 | // ask the view to hide itself, it may refuse to if there's still a query in the input box (cf. Bug 353026) | ||||
179 | if (m_qmlObj->rootObject()) { | ||||
180 | // note this doesn't check the return value of focusLost but merely if the call succeeded | ||||
181 | if (QMetaObject::invokeMethod(m_qmlObj->rootObject(), "focusLost")) { | ||||
182 | return; | ||||
183 | } | ||||
184 | } | ||||
185 | | ||||
186 | // fallback for old LNF themes that don't have the function we call | ||||
178 | setVisible(false); | 187 | setVisible(false); | ||
179 | } | 188 | } | ||
180 | } | 189 | } | ||
181 | 190 | | |||
182 | bool View::freeFloating() const | 191 | bool View::freeFloating() const | ||
183 | { | 192 | { | ||
184 | return m_floating; | 193 | return m_floating; | ||
185 | } | 194 | } | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |