Beispiel #1
0
void PeriodicTable::buttonPushed() {
   QPushButton* button(qobject_cast<QPushButton*>(sender()));
   QString name = button->objectName();
   name.remove(QRegExp("element_"));
   bool ok;
   int atomicNumber = name.toUInt(&ok);
   if (ok) {
      elementSelected(atomicNumber);
      elementSelected(QString(OpenBabel::etab.GetSymbol(atomicNumber)));
   }
}
Beispiel #2
0
void MshView::selectionChanged( const QItemSelection &selected, const QItemSelection &deselected )
{
	Q_UNUSED(deselected);
	if (!selected.isEmpty())
	{
		emit removeSelectedMeshComponent();
		const QModelIndex idx = *(selected.indexes().begin());
		const TreeItem* tree_item = static_cast<TreeModel*>(this->model())->getItem(idx);

		const MshItem* list_item = dynamic_cast<const MshItem*>(tree_item);
		if (list_item)
		{
			emit enableSaveButton(true);
			emit enableRemoveButton(true);
			emit meshSelected(list_item->getMesh());
		}
		else
		{
			emit enableSaveButton(false);
			emit enableRemoveButton(false);
			emit elementSelected(dynamic_cast<const MshItem*>(tree_item->parentItem())->vtkSource(), static_cast<unsigned>(tree_item->row()), true);
		}
	}
	//emit itemSelectionChanged(selected, deselected);
	//return QTreeView::selectionChanged(selected, deselected);
}
void AMSelectablePeriodicTable::selectElement(AMElement *element)
{
	savedElements_.append(element);
	emit elementSelected(element);
}
Beispiel #4
0
void MainWindowView::selectionChanged(const QItemSelection& selected, const QItemSelection&  )
{
    if(!selected.isEmpty())
        elementSelected(selected.indexes().first());
}