mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-13 12:29:59 +01:00
Diagram command add QGraphicsItem and derived :
Remove each comand for each type and replace it by generic class by using template class (addItemComand). git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3368 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -30,9 +30,9 @@ DVEventAddText::~DVEventAddText() {}
|
||||
|
||||
bool DVEventAddText::mousePressEvent(QMouseEvent *event) {
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
m_diagram -> undoStack().push(new AddTextCommand(m_diagram,
|
||||
new IndependentTextItem("_"),
|
||||
m_dv -> mapToScene(event -> pos())));
|
||||
m_diagram -> undoStack().push(new AddItemCommand<IndependentTextItem *>(new IndependentTextItem("_"),
|
||||
m_diagram,
|
||||
m_dv -> mapToScene(event -> pos())));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user