[stroke] fix: 新增描边时无法正确应用颜色修改的问题
parent
e72ba7ebbd
commit
8809daaddd
|
@ -126,7 +126,7 @@ void StrokeStyleWidget::initTable(std::shared_ptr<Renderer::StrokeRadialGradient
|
|||
(*materialMap)[newWidth] = newMaterial;
|
||||
int newRow = this->strokeTable->rowCount() - 1;
|
||||
this->strokeTable->insertRow(newRow);
|
||||
setTableRow(newRow, newWidth, newMaterial);
|
||||
setTableRow(newRow, newWidth, (*materialMap)[newWidth]);
|
||||
this->strokeTable->update();
|
||||
handlingRowInsert = false;
|
||||
});
|
||||
|
@ -149,7 +149,7 @@ void StrokeStyleWidget::setTableRow(int row, float width, Renderer::Material& ma
|
|||
strokeTable->setCellWidget(row, COLUMN_COLOR, colorPicker);
|
||||
connect(colorPicker, &ColorPicker::colorChanged, [this, colorPtr](QColor color) {
|
||||
*colorPtr = color;
|
||||
this->strokeTable->update();
|
||||
this->strokeTable->update();
|
||||
});
|
||||
|
||||
QTableWidgetItem* metallicItem = new QTableWidgetItem;
|
||||
|
@ -176,7 +176,7 @@ void StrokeStyleWidget::onCurrentItemChanged(QTableWidgetItem* current, QTableWi
|
|||
int column = current->column();
|
||||
if (column != COLUMN_COLOR && column != COLUMN_OPERATIONS)
|
||||
{
|
||||
this->currentItemValue = current->text();
|
||||
this->currentItemValue = current->data(Qt::EditRole);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ void StrokeStyleWidget::onCellChanged(int row, int column)
|
|||
changedItem->setData(Qt::EditRole, this->currentItemValue.toFloat());
|
||||
return;
|
||||
}
|
||||
auto changedWidth = strokeTable->item(row, COLUMN_WIDTH)->text().toFloat();
|
||||
auto changedWidth = strokeTable->item(row, COLUMN_WIDTH)->data(Qt::EditRole).toFloat();
|
||||
switch (column)
|
||||
{
|
||||
case COLUMN_WIDTH:
|
||||
|
|
|
@ -10,7 +10,7 @@ class StrokeStyleWidget : public QWidget
|
|||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QString currentItemValue;
|
||||
QVariant currentItemValue;
|
||||
|
||||
QtMaterialCheckBox* enableGradual;
|
||||
QComboBox* endTypeBox;
|
||||
|
|
Loading…
Reference in New Issue