mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Conductor : reset conductor path also reset conductor text item position
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3381 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -720,10 +720,10 @@ void ChangeConductorCommand::setConductorTextItemMove(const QPointF &pos_before,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructeur
|
* @brief ResetConductorCommand::ResetConductorCommand
|
||||||
@param cp Conducteurs reinitialises, associes a leur ancien profil
|
* @param cp
|
||||||
@param parent QUndoCommand parent
|
* @param parent
|
||||||
*/
|
*/
|
||||||
ResetConductorCommand::ResetConductorCommand(
|
ResetConductorCommand::ResetConductorCommand(
|
||||||
const QHash<Conductor *, ConductorProfilesGroup> &cp,
|
const QHash<Conductor *, ConductorProfilesGroup> &cp,
|
||||||
QUndoCommand *parent
|
QUndoCommand *parent
|
||||||
@@ -740,11 +740,15 @@ ResetConductorCommand::ResetConductorCommand(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destructeur
|
/**
|
||||||
|
* @brief ResetConductorCommand::~ResetConductorCommand
|
||||||
|
*/
|
||||||
ResetConductorCommand::~ResetConductorCommand() {
|
ResetConductorCommand::~ResetConductorCommand() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Annule la reinitialisation des conducteurs
|
/**
|
||||||
|
* @brief ResetConductorCommand::undo
|
||||||
|
*/
|
||||||
void ResetConductorCommand::undo() {
|
void ResetConductorCommand::undo() {
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
foreach(Conductor *c, conductors_profiles.keys()) {
|
foreach(Conductor *c, conductors_profiles.keys()) {
|
||||||
@@ -752,10 +756,14 @@ void ResetConductorCommand::undo() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Refait la reinitialisation des conducteurs
|
/**
|
||||||
|
* @brief ResetConductorCommand::redo
|
||||||
|
*/
|
||||||
void ResetConductorCommand::redo() {
|
void ResetConductorCommand::redo() {
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
foreach(Conductor *c, conductors_profiles.keys()) {
|
foreach(Conductor *c, conductors_profiles.keys()) {
|
||||||
|
c -> textItem() -> forceMovedByUser (false);
|
||||||
|
c -> textItem() -> forceRotateByUser (false);
|
||||||
c -> setProfiles(ConductorProfilesGroup());
|
c -> setProfiles(ConductorProfilesGroup());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1633,8 +1633,9 @@ ConductorProfilesGroup Conductor::profiles() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@param cpg Les nouveaux profils de ce conducteur
|
* @brief Conductor::setProfiles
|
||||||
*/
|
* @param cpg : the new profils of conductor
|
||||||
|
*/
|
||||||
void Conductor::setProfiles(const ConductorProfilesGroup &cpg) {
|
void Conductor::setProfiles(const ConductorProfilesGroup &cpg) {
|
||||||
conductor_profiles = cpg;
|
conductor_profiles = cpg;
|
||||||
if (conductor_profiles[currentPathType()].isNull()) {
|
if (conductor_profiles[currentPathType()].isNull()) {
|
||||||
@@ -1644,7 +1645,7 @@ void Conductor::setProfiles(const ConductorProfilesGroup &cpg) {
|
|||||||
updateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
updateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||||
modified_path = true;
|
modified_path = true;
|
||||||
}
|
}
|
||||||
if (type() == ConductorProperties::Multi) {
|
if (properties().type == ConductorProperties::Multi) {
|
||||||
calculateTextItemPosition();
|
calculateTextItemPosition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user