Skip to content

Commit

Permalink
Added tool-tip for all columns of Variables Browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Nov 16, 2015
1 parent 1d15d3b commit 36083c2
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions OMEdit/OMEditGUI/Plotting/VariablesWidget.cpp
Expand Up @@ -126,18 +126,15 @@ int VariablesTreeItem::columnCount() const

bool VariablesTreeItem::setData(int column, const QVariant &value, int role)
{
if (column == 0 && role == Qt::CheckStateRole)
{
if (value.toInt() == Qt::Checked)
if (column == 0 && role == Qt::CheckStateRole) {
if (value.toInt() == Qt::Checked) {
setChecked(true);
else if (value.toInt() == Qt::Unchecked)
} else if (value.toInt() == Qt::Unchecked) {
setChecked(false);
}
return true;
}
else if (column == 1 && role == Qt::EditRole)
{
if (mValue.compare(value.toString()) != 0)
{
} else if (column == 1 && role == Qt::EditRole) {
if (mValue.compare(value.toString()) != 0) {
mValueChanged = true;
mValue = value.toString();
}
Expand All @@ -148,11 +145,9 @@ bool VariablesTreeItem::setData(int column, const QVariant &value, int role)

QVariant VariablesTreeItem::data(int column, int role) const
{
switch (column)
{
switch (column) {
case 0:
switch (role)
{
switch (role) {
case Qt::DisplayRole:
return mDisplayVariableName;
case Qt::DecorationRole:
Expand All @@ -168,26 +163,24 @@ QVariant VariablesTreeItem::data(int column, int role) const
return QVariant();
}
case 1:
switch (role)
{
switch (role) {
case Qt::DisplayRole:
return mValue;
case Qt::ToolTipRole:
case Qt::EditRole:
return mValue;
default:
return QVariant();
}
case 2:
switch (role)
{
switch (role) {
case Qt::DisplayRole:
case Qt::ToolTipRole:
return mUnit;
default:
return QVariant();
}
case 3:
switch (role)
{
switch (role) {
case Qt::DisplayRole:
case Qt::ToolTipRole:
return mDescription;
Expand Down

0 comments on commit 36083c2

Please sign in to comment.