本文整理汇总了C++中QListWidgetItem::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ QListWidgetItem::clone方法的具体用法?C++ QListWidgetItem::clone怎么用?C++ QListWidgetItem::clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListWidgetItem
的用法示例。
在下文中一共展示了QListWidgetItem::clone方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeChosenAction
void CustomToolbarCreator::removeChosenAction()
{
QListWidgetItem* item = ui->chosen_actions->currentItem();
if (item)
{
ui->offered_actions->addItem(item->clone());
delete item;
}
}
示例2: fillContentsFromListWidget
void ListWidgetEditor::fillContentsFromListWidget(QListWidget *listWidget)
{
setWindowTitle(tr("Edit List Widget"));
for (int i=0; i<listWidget->count(); ++i) {
QListWidgetItem *oldItem = listWidget->item(i);
QListWidgetItem *item = oldItem->clone();
item->setFlags(item->flags() | Qt::ItemIsEditable);
ui.listWidget->addItem(item);
}
if (ui.listWidget->count() > 0)
ui.listWidget->setCurrentRow(0);
else
updateEditor();
}
示例3: addItem
void Configuration::addItem()
{
if (m_arrangementUi.availableActionsListWidget->currentRow() >= 0)
{
QListWidgetItem *currentItem = m_arrangementUi.availableActionsListWidget->takeItem(m_arrangementUi.availableActionsListWidget->currentRow());
if (currentItem->text() == i18n("--- separator ---"))
{
m_arrangementUi.availableActionsListWidget->insertItem(0, currentItem->clone());
}
m_arrangementUi.currentActionsListWidget->insertItem((m_arrangementUi.currentActionsListWidget->currentRow() + 1), currentItem);
m_arrangementUi.currentActionsListWidget->setCurrentItem(currentItem);
m_arrangementUi.availableActionsListWidget->setCurrentItem(NULL);
}
}
示例4: addItem
void ToolBarManager::addItem()
{
if (m_managerUi->availableActionsListWidget->currentRow() >= 0)
{
QListWidgetItem *currentItem = m_managerUi->availableActionsListWidget->takeItem(m_managerUi->availableActionsListWidget->currentRow());
if (currentItem->text() == tr("--- separator ---"))
{
m_managerUi->availableActionsListWidget->insertItem(0, currentItem->clone());
}
m_managerUi->currentActionsListWidget->insertItem((m_managerUi->currentActionsListWidget->currentRow() + 1), currentItem);
m_managerUi->currentActionsListWidget->setCurrentItem(currentItem);
m_managerUi->availableActionsListWidget->setCurrentItem(NULL);
setModified(true);
}
}
示例5: addItem
void Configuration::addItem()
{
if (m_arrangementUi.availableEntriesListWidget->currentRow() < 0)
{
return;
}
QListWidgetItem *currentItem = m_arrangementUi.availableEntriesListWidget->takeItem(m_arrangementUi.availableEntriesListWidget->currentRow());
if (currentItem->text() == i18n("--- separator ---"))
{
m_arrangementUi.availableEntriesListWidget->insertItem(0, currentItem->clone());
}
m_arrangementUi.currentEntriesListWidget->insertItem((m_arrangementUi.currentEntriesListWidget->currentRow() + 1), currentItem);
m_arrangementUi.currentEntriesListWidget->setCurrentItem(currentItem);
m_arrangementUi.availableEntriesListWidget->setCurrentItem(NULL);
modify();
}