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);
}
int cQFilterWindow::GetValueChoiceIndex( const eValue iValue, int iItemIndex ) const
/**********************************************************************/
{
    QListWidget *vList = ( QListWidget*)( mGrid.itemAtPosition( (int)iValue, 1 )->widget() );
    
    return vList->row( vList->selectedItems()[ iItemIndex ] );
}
Exemplo n.º 3
0
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);
  }
}
Exemplo n.º 4
0
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 );
  }
Exemplo n.º 5
0
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]);
  }
}
Exemplo n.º 6
0
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);
}
Exemplo n.º 7
0
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);
  }
}
Exemplo n.º 8
0
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);
    }
}
Exemplo n.º 9
0
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;
    }
}
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);
}
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);
}
Exemplo n.º 12
0
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);
	}
}