Fix intensive call of updateUi when move a QetGraphicsTableItem

This commit is contained in:
joshua
2022-02-10 19:11:06 +01:00
parent 087c8980f0
commit 062ae6e9eb
2 changed files with 9 additions and 2 deletions

View File

@@ -91,11 +91,11 @@ void GraphicsTablePropertiesEditor::setTable(QetGraphicsTableItem *table)
m_connect_list << connect(m_table_item.data(),
&QetGraphicsTableItem::xChanged,
this,
&GraphicsTablePropertiesEditor::updateUi);
&GraphicsTablePropertiesEditor::updatePosWidget);
m_connect_list << connect(m_table_item.data(),
&QetGraphicsTableItem::yChanged,
this,
&GraphicsTablePropertiesEditor::updateUi);
&GraphicsTablePropertiesEditor::updatePosWidget);
if (auto editor = PropertiesEditorFactory::propertiesEditor(table->model(), this))
@@ -390,6 +390,12 @@ void GraphicsTablePropertiesEditor::updateUi()
setUpEditConnection();
}
void GraphicsTablePropertiesEditor::updatePosWidget()
{
ui->m_x_pos->setValue(m_table_item->pos().x());
ui->m_y_pos->setValue(m_table_item->pos().y());
}
void GraphicsTablePropertiesEditor::updateInfoLabel()
{
auto table_ = m_table_item;