1.信號槽(構(gòu)造函數(shù)中)
connect(chkBoxSelAll, SIGNAL(clicked()), SLOT(OnSelectAll()));
connect(lstView, SIGNAL(currentChanged(QListViewItem*)), SLOT(OnLstView(QListViewItem*)));
2.選擇全部的功能
void CDlgImpl::OnSelectAll()
{
QListViewItemIterator it(lstView);
while(it.current())
{
static_cast<QCheckListItem*>(it.current())->setOn(chkBoxSelAll->isChecked());
++it;
}
}
3.未選擇全部時,chkbox自動不選
void CDlgImpl::OnLstView( QListViewItem * item )
{
if (!pItem->isOn())
chkBoxSelAll->setChecked(false);
}
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點(diǎn)擊舉報。