mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +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
|
||||
@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 @@ ResetConductorCommand::ResetConductorCommand(
|
||||
);
|
||||
}
|
||||
|
||||
/// 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 @@ void ResetConductorCommand::undo() {
|
||||
}
|
||||
}
|
||||
|
||||
/// 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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
conductor_profiles = cpg;
|
||||
if (conductor_profiles[currentPathType()].isNull()) {
|
||||
@@ -1644,7 +1645,7 @@ void Conductor::setProfiles(const ConductorProfilesGroup &cpg) {
|
||||
updateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
modified_path = true;
|
||||
}
|
||||
if (type() == ConductorProperties::Multi) {
|
||||
if (properties().type == ConductorProperties::Multi) {
|
||||
calculateTextItemPosition();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user