| 256 | } |
| 257 | |
| 258 | bool UIStateManager::eventFilter(QObject *object, QEvent *event) |
| 259 | { |
| 260 | const bool connected = Endpoint::instance()->isConnected(); |
| 261 | |
| 262 | if (connected && object == m_widget) { |
| 263 | if (event->type() == QEvent::Hide) { |
| 264 | if (m_initialized) |
| 265 | saveState(); |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | const bool result = QObject::eventFilter(object, event); |
| 270 | |
| 271 | if (connected && object == m_widget) { |
| 272 | if (event->type() == QEvent::Show) { |
| 273 | if (!m_initialized) |
| 274 | setup(); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | if (connected && event->type() == QEvent::Resize) { |
| 279 | if (m_initialized && !m_resizing) |
| 280 | widgetResized(qobject_cast<QWidget *>(object)); |
| 281 | } |
| 282 | |
| 283 | return result; |
| 284 | } |
| 285 | |
| 286 | QString UIStateManager::widgetName(QWidget *widget) |
| 287 | { |
nothing calls this directly
no test coverage detected