Detecting if an item is clicked at at some row in a QlistWidget

前端 未结 3 840
误落风尘
误落风尘 2021-01-22 04:43

I Have been given this simple task ,

I have this list where i instert items whenever ok is clicked,void Form::ok() handle that event is supposed to add new list items t

3条回答
  •  失恋的感觉
    2021-01-22 04:47

    Something as below :

    connect(ui->listWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(itemClickedSlot(QListWidgetItem *)));
    
    void Form::itemClickedSlot (QListWidgetItem * itemClicked)
    {
    //Do something with clicked item
    }
    

提交回复
热议问题