本文整理汇总了C++中TQListViewItem::isSelected方法的典型用法代码示例。如果您正苦于以下问题:C++ TQListViewItem::isSelected方法的具体用法?C++ TQListViewItem::isSelected怎么用?C++ TQListViewItem::isSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TQListViewItem
的用法示例。
在下文中一共展示了TQListViewItem::isSelected方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: contentsMousePressEvent
void KACLListView::contentsMousePressEvent( TQMouseEvent * e )
{
TQListViewItem *clickedItem = itemAt( contentsToViewport( e->pos() ) );
if ( !clickedItem ) return;
// if the click is on an as yet unselected item, select it first
if ( !clickedItem->isSelected() )
TDEListView::contentsMousePressEvent( e );
if ( !currentItem() ) return;
int column = header()->sectionAt( e->x() );
acl_perm_t perm;
switch ( column )
{
case 2:
perm = ACL_READ;
break;
case 3:
perm = ACL_WRITE;
break;
case 4:
perm = ACL_EXECUTE;
break;
default:
return TDEListView::contentsMousePressEvent( e );
}
KACLListViewItem* referenceItem = static_cast<KACLListViewItem*>( clickedItem );
unsigned short referenceHadItSet = referenceItem->value & perm;
TQListViewItemIterator it( this );
while ( KACLListViewItem* item = static_cast<KACLListViewItem*>( it.current() ) ) {
++it;
if ( !item->isSelected() ) continue;
// toggle those with the same value as the clicked item, leave the others
if ( referenceHadItSet == ( item->value & perm ) )
item->togglePerm( perm );
}
}