Rapatriement de la branche 0.2 dans le trunk

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@558 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2009-04-03 19:30:25 +00:00
parent f84b86e4a4
commit 4da7e54d75
366 changed files with 31970 additions and 3696 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2006-2007 Xavier Guerrin
Copyright 2006-2009 Xavier Guerrin
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
@@ -33,13 +33,14 @@ PartTextField::PartTextField(QETElementEditor *editor, QGraphicsItem *parent, QG
{
setDefaultTextColor(Qt::black);
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
setPlainText(QObject::tr("_"));
setPlainText(QObject::tr("_", "default text when adding a textfield in the element editor"));
infos = new TextFieldEditor(elementEditor(), this);
infos -> setElementTypeName(name());
}
/// Destructeur
PartTextField::~PartTextField() {
if (infos -> parentWidget()) return; // le widget sera supprime par son parent
delete infos;
}
@@ -148,7 +149,7 @@ void PartTextField::focusOutEvent(QFocusEvent *e) {
if (previous_text != toPlainText()) {
undoStack().push(
new ChangePartCommand(
TextFieldEditor::tr("texte") + " " + name(),
TextFieldEditor::tr("contenu") + " " + name(),
this,
"text",
previous_text,
@@ -157,6 +158,13 @@ void PartTextField::focusOutEvent(QFocusEvent *e) {
);
previous_text = toPlainText();
}
// deselectionne le texte
QTextCursor qtc = textCursor();
qtc.clearSelection();
setTextCursor(qtc);
setTextInteractionFlags(Qt::NoTextInteraction);
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
}
@@ -197,6 +205,7 @@ void PartTextField::setProperty(const QString &property, const QVariant &value)
} else if (property == "rotate") {
follow_parent_rotations = value.toBool();
}
update();
}
/**