Visual updates
This commit is contained in:
@@ -62,8 +62,10 @@ QWidget* BCValueDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt
|
||||
|
||||
const BCValue& bcValue = *(_valueList[ index.row() ].get());
|
||||
|
||||
BCValue::ValueRange params;
|
||||
bool hasData = bcValue.hasValuesForSlider( params );
|
||||
|
||||
//qDebug() << " --- Create Editor: " << bcValue.label() << " value: " << params.value << " min: " << params.min << " max: " << params.max << " ratio:" << bcValue.calcMinMaxRatio()*100.0 << '%';
|
||||
qDebug() << " --- Create Editor: " << bcValue.label() << " value: " << params.value << " min: " << params.min << " max: " << params.max << " ratio:" << bcValue.calcMinMaxRatio()*100.0 << '%';
|
||||
|
||||
if( bcValue.isBoolean() )
|
||||
{
|
||||
@@ -72,17 +74,15 @@ QWidget* BCValueDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt
|
||||
|
||||
// Signal für sofortige Updates
|
||||
connect(toggleSwitch, &BCToggleSwitch::toggled, this, [this, toggleSwitch](bool checked)
|
||||
{
|
||||
qDebug() << "--- toggled: " << checked;
|
||||
// Commit data sofort bei Änderung
|
||||
emit const_cast<BCValueDelegate*>(this)->commitData(toggleSwitch);
|
||||
});
|
||||
{
|
||||
qDebug() << "--- toggled: " << checked;
|
||||
// Commit data sofort bei Änderung
|
||||
emit const_cast<BCValueDelegate*>(this)->commitData(toggleSwitch);
|
||||
});
|
||||
|
||||
return toggleSwitch;
|
||||
}
|
||||
|
||||
BCValue::ValueRange params;
|
||||
bool hasData = bcValue.hasValuesForSlider( params );
|
||||
|
||||
if( !hasData )
|
||||
return nullptr;
|
||||
@@ -95,17 +95,6 @@ QWidget* BCValueDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt
|
||||
// Commit data sofort bei Änderung
|
||||
emit const_cast<BCValueDelegate*>(this)->commitData(valueSlider);
|
||||
});
|
||||
|
||||
/*
|
||||
// Signal für sofortige Updates
|
||||
connect(valueSlider, &BCValueSlider::valueCommited, this, [this, valueSlider](int newValue)
|
||||
{
|
||||
qDebug() << " --- value set:" << newValue;
|
||||
// Commit data sofort bei Änderung
|
||||
emit const_cast<BCValueDelegate*>(this)->commitData(valueSlider);
|
||||
});
|
||||
*/
|
||||
|
||||
return valueSlider;
|
||||
}
|
||||
|
||||
@@ -125,18 +114,6 @@ void BCValueDelegate::updateEditorGeometry(QWidget* editor, const QStyleOptionVi
|
||||
|
||||
const BCValue& bcValue = *(_valueList[ index.row()].get());
|
||||
QRect editorRect = bcValue.isBoolean() ? adjustEditorRect(option.rect, 0, 6, -130, -6) : adjustEditorRect(option.rect, 0, 0, 8, 0);
|
||||
|
||||
/*
|
||||
if( !bcValue.isBoolean())
|
||||
{
|
||||
editorRect = adjustEditorRect( option.rect,0,0,8,0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
editorRect = adjustEditorRect(option.rect, 0, 6, -130, -6);
|
||||
}
|
||||
*/
|
||||
|
||||
editor->setGeometry(editorRect);
|
||||
}
|
||||
|
||||
@@ -161,7 +138,7 @@ void BCValueDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, c
|
||||
}
|
||||
|
||||
model->setData(index, reValue, Qt::EditRole);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user