August 31, 2011

M_31 M_31
Lab Rat
98 posts

[SOLVED] Help on QListWidget’s Event..

 

Hi Guys, I want to have an event , if none on the items in the QListWidget are selected.

Becoz in My application, if any one of the ListWidget items has selected then i will be enabling my Delete button like this

  1. void TestDlg::on_TestListWidget_pressed(const QModelIndex &index)
  2. {
  3.     ui->deleteBtn->setEnable(true);
  4. }

but this button is keep on enabled , but i want to disable this button , if no items are selected from the QListWidget

2 replies

August 31, 2011

DSav DSav
Lab Rat
28 posts

QListWidget has itemSelectionChanged(), it’s fired when selection is somehow changed. Just connect to this signal and check, whether something is selected.

August 31, 2011

M_31 M_31
Lab Rat
98 posts

Thanks for your valuable inputs.. DSav..

Its working fine…

 
  ‹‹ Where is the point (0,0) (in item coordinates) of a QGraphicsPolygonItem ?      Mapping a ScrollArea to the ScrollBars of a QGraphicsView ››

You must log in to post a reply. Not a member yet? Register here!