本文整理汇总了C++中QListWidget::row方法的典型用法代码示例。如果您正苦于以下问题:C++ QListWidget::row方法的具体用法?C++ QListWidget::row怎么用?C++ QListWidget::row使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListWidget
的用法示例。
在下文中一共展示了QListWidget::row方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_list_widget_take_item (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QListWidget *lw = self->v8_to_qobject<QListWidget> (Args.This ());
if (lw) {
if (Args.Length ()) {
QListWidgetItem *item = self->_to_qlistwidgetitem (Args[0]);
if (item) {
item = lw->takeItem (lw->row (item));
if (item) {
result = self->create_v8_qlistwidgetitem (item);
}
}
}
}
}
return scope.Close (result);
}
示例2: GetValueChoiceIndex
int cQFilterWindow::GetValueChoiceIndex( const eValue iValue, int iItemIndex ) const
/**********************************************************************/
{
QListWidget *vList = ( QListWidget*)( mGrid.itemAtPosition( (int)iValue, 1 )->widget() );
return vList->row( vList->selectedItems()[ iItemIndex ] );
}
示例3:
void
PreferencesDialog::moveSelectedListWidgetItems(QListWidget &from,
QListWidget &to) {
for (auto const &item : from.selectedItems()) {
auto actualItem = from.takeItem(from.row(item));
if (actualItem)
to.addItem(actualItem);
}
}
示例4: buttonAddClicked
void KActionSelectorPrivate::buttonAddClicked()
{
// move all selected items from available to selected listbox
QList<QListWidgetItem *> list = availableListWidget->selectedItems();
foreach (QListWidgetItem* item, list) {
availableListWidget->takeItem( availableListWidget->row( item ) );
selectedListWidget->insertItem( insertionIndex( selectedListWidget, selectedInsertionPolicy ), item );
selectedListWidget->setCurrentItem( item );
emit q->added( item );
}
示例5: moveUp
void ManageUserDirectories::moveUp() {
QListWidget *list = listWidget();
QList<QListWidgetItem *> selected = list->selectedItems();
for (int i = 0; i < selected.size(); i++) {
int index = list->row(selected[i]);
if (index != 0) {
QListWidgetItem *move = list->takeItem(index);
list->insertItem(index - 1, move);
}
list->setCurrentItem(selected[i]);
}
}
示例6: ProcessRemoved
void MainWindow::ProcessRemoved(Process* _process)
{
QListWidgetItem* item = this->GetProcessItem(_process);
QListWidget* list = this->ui.procListWidget;
if(item != NULL)
delete list->takeItem(list->row(item));
if (list->count() == 0x00)
this->ResetUI();
else
list->setCurrentRow(0x00);
}
示例7: ProcessAdded
void MainWindow::ProcessAdded(Process* _process)
{
QListWidget* list = this->ui.procListWidget;
list->addItem(QString::number(_process->id, 10));
QListWidgetItem* item = this->GetProcessItem(_process);
if(item != NULL)
{
int row = list->row(item);
list->setCurrentRow(row);
}
}
示例8: on_removeVesselPushButton_clicked
void MainWindow::on_removeVesselPushButton_clicked()
{
QListWidget* injectionList = findChild<QListWidget*>("InjectableVesselsListView");
QListWidget* savesList = findChild<QListWidget*>("vesselsInSaveListView");
QList<QListWidgetItem*> selected = savesList->selectedItems();
for(QList<QListWidgetItem*>::Iterator it = selected.begin(); it != selected.end(); it++)
{
QListWidgetItem* item = (*it);
savesList->takeItem(savesList->row(item));
injectionList->addItem(item);
}
}
示例9: on_deleteButton_clicked
void MainWindow::on_deleteButton_clicked()
{
QListWidget *list = ui->taskList;
for (QListWidgetItem *item : list->selectedItems())
{
bool hasId = false;
int id = item->data(Qt::UserRole).toInt(&hasId);
if (hasId)
{
deleteTask(id);
}
list->takeItem(list->row(item));
delete item;
}
}
示例10: selectPrev
void AnimationDialog::selectPrev()
{
m_kfi->stopInterpolation();
QListWidget* list = m_ui->listWidget;
int prev = list->row(m_item) - 1;
if( !(prev >= 0 && list->count()) )
{
prev = 0;
}
AnimationListItem* item = static_cast<AnimationListItem*>(list->item(prev));
list->setCurrentItem(item);
m_item = item;
m_parent->camera()->interpolateTo(m_item->frame(), 0.5);
}
示例11: selectNext
void AnimationDialog::selectNext()
{
m_kfi->stopInterpolation();
QListWidget* list = m_ui->listWidget;
int next = list->row(m_item) + 1;
if(next > list->count() - 1)
{
next = list->count() - 1;
}
AnimationListItem* item = static_cast<AnimationListItem*>(list->item(next));
list->setCurrentItem(item);
m_item = item;
m_parent->camera()->interpolateTo(m_item->frame(), 0.5);
}
示例12: setting_changed_list
void Settings::setting_changed_list(QListWidgetItem* item)
{
QObject* sender = this->sender();
QListWidget* listw = dynamic_cast<QListWidget*>(sender);
if (listw)
{
const QString module_name = sender->parent()->objectName();
const int index = listw->row(item);
QVariantList list = map_[module_name][sender->objectName()].toList();
if (item->text().isEmpty())
list.removeAt(index);
else
{
if (index >= list.size())
list.push_back(QVariant(item->text()));
else
list[index] = QVariant(item->text());
}
map_[module_name][sender->objectName()] = QVariant(list);
}
}