36 [[nodiscard]]
bool contains(
int id)
const;
70 QHash<int, ItemWithId *> m_elementRegistry;
Base class providing a unique integer identifier for circuit items.
Owns the id↔item bookkeeping for a Scene: the id-to-item map and the monotonically increasing last-as...
void registerItem(ItemWithId *item)
Registers item under its current id.
int nextId()
Returns a fresh, previously unused id.
bool contains(int id) const
Returns true if an item is registered under id.
void unregisterItem(ItemWithId *item)
Removes item's mapping from the registry.
void updateItemId(ItemWithId *item, int newId)
Pre-assigns newId to item before it is added (undo/redo restore path).
int lastId() const
Returns the highest id assigned so far.
void forget(ItemWithId *item)
void forgetItemId(int id)
void setLastId(int newLastId)
Raises the last-assigned id to newLastId (never lowers it).
ItemWithId * itemById(int id) const
Returns the item registered under id, or nullptr.