mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-09 21:54:13 +02:00
Project database: tables for shapes, independent texts and images
Now that they carry a uuid, the folio's drawing furniture gets rows of its own: shape, independent_text and image, plus drawing_item_view, which finds any of them by uuid without knowing its kind first and says which folio it is on. Rows follow edits, not just loads. The script API's query() and every other reader go through newQuery() without a rebuild, so an item's row is queued on each change (moves, restyles, text edits, uuid renewal) and the queue is flushed by newQuery() and updateDB() -- a queued write is a set insertion, which matters for a drag that moves hundreds of items per mouse step. A pasted copy joins its folio still carrying its source's uuid and is only renewed afterwards, so a flush in between must not let the copy overwrite its source's row. Each row remembers the item that wrote it; another item with the same uuid waits until uuidChanged() says it has its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1918,6 +1918,13 @@ void Diagram::addItem(QGraphicsItem *item)
|
||||
m_project->dataBase()->addConductor(conductor);
|
||||
break;
|
||||
}
|
||||
case QetShapeItem::Type:
|
||||
case IndependentTextItem::Type:
|
||||
case DiagramImageItem::Type:
|
||||
{
|
||||
m_project->dataBase()->addDrawingItem(item);
|
||||
break;
|
||||
}
|
||||
default: {break;}
|
||||
}
|
||||
}
|
||||
@@ -1949,6 +1956,13 @@ void Diagram::removeItem(QGraphicsItem *item)
|
||||
m_project->dataBase()->removeConductor(conductor);
|
||||
break;
|
||||
}
|
||||
case QetShapeItem::Type:
|
||||
case IndependentTextItem::Type:
|
||||
case DiagramImageItem::Type:
|
||||
{
|
||||
m_project->dataBase()->removeDrawingItem(item);
|
||||
break;
|
||||
}
|
||||
default: {break;}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user