[qet] [3381] Conductor : reset conductor path also reset conductor text item position |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 3381
Author: blacksun
Date: 2014-10-19 12:08:55 +0200 (Sun, 19 Oct 2014)
Log Message:
-----------
Conductor : reset conductor path also reset conductor text item position
Modified Paths:
--------------
trunk/sources/diagramcommands.cpp
trunk/sources/qetgraphicsitem/conductor.cpp
Modified: trunk/sources/diagramcommands.cpp
===================================================================
--- trunk/sources/diagramcommands.cpp 2014-10-18 12:25:16 UTC (rev 3380)
+++ trunk/sources/diagramcommands.cpp 2014-10-19 10:08:55 UTC (rev 3381)
@@ -720,10 +720,10 @@
}
/**
- Constructeur
- @param cp Conducteurs reinitialises, associes a leur ancien profil
- @param parent QUndoCommand parent
-*/
+ * @brief ResetConductorCommand::ResetConductorCommand
+ * @param cp
+ * @param parent
+ */
ResetConductorCommand::ResetConductorCommand(
const QHash<Conductor *, ConductorProfilesGroup> &cp,
QUndoCommand *parent
@@ -740,11 +740,15 @@
);
}
-/// Destructeur
+/**
+ * @brief ResetConductorCommand::~ResetConductorCommand
+ */
ResetConductorCommand::~ResetConductorCommand() {
}
-/// Annule la reinitialisation des conducteurs
+/**
+ * @brief ResetConductorCommand::undo
+ */
void ResetConductorCommand::undo() {
diagram -> showMe();
foreach(Conductor *c, conductors_profiles.keys()) {
@@ -752,10 +756,14 @@
}
}
-/// Refait la reinitialisation des conducteurs
+/**
+ * @brief ResetConductorCommand::redo
+ */
void ResetConductorCommand::redo() {
diagram -> showMe();
foreach(Conductor *c, conductors_profiles.keys()) {
+ c -> textItem() -> forceMovedByUser (false);
+ c -> textItem() -> forceRotateByUser (false);
c -> setProfiles(ConductorProfilesGroup());
}
}
Modified: trunk/sources/qetgraphicsitem/conductor.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/conductor.cpp 2014-10-18 12:25:16 UTC (rev 3380)
+++ trunk/sources/qetgraphicsitem/conductor.cpp 2014-10-19 10:08:55 UTC (rev 3381)
@@ -1633,8 +1633,9 @@
}
/**
- @param cpg Les nouveaux profils de ce conducteur
-*/
+ * @brief Conductor::setProfiles
+ * @param cpg : the new profils of conductor
+ */
void Conductor::setProfiles(const ConductorProfilesGroup &cpg) {
conductor_profiles = cpg;
if (conductor_profiles[currentPathType()].isNull()) {
@@ -1644,7 +1645,7 @@
updateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
modified_path = true;
}
- if (type() == ConductorProperties::Multi) {
+ if (properties().type == ConductorProperties::Multi) {
calculateTextItemPosition();
}
}