Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Do not make the compound variables disabled.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25159 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Mar 19, 2015
1 parent 14d8de4 commit 654278c
Showing 1 changed file with 8 additions and 7 deletions.
Expand Up @@ -239,10 +239,12 @@ Qt::ItemFlags TVariablesTreeModel::flags(const QModelIndex &index) const
if (!index.isValid())
return 0;

Qt::ItemFlags flags;
TVariablesTreeItem *pTVariablesTreeItem = static_cast<TVariablesTreeItem*>(index.internalPointer());
if (pTVariablesTreeItem && pTVariablesTreeItem->getChildren().size() == 0)
flags |= Qt::ItemIsEnabled | Qt::ItemIsSelectable;
Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
/* Ticket #3207. Make all the items enable and selectable.
*/
// TVariablesTreeItem *pTVariablesTreeItem = static_cast<TVariablesTreeItem*>(index.internalPointer());
// if (pTVariablesTreeItem && pTVariablesTreeItem->getChildren().size() == 0)
// flags |= Qt::ItemIsEnabled | Qt::ItemIsSelectable;

return flags;
}
Expand Down Expand Up @@ -1225,7 +1227,7 @@ void TransformationsWidget::fetchVariableData(const QModelIndex &index)
return;
QModelIndex modelIndex = mpTVariableTreeProxyModel->mapToSource(index);
TVariablesTreeItem *pTVariableTreeItem = static_cast<TVariablesTreeItem*>(modelIndex.internalPointer());
if (!pTVariableTreeItem || pTVariableTreeItem->getChildren().size() != 0)
if (!pTVariableTreeItem)
return;

const OMVariable &variable = mVariables[pTVariableTreeItem->getVariableName()];
Expand All @@ -1240,8 +1242,7 @@ void TransformationsWidget::fetchVariableData(const QModelIndex &index)
return;
/* open the model with and go to the variable line */
QFile file(variable.info.file);
if (file.exists())
{
if (file.exists()) {
mpTSourceEditorFileLabel->setText(file.fileName());
mpTSourceEditorFileLabel->show();
file.open(QIODevice::ReadOnly);
Expand Down

0 comments on commit 654278c

Please sign in to comment.