Jelajahi Sumber

[iOS] clear focus in launcher only when something has focus

Andrey Filipenkov 3 tahun lalu
induk
melakukan
796845d173
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      launcher/mainwindow_moc.cpp

+ 2 - 1
launcher/mainwindow_moc.cpp

@@ -92,7 +92,8 @@ MainWindow::MainWindow(QWidget * parent)
 
 	connect(ui->tabSelectList, &QListWidget::currentRowChanged, [this](int i) {
 #ifdef Q_OS_IOS
-		qApp->focusWidget()->clearFocus();
+		if(auto widget = qApp->focusWidget())
+			widget->clearFocus();
 #endif
 		ui->tabListWidget->setCurrentIndex(i);
 	});