stackedWidget = new QStackedWidget();
layout->addWidget(stackedWidget);
- searchView = new SearchView();
+ searchView = new SearchView(this);
connect(searchView, SIGNAL(search(SearchParams*)),
MainWindow::instance(), SLOT(showMedia(SearchParams*)));
stackedWidget->addWidget(searchView);
connect(ChannelAggregator::instance(), SIGNAL(unwatchedCountChanged(int)),
SLOT(unwatchedCountChanged(int)));
- foreach (QAction* action, bar->actions()) {
+ const auto a = bar->actions();
+ for (QAction* action : a) {
addAction(action);
IconUtils::setupAction(action);
}
stackedWidget->setCurrentWidget(widget);
widget->setEnabled(true);
QMetaObject::invokeMethod(widget, "appear");
- widget->setFocus();
+ QTimer::singleShot(0, widget, SLOT(setFocus()));
+
+#ifdef APP_MAC
+ // Workaround cursor bug on macOS
+ window()->unsetCursor();
+#endif
}
void HomeView::appear() {
- QMetaObject::invokeMethod(stackedWidget->currentWidget(), "appear");
+ QMetaObject::invokeMethod(stackedWidget->currentWidget(), "appear", Qt::QueuedConnection);
}
void HomeView::disappear() {