Use dynamic_cast instead of qobject_cast

This commit is contained in:
Guillaume Meunier committed 2024-11-03 14:09:58 +01:00
1 parent a8130194df
commit 792feecbe9
1 file changed
+2 -2
+2 -2
View File
@@ -154,7 +154,7 @@ settings::settings(wivrn_server * server_interface) :
fill_steam_games_list();
load_settings();
auto encoders = qobject_cast<QStandardItemModel *>(ui->encoder->model());
auto encoders = dynamic_cast<QStandardItemModel *>(ui->encoder->model());
#if !WIVRN_USE_NVENC
encoders->item(1)->setEnabled(false);
#endif
@@ -227,7 +227,7 @@ void settings::on_selected_encoder_changed()
{
int encoder = ui->encoder->currentIndex();
QStandardItemModel * model = qobject_cast<QStandardItemModel *>(ui->codec->model());
QStandardItemModel * model = dynamic_cast<QStandardItemModel *>(ui->codec->model());
assert(model);
for (int i = 0, n = model->rowCount(); i < n; i++)