本文整理汇总了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;
}
}
示例2: moveDown
void LayoutConfig::moveDown()
{
QListViewItem *sel = widget->listLayoutsDst->selectedItem();
if(sel == 0 || sel->itemBelow() == 0)
return;
sel->moveItem(sel->itemBelow());
}
示例3: downButtonClicked
/* config-slot: "down" button clicked */
void TopLevel::downButtonClicked() {
QListViewItem* item = listbox->currentItem();
if (item && item->itemBelow())
item->moveItem(item->itemBelow());
enable_controls();
}
示例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);
}
示例5: downItem
void OListEditForm::downItem()
{
QListViewItem *selectedItem = m_listView->selectedItem();
if( selectedItem )
{
QListViewItem *nextItem = selectedItem->nextSibling();
if( nextItem )
selectedItem->moveItem( nextItem );
}
}
示例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
}
示例7: upEntry
void DlgDirectories::upEntry()
{
QListViewItem *item = lv_entries->selectedItem();
if ( !item || !item->itemAbove() )
return;
item->moveItem( item->itemAbove()->itemAbove() );
updateUpDown();
emit configChanged();
}
示例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();
}
示例9: refreshButton
void
KCustomMenuEditor::slotMoveDown()
{
QListViewItem *item = m_listView->currentItem();
if (!item)
return;
QListViewItem *after = item->nextSibling();
if (!after)
return;
item->moveItem( after );
refreshButton();
}
示例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);
}
示例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());
}
示例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);
}
示例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 );
}
}
示例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++;
}
}
}
示例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();
}