2014-02-22 17:24:20 +00:00
|
|
|
/*
|
2015-02-20 14:56:22 +00:00
|
|
|
Copyright 2006-2015 The QElectroTech Team
|
2014-02-22 17:24:20 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2014-02-18 20:44:54 +00:00
|
|
|
#ifndef MASTERPROPERTIESWIDGET_H
|
|
|
|
#define MASTERPROPERTIESWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2014-09-20 18:26:13 +00:00
|
|
|
#include <QHash>
|
2015-05-07 22:15:00 +00:00
|
|
|
#include "PropertiesEditor/propertieseditorwidget.h"
|
2014-07-21 20:44:32 +00:00
|
|
|
|
|
|
|
class QListWidgetItem;
|
2014-09-20 18:26:13 +00:00
|
|
|
class Element;
|
2014-12-11 20:10:28 +00:00
|
|
|
class QUndoCommand;
|
2015-05-19 21:41:05 +00:00
|
|
|
class QETProject;
|
|
|
|
class Diagram;
|
2014-02-18 20:44:54 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MasterPropertiesWidget;
|
|
|
|
}
|
|
|
|
|
2014-02-26 23:57:22 +00:00
|
|
|
/**
|
|
|
|
* @brief The MasterPropertiesWidget class
|
|
|
|
* This class is a widget for make link between a master element with several slave element.
|
|
|
|
* This class embenddedthe undo/redo command when apply new connection.
|
|
|
|
*/
|
|
|
|
|
2015-05-02 22:25:01 +00:00
|
|
|
class MasterPropertiesWidget : public PropertiesEditorWidget
|
2014-02-18 20:44:54 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-02-22 17:24:20 +00:00
|
|
|
explicit MasterPropertiesWidget(Element *elmt, QWidget *parent = 0);
|
2014-02-18 20:44:54 +00:00
|
|
|
~MasterPropertiesWidget();
|
|
|
|
|
2015-05-19 21:41:05 +00:00
|
|
|
void setElement (Element *element);
|
2015-05-02 22:25:01 +00:00
|
|
|
void apply();
|
2014-02-26 23:57:22 +00:00
|
|
|
void reset();
|
2015-05-03 17:32:28 +00:00
|
|
|
QUndoCommand *associatedUndo () const;
|
|
|
|
QString title() const {return tr("Référence croisée (maitre)");}
|
2014-02-26 23:57:22 +00:00
|
|
|
|
2014-02-22 17:24:20 +00:00
|
|
|
private slots:
|
2015-05-19 21:41:05 +00:00
|
|
|
void buildInterface();
|
2015-05-07 22:15:00 +00:00
|
|
|
void on_link_button_clicked();
|
|
|
|
void on_unlink_button_clicked();
|
|
|
|
void showElementFromLWI(QListWidgetItem *lwi);
|
|
|
|
void showedElementWasDeleted ();
|
2015-05-19 21:41:05 +00:00
|
|
|
void diagramWasdeletedFromProject();
|
2014-02-22 17:24:20 +00:00
|
|
|
|
2014-02-18 20:44:54 +00:00
|
|
|
private:
|
|
|
|
Ui::MasterPropertiesWidget *ui;
|
2015-05-19 21:41:05 +00:00
|
|
|
Element *m_element;
|
2014-02-26 23:57:22 +00:00
|
|
|
QHash <QListWidgetItem *, Element *> lwi_hash;
|
2015-05-07 22:15:00 +00:00
|
|
|
Element *m_showed_element;
|
2015-05-19 21:41:05 +00:00
|
|
|
QETProject *m_project;
|
2014-02-18 20:44:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MASTERPROPERTIESWIDGET_H
|