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:
blacksun
2018-05-12 11:17:40 +00:00
parent 0a488f30d9
commit 748986ceec

View File

@@ -466,13 +466,6 @@ QUndoCommand *DynamicElementTextModel::undoForEditedText(DynamicElementTextItem
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();
if (fs != deti->fontSize())
{
@@ -527,6 +520,17 @@ QUndoCommand *DynamicElementTextModel::undoForEditedText(DynamicElementTextItem
quc->setText(tr("Pivoter un texte d'élément"));
}
}
//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;
}