mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
bug fix and minor change
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2089 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -6,7 +6,8 @@
|
|||||||
ConductorAutoNumerotationWidget::ConductorAutoNumerotationWidget(Conductor *c, QSet<Conductor *> cl, QWidget *parent) :
|
ConductorAutoNumerotationWidget::ConductorAutoNumerotationWidget(Conductor *c, QSet<Conductor *> cl, QWidget *parent) :
|
||||||
QDialog (parent),
|
QDialog (parent),
|
||||||
conductor_(c),
|
conductor_(c),
|
||||||
c_list(cl)
|
c_list(cl),
|
||||||
|
diagram_(c -> diagram())
|
||||||
{
|
{
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
setWindowFlags(Qt::Sheet);
|
setWindowFlags(Qt::Sheet);
|
||||||
@@ -99,9 +100,12 @@ QMultiMap <int, QString> ConductorAutoNumerotationWidget::conductorsTextToMap(QS
|
|||||||
*applique le texte selectionne @text_ a tout les conducteur de @c_list et a @conducteur_
|
*applique le texte selectionne @text_ a tout les conducteur de @c_list et a @conducteur_
|
||||||
*/
|
*/
|
||||||
void ConductorAutoNumerotationWidget::applyText() {
|
void ConductorAutoNumerotationWidget::applyText() {
|
||||||
|
QSet <Conductor *> conductorslist = c_list;
|
||||||
|
conductorslist << conductor_;
|
||||||
QList <ConductorProperties> old_properties, new_properties;
|
QList <ConductorProperties> old_properties, new_properties;
|
||||||
ConductorProperties cp;
|
ConductorProperties cp;
|
||||||
foreach (Conductor *c, c_list) {
|
|
||||||
|
foreach (Conductor *c, conductorslist) {
|
||||||
old_properties << c -> properties();
|
old_properties << c -> properties();
|
||||||
cp = c -> properties();
|
cp = c -> properties();
|
||||||
cp.text = text_;
|
cp.text = text_;
|
||||||
@@ -110,15 +114,10 @@ void ConductorAutoNumerotationWidget::applyText() {
|
|||||||
c -> setText(text_);
|
c -> setText(text_);
|
||||||
}
|
}
|
||||||
// initialise l'objet UndoCommand correspondant
|
// initialise l'objet UndoCommand correspondant
|
||||||
ChangeSeveralConductorsPropertiesCommand *cscpc = new ChangeSeveralConductorsPropertiesCommand(c_list);
|
ChangeSeveralConductorsPropertiesCommand *cscpc = new ChangeSeveralConductorsPropertiesCommand(conductorslist);
|
||||||
cscpc -> setOldSettings(old_properties);
|
cscpc -> setOldSettings(old_properties);
|
||||||
cscpc -> setNewSettings(new_properties);
|
cscpc -> setNewSettings(new_properties);
|
||||||
conductor_ -> diagram() -> undoStack().push(cscpc);
|
diagram_ -> undoStack().push(cscpc);
|
||||||
|
|
||||||
cp = conductor_ -> properties();
|
|
||||||
cp.text = text_;
|
|
||||||
conductor_ -> setProperties(cp);
|
|
||||||
conductor_ -> setText(text_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <QMultiMap>
|
#include <QMultiMap>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include "conductor.h"
|
#include "conductor.h"
|
||||||
|
#include "diagram.h"
|
||||||
|
|
||||||
class ConductorAutoNumerotationWidget : public QDialog
|
class ConductorAutoNumerotationWidget : public QDialog
|
||||||
{
|
{
|
||||||
@@ -28,6 +29,7 @@ class ConductorAutoNumerotationWidget : public QDialog
|
|||||||
//attributes
|
//attributes
|
||||||
Conductor *conductor_;
|
Conductor *conductor_;
|
||||||
QSet<Conductor *> c_list; //liste des conducteurs au même potentiel
|
QSet<Conductor *> c_list; //liste des conducteurs au même potentiel
|
||||||
|
Diagram *diagram_;
|
||||||
QList <QRadioButton *> *radio_List;
|
QList <QRadioButton *> *radio_List;
|
||||||
QLineEdit *text_field;
|
QLineEdit *text_field;
|
||||||
QString text_;
|
QString text_;
|
||||||
|
|||||||
@@ -989,7 +989,7 @@ void ChangeSeveralConductorsPropertiesCommand::redo() {
|
|||||||
if (old_settings_set && new_settings_set) {
|
if (old_settings_set && new_settings_set) {
|
||||||
int i=0;
|
int i=0;
|
||||||
foreach(Conductor *c, conductors) {
|
foreach(Conductor *c, conductors) {
|
||||||
c -> setProperties(new_properties.at(0));
|
c -> setProperties(new_properties.at(i));
|
||||||
c -> update();
|
c -> update();
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user