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


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

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


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

示例1: KService

void
KCustomMenuEditor::load(KConfigBase *cfg)
{
   cfg->setGroup(QString::null);
   int count = cfg->readNumEntry("NrOfItems");
   QListViewItem *last = 0;
   for(int i = 0; i < count; i++)
   {
      QString entry = cfg->readPathEntry(QString("Item%1").arg(i+1));
      if (entry.isEmpty())
         continue;

      // Try KSycoca first.
      KService::Ptr menuItem = KService::serviceByDesktopPath( entry );
      if (!menuItem)
         menuItem = KService::serviceByDesktopName( entry );
      if (!menuItem)
         menuItem = new KService( entry );

      if (!menuItem->isValid())
         continue;

      QListViewItem *item = new Item(m_listView, menuItem);
      item->moveItem(last);
      last = item;
   }
}
开发者ID:,项目名称:,代码行数:27,代码来源:

示例2: moveDown

void LayoutConfig::moveDown()
{
    QListViewItem *sel = widget->listLayoutsDst->selectedItem();
    if(sel == 0 || sel->itemBelow() == 0)
        return;

    sel->moveItem(sel->itemBelow());
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:8,代码来源:kcmlayout.cpp

示例3: downButtonClicked

/* config-slot: "down" button clicked */
void TopLevel::downButtonClicked() {
	QListViewItem* item = listbox->currentItem();

	if (item && item->itemBelow())
		item->moveItem(item->itemBelow());

	enable_controls();
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例4: slotMoveDownAnswer

/** Button Down */
void KControlAddEdit::slotMoveDownAnswer()
{
    QListViewItem *item = _listAnswers->currentItem();

    if (item)
        item->moveItem(item->itemBelow());

    _buttonUp->setEnabled(item->itemAbove()!=0);
    _buttonDown->setEnabled(item->itemBelow()!=0);
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例5: downItem

void OListEditForm::downItem()
{
    QListViewItem *selectedItem = m_listView->selectedItem();
    if( selectedItem )
    {
        QListViewItem *nextItem = selectedItem->nextSibling();
        if( nextItem )
            selectedItem->moveItem( nextItem );
    }
}
开发者ID:NgoHuy,项目名称:uim,代码行数:10,代码来源:customwidgets.cpp

示例6: slotDownService

void kiptablesgenerator::slotDownService()
{
  QListView* ports = (QListView*) namedWidgets["iPorts"];
  QListViewItem *sel = ports->selectedItem(), *ibelow = 0;
  
  if (sel)
    ibelow=sel->itemBelow(); // Only check itemAbove() if it exists...

  if (sel  && ibelow)
    sel->moveItem(ibelow); //Move the Item
}
开发者ID:BackupTheBerlios,项目名称:kiptg-svn,代码行数:11,代码来源:kiptablesgenerator.cpp

示例7: upEntry

void DlgDirectories::upEntry()
{
    QListViewItem *item = lv_entries->selectedItem();

    if ( !item || !item->itemAbove() )
        return;

    item->moveItem( item->itemAbove()->itemAbove() );

    updateUpDown();
    emit configChanged();
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:12,代码来源:dlgDirectories.cpp

示例8: up

void GofunListWidget::up()
{
    if (!list->currentItem())
        return;
    if (list->currentItem() == list->firstChild()) 
        return;
    
    QListViewItem *item = list->firstChild();
    while (item->nextSibling() != list->currentItem())
        item = item->nextSibling();
    item->moveItem( list->currentItem()); 

	emit listChanged();
}
开发者ID:BackupTheBerlios,项目名称:gofun-svn,代码行数:14,代码来源:gofun_list_dialog.cpp

示例9: refreshButton

void
KCustomMenuEditor::slotMoveDown()
{
   QListViewItem *item = m_listView->currentItem();
   if (!item)
      return;

   QListViewItem *after = item->nextSibling();
   if (!after)
      return;

   item->moveItem( after );
   refreshButton();
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例10: slotRaise

void SequenceEditor::slotRaise()
{
  QListViewItem* item = m_list->currentItem();
  if (!item)
    {
      return;
    }

  QListViewItem* itemAbove = item->itemAbove();
  if (itemAbove)
    {
      if (itemAbove->itemAbove())
	{
	  item->moveItem(itemAbove->itemAbove());
	}
      else
	{
	  itemAbove->moveItem(item);
	}
    }

  m_list->ensureItemVisible(item);
}
开发者ID:speakman,项目名称:qlc,代码行数:23,代码来源:sequenceeditor.cpp

示例11: moveUp

void LayoutConfig::moveUp()
{
    QListViewItem *sel = widget->listLayoutsDst->selectedItem();
    if(sel == 0 || sel->itemAbove() == 0)
        return;

    if(sel->itemAbove()->itemAbove() == 0)
    {
        widget->listLayoutsDst->takeItem(sel);
        widget->listLayoutsDst->insertItem(sel);
        widget->listLayoutsDst->setSelected(sel, true);
    }
    else
        sel->moveItem(sel->itemAbove()->itemAbove());
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:15,代码来源:kcmlayout.cpp

示例12: slotLower

void SequenceEditor::slotLower()
{
  QListViewItem* item = m_list->currentItem();
  if (!item)
    {
      return;
    }

  QListViewItem* itemBelow = item->itemBelow();
  if (itemBelow)
    {
      item->moveItem(itemBelow);
    }

  m_list->ensureItemVisible(item);
}
开发者ID:speakman,项目名称:qlc,代码行数:16,代码来源:sequenceeditor.cpp

示例13: upItem

void OListEditForm::upItem()
{
    QListViewItem *selectedItem = m_listView->selectedItem();
    if( selectedItem )
    {
        QListViewItem *previousItem = NULL;
        for( QListViewItem *item = m_listView->firstChild(); item; item = item->nextSibling() )
        {
            if( item->nextSibling() == selectedItem )
                previousItem = item;
        }

        if( previousItem )
            previousItem->moveItem( selectedItem );
    }
}
开发者ID:NgoHuy,项目名称:uim,代码行数:16,代码来源:customwidgets.cpp

示例14: if

void
StdWidgetFactory::readListItem(QDomElement &node, QListViewItem *parent, KListView *listview)
{
	QListViewItem *item;
	if(parent)
		item = new KListViewItem(parent);
	else
		item = new KListViewItem(listview);

	// We need to move the item at the end of the list
	QListViewItem *last;
	if(parent)
		last = parent->firstChild();
	else
		last = listview->firstChild();

	while(last->nextSibling())
		last = last->nextSibling();
	item->moveItem(last);

	int i = 0;
	for(QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling())
	{
		QDomElement childEl = n.toElement();
		QString prop = childEl.attribute("name");
		QString tag = childEl.tagName();

		// We read sub items
		if(tag == "item")
		{
			item->setOpen(true);
			readListItem(childEl, item, listview);
		}
		// and column texts
		else if((tag == "property") && (prop == "text"))
		{
			QVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), listview, "item");
			item->setText(i, val.toString());
			i++;
		}
	}
}
开发者ID:,项目名称:,代码行数:42,代码来源:

示例15: while

void
KCustomMenuEditor::slotMoveUp()
{
   QListViewItem *item = m_listView->currentItem();
   if (!item)
      return;

   QListViewItem *searchItem = m_listView->firstChild();
   while(searchItem)
   {
      QListViewItem *next = searchItem->nextSibling();
      if (next == item)
      {
         searchItem->moveItem(item);
         break;
      }
      searchItem = next;
   }
   refreshButton();
}
开发者ID:,项目名称:,代码行数:20,代码来源:


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