From 3506922fd8492e25c48e325fedf04123611ddf00 Mon Sep 17 00:00:00 2001 From: johanneshilden Date: Fri, 29 Sep 2017 01:32:12 +0300 Subject: [PATCH] Make first row active in list widget --- examples/mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/mainwindow.cpp b/examples/mainwindow.cpp index 12b5380..64ba5da 100644 --- a/examples/mainwindow.cpp +++ b/examples/mainwindow.cpp @@ -32,6 +32,8 @@ MainWindow::MainWindow(QWidget *parent) list->addItem("Avatar"); list->addItem("Badge"); + list->setCurrentRow(0); + QObject::connect(list, &QListWidget::currentItemChanged, [=](QListWidgetItem *current, QListWidgetItem *previous) {