本文整理汇总了C++中QListViewItem::title方法的典型用法代码示例。如果您正苦于以下问题:C++ QListViewItem::title方法的具体用法?C++ QListViewItem::title怎么用?C++ QListViewItem::title使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListViewItem
的用法示例。
在下文中一共展示了QListViewItem::title方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: O
void
QueueManager::addItems( QListViewItem *after )
{
/*
HACK!!!!! We can know which items where dragged since they should still be selected
I do this, because:
- Dragging items from the playlist provides urls
- Providing urls, requires iterating through the entire list in order to find which
item was selected. Possibly a very expensive task - worst case: O(n)
- After a drag, those items are still selected in the playlist, so we can find out
which PlaylistItems were dragged by selectedItems();
*/
if( !after )
after = m_listview->lastChild();
QPtrList<QListViewItem> list = Playlist::instance()->selectedItems();
for( QListViewItem *item = list.first(); item; item = list.next() )
{
#define item static_cast<PlaylistItem*>(item)
QValueList<PlaylistItem*> current = m_map.values();
if( current.find( item ) == current.end() ) //avoid duplication
{
QString title = i18n("%1 - %2").arg( item->artist(), item->title() );
after = new QueueItem( m_listview, after, title );
m_map[ after ] = item;
}
#undef item
}
}