mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 09:40:52 +01:00
fix crash when the properties of a element text item group
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5356 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -466,13 +466,6 @@ QUndoCommand *DynamicElementTextModel::undoForEditedText(DynamicElementTextItem
|
|||||||
new QPropertyUndoCommand(deti, "compositeText", QVariant(deti->compositeText()), QVariant(composite_text), undo);
|
new QPropertyUndoCommand(deti, "compositeText", QVariant(deti->compositeText()), QVariant(composite_text), undo);
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::Alignment alignment = text_qsi->child(align_txt_row, 1)->data(Qt::UserRole+2).value<Qt::Alignment>();
|
|
||||||
if (alignment != deti->alignment())
|
|
||||||
{
|
|
||||||
QPropertyUndoCommand *quc = new QPropertyUndoCommand(deti, "alignment", QVariant(deti->alignment()), QVariant(alignment), undo);
|
|
||||||
quc->setText(tr("Modifier l'alignement d'un texte d'élément"));
|
|
||||||
}
|
|
||||||
|
|
||||||
int fs = text_qsi->child(size_txt_row,1)->data(Qt::EditRole).toInt();
|
int fs = text_qsi->child(size_txt_row,1)->data(Qt::EditRole).toInt();
|
||||||
if (fs != deti->fontSize())
|
if (fs != deti->fontSize())
|
||||||
{
|
{
|
||||||
@@ -528,6 +521,17 @@ QUndoCommand *DynamicElementTextModel::undoForEditedText(DynamicElementTextItem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//When text is in a groupe, they're isn't item for alignment of the text
|
||||||
|
if(text_qsi->child(align_txt_row, 1))
|
||||||
|
{
|
||||||
|
Qt::Alignment alignment = text_qsi->child(align_txt_row, 1)->data(Qt::UserRole+2).value<Qt::Alignment>();
|
||||||
|
if (alignment != deti->alignment())
|
||||||
|
{
|
||||||
|
QPropertyUndoCommand *quc = new QPropertyUndoCommand(deti, "alignment", QVariant(deti->alignment()), QVariant(alignment), undo);
|
||||||
|
quc->setText(tr("Modifier l'alignement d'un texte d'élément"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return undo;
|
return undo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user