QPushButton does not respond when first time click?

  • When I have a QListWidget and a QPushButton, have selected a listItem, then click pushbutton, why does it only respond when I click at second time?

  • Lifetime Qt Champion

    Show the code. Impossible to guess at when you are not showing what button
    does on clicked()

  • This post is deleted!

  • Lifetime Qt Champion

    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();
    in button.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.