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


C++ QListWidget::row方法代码示例

本文整理汇总了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);
}
开发者ID:rharder,项目名称:js,代码行数:29,代码来源:dmzJsModuleUiV8QtBasicListWidget.cpp

示例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 ] );
}
开发者ID:sandsmark,项目名称:ReplicodeVisualizer-old,代码行数:7,代码来源:cQFilterWindow.cpp

示例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);
  }
}
开发者ID:b2kguga,项目名称:mkvtoolnix,代码行数:9,代码来源:preferences_dialog.cpp

示例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 );
  }
开发者ID:vasi,项目名称:kdelibs,代码行数:10,代码来源:kactionselector.cpp

示例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]);
  }
}
开发者ID:DanNixon,项目名称:mantid,代码行数:12,代码来源:ManageUserDirectories.cpp

示例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);
}
开发者ID:dpsm,项目名称:pwatchdog,代码行数:12,代码来源:MainWindow.cpp

示例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);
  }
}
开发者ID:dpsm,项目名称:pwatchdog,代码行数:12,代码来源:MainWindow.cpp

示例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);
    }
}
开发者ID:DaymareDev,项目名称:KSPS3,代码行数:14,代码来源:mainwindow.cpp

示例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;
    }
}
开发者ID:cl0ne,项目名称:kpi-educational-tasks,代码行数:15,代码来源:mainwindow.cpp

示例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);
}
开发者ID:Degot,项目名称:Las-Vegas-Reconstruction,代码行数:15,代码来源:AnimationDialog.cpp

示例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);
}
开发者ID:Degot,项目名称:Las-Vegas-Reconstruction,代码行数:15,代码来源:AnimationDialog.cpp

示例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);
	}
}
开发者ID:etienneschmitt,项目名称:SCHNApps,代码行数:21,代码来源:settings.cpp


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