当前位置: 首页>>代码示例>>C++>>正文


C++ QListViewItem::pixmap方法代码示例

本文整理汇总了C++中QListViewItem::pixmap方法的典型用法代码示例。如果您正苦于以下问题:C++ QListViewItem::pixmap方法的具体用法?C++ QListViewItem::pixmap怎么用?C++ QListViewItem::pixmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QListViewItem的用法示例。


在下文中一共展示了QListViewItem::pixmap方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: moveBookmark

void BookmarksSettingsPage::moveBookmark(int direction)
{
    // this implementation currently only allows moving of bookmarks
    // one step up or down
    assert((direction >= -1) && (direction <= +1));

    // swap bookmarks in listview
    QListViewItem* selectedItem = m_listView->selectedItem();
    assert(selectedItem != 0);
    QListViewItem* item = (direction < 0) ? selectedItem->itemAbove() :
                          selectedItem->itemBelow();
    assert(item != 0);

    QPixmap pixmap;
    if (item->pixmap(0) != 0) {
        pixmap = *(item->pixmap(0));
    }
    QString name(item->text(NameIdx));
    QString url(item->text(URLIdx));
    QString icon(item->text(IconIdx));

    if (selectedItem->pixmap(0) != 0) {
        item->setPixmap(PixmapIdx, *(selectedItem->pixmap(0)));
    }
    item->setText(NameIdx, selectedItem->text(NameIdx));
    item->setText(URLIdx, selectedItem->text(URLIdx));
    item->setText(IconIdx, selectedItem->text(IconIdx));

    selectedItem->setPixmap(PixmapIdx, pixmap);
    selectedItem->setText(NameIdx, name);
    selectedItem->setText(URLIdx, url);
    selectedItem->setText(IconIdx, icon);

    m_listView->setSelected(item, true);
}
开发者ID:serghei,项目名称:kde3-apps-dolphin,代码行数:35,代码来源:bookmarkssettingspage.cpp

示例2: itemColChanged

void ListViewEditor::itemColChanged( int col )
{
    QListViewItem *i = itemsPreview->currentItem();
    if ( !i )
	return;

    displayItem( i, col );
    itemDeletePixmap->setEnabled( i->pixmap( col ) && !i->pixmap( col )->isNull() );
}
开发者ID:AliYousuf,项目名称:abanq-port,代码行数:9,代码来源:listvieweditorimpl.cpp

示例3: startDrag

void FolderListView::startDrag()
{
QListViewItem *item = currentItem();
if (!item)
	return;

if (item == firstChild() && item->listView()->rootIsDecorated())
	return;//it's the project folder so we don't want the user to move it

QPoint orig = viewportToContents( viewport()->mapFromGlobal( QCursor::pos() ) );

QPixmap pix;
if (item->rtti() == FolderListItem::ListItemType)
	pix = QPixmap( folder_closed_xpm );
else
	pix = *item->pixmap (0);

QIconDrag *drag = new QIconDrag(viewport());
drag->setPixmap(pix, QPoint(pix.width()/2, pix.height()/2 ) );

QPtrList<QListViewItem> lst;
for (item = firstChild(); item; item = item->itemBelow())
	{
	if (item->isSelected())
		lst.append(item);
	}

emit dragItems(lst);
drag->drag();
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:30,代码来源:folder.cpp

示例4: loadChildren

void PlaylistSelection::loadChildren( QListViewItem* browserParent, QListViewItem* selectionParent )
{
    QListViewItem* browserChild = browserParent->firstChild();

    while( browserChild )
    {
        SelectionListItem* selectionChild = new SelectionListItem( selectionParent, browserChild->text(0), browserChild );
        if ( browserChild->pixmap(0) )
            selectionChild->setPixmap( 0, *browserChild->pixmap(0) );

        if( browserChild->childCount() > 0 )
            loadChildren( browserChild, selectionChild );

        browserChild = browserChild->nextSibling();
    }
}
开发者ID:tmarques,项目名称:waheela,代码行数:16,代码来源:playlistselection.cpp

示例5: itemLeftClicked

void ListViewEditor::itemLeftClicked()
{
    QListViewItem *i = itemsPreview->currentItem();
    if ( !i )
	return;

    QListViewItemIterator it( i );
    QListViewItem *parent = i->parent();
    if ( !parent )
	return;
    parent = parent->parent();
    --it;
    while ( it.current() ) {
	if ( it.current()->parent() == parent )
	    break;
	--it;
    }

    if ( !it.current() )
	return;
    QListViewItem *other = it.current();

    for ( int c = 0; c < itemsPreview->columns(); ++c ) {
	QString s = i->text( c );
	i->setText( c, other->text( c ) );
	other->setText( c, s );
	QPixmap pix;
	if ( i->pixmap( c ) )
	    pix = *i->pixmap( c );
	if ( other->pixmap( c ) )
	    i->setPixmap( c, *other->pixmap( c ) );
	else
	    i->setPixmap( c, QPixmap() );
	other->setPixmap( c, pix );
    }

    itemsPreview->setCurrentItem( other );
    itemsPreview->setSelected( other, TRUE );
}
开发者ID:AliYousuf,项目名称:abanq-port,代码行数:39,代码来源:listvieweditorimpl.cpp

示例6: KListView

PlaylistSelection::PlaylistSelection( QWidget* parent, char* name )
    : KListView( parent, name )
{
    addColumn( i18n("Select Playlists") );
    setRootIsDecorated( true );
    PlaylistBrowserView* browserTree = PlaylistBrowser::instance()->getListView();
    QListViewItem*       browserItem = browserTree->firstChild();
    //load into the tree the first two items, which is the smart playlist and the playlist
    for( int i = 0; i<2; i++ )
    {
        QListViewItem* newItem = new QListViewItem( this, browserItem->text(0) );
        newItem->setPixmap( 0, *browserItem->pixmap(0) );
        loadChildren( browserItem, newItem );
        newItem->setOpen( true );
        browserItem = browserItem->nextSibling();
    }
}
开发者ID:tmarques,项目名称:waheela,代码行数:17,代码来源:playlistselection.cpp


注:本文中的QListViewItem::pixmap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。