Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QPushButton does not respond when first time click?
Davidcheng last edited by A Former User
When I have a
QPushButton, have selected a listItem, then click pushbutton, why does it only respond when I click at second time?
Show the code. Impossible to guess at when you are not showing what button
does on clicked()
Davidcheng last edited by
This post is deleted!
Ah, i see from your deleted post what you say.
When QListWidget is clicked first time, it receives focus
When you then click a button, that button is now given focus.
Focus is not the same as selected for QListWidget.- one or more item can be selected.
You can try
qDebug() << ui->listWidget->currentItem()->text();