42 #include <QMessageBox>
48 setItemDelegateForColumn(1, delegate);
50 connect(treeModel, SIGNAL(hideData(
int,
const QModelIndex&)),
this, SLOT(
hideRow(
int,
const QModelIndex&)));
51 connect(treeModel, SIGNAL(showData(
int,
const QModelIndex&)),
this, SLOT(
showRow(
int,
const QModelIndex&)));
52 connect(treeModel, SIGNAL(badValue(QModelIndex, QString)),
this, SLOT(
handleBadValue(QModelIndex, QString)));
53 connect(delegate, SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)),
this, SLOT(
checkForOtherBadValues()));
57 setAlternatingRowColors(
true);
61 if(isRowHidden(row, parent)){
62 setRowHidden(row, parent,
false);
67 if(!isRowHidden(row, parent)){
68 setRowHidden(row, parent,
true);
73 if(state() != EditingState && !isRowHidden(badValueIndex.row(), badValueIndex.parent())){
74 QMessageBox::warning(
this,
"Bad parameter value", message);
75 setCurrentIndex(badValueIndex);
78 else if(!isRowHidden(badValueIndex.row(), badValueIndex.parent())){
void checkForOtherBadValues()
Checks to see if there are any other invalid indicies. If there are, it dequeues the next invalidInde...
void hideRow(int row, const QModelIndex &parent)
Used to change the visiblity of a row from shown to hidden.
TreeView(TreeModel *treeModel, Delegate *delegate, QWidget *parent=0)
Constructs a TreeView.
void issueInitilizationSignals()
Issues any signals that need to be emitted right away.
QQueue< invalidIndex > invalidInicies
A Queue containing any invalid indicies that need to be delt with.
void showRow(int row, const QModelIndex &parent)
Used to change the visiblity of a row from hidden to shown.
std::pair< QModelIndex, QString > invalidIndex
A pair representing an invalidIndex and why it's invalid.
void handleBadValue(QModelIndex badValueIndex, QString message)
Handles any badValue signals that might be emitted by the TreeModel.
bool hasDependencies()
Determines whether or not a Dependent Parameter List is being used in the TreeModel.
TreeModel is a type of QAbstractItemModel that has a Tree like structure.
The delegate used for the Optika package. For non-documented functions please refer to the Qt API...
The view used in Optikas implementation of the MVC framework.