mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
reimplement Priv function, so the ElementEditor gets called automatically
This commit is contained in:
parent
6887c543da
commit
bc88f2ec2e
@ -210,7 +210,7 @@ void ArcEditor::updateArcA()
|
||||
@brief ArcEditor::updateForm
|
||||
Update the value of the widgets
|
||||
*/
|
||||
void ArcEditor::updateForm()
|
||||
void ArcEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) return;
|
||||
activeConnections(false);
|
||||
|
@ -59,7 +59,7 @@ class ArcEditor : public ElementItemEditor
|
||||
public slots:
|
||||
void updateArcS();
|
||||
void updateArcA();
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
void updateRect();
|
||||
|
||||
private:
|
||||
|
@ -42,6 +42,11 @@ ElementScene *ElementItemEditor::elementScene() const
|
||||
return(element_editor -> elementScene());
|
||||
}
|
||||
|
||||
void ElementItemEditor::updateForm()
|
||||
{
|
||||
updateFormPriv();
|
||||
}
|
||||
|
||||
/// @return la QUndoStack a utiliser pour les annulations
|
||||
QUndoStack &ElementItemEditor::undoStack() const
|
||||
{
|
||||
|
@ -55,7 +55,13 @@ class ElementItemEditor : public QWidget
|
||||
|
||||
virtual CustomElementPart *currentPart() const = 0;
|
||||
virtual QList<CustomElementPart*> currentParts() const = 0;
|
||||
virtual void updateForm() = 0;
|
||||
/*!
|
||||
* \brief updateForm
|
||||
* update the values of the widget
|
||||
*/
|
||||
virtual void updateForm();
|
||||
private:
|
||||
virtual void updateFormPriv() = 0;
|
||||
|
||||
// attributes
|
||||
private:
|
||||
|
@ -440,10 +440,10 @@ void StyleEditor::updatePartFilling()
|
||||
}
|
||||
|
||||
/**
|
||||
@brief StyleEditor::updateForm
|
||||
@brief StyleEditor::updateFormPriv
|
||||
Update the edition form according to the value of edited part(s)
|
||||
*/
|
||||
void StyleEditor::updateForm()
|
||||
void StyleEditor::updateFormPriv()
|
||||
{
|
||||
if (!part && m_part_list.isEmpty()) return;
|
||||
activeConnections(false);
|
||||
|
@ -60,7 +60,7 @@ class StyleEditor : public ElementItemEditor
|
||||
static bool isStyleEditable (QList <CustomElementPart *> cep_list);
|
||||
|
||||
public slots:
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
void updatePartAntialiasing();
|
||||
void updatePartColor();
|
||||
void updatePartLineStyle();
|
||||
|
@ -130,7 +130,7 @@ QList<CustomElementPart*> DynamicTextFieldEditor::currentParts() const
|
||||
return parts;
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::updateForm()
|
||||
void DynamicTextFieldEditor::updateFormPriv()
|
||||
{
|
||||
if(m_text_field) {
|
||||
ui -> m_x_sb -> setValue(m_text_field.data() -> x());
|
||||
|
@ -45,7 +45,7 @@ class DynamicTextFieldEditor : public ElementItemEditor {
|
||||
bool setParts(QList <CustomElementPart *>) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
QList<CustomElementPart*> currentParts() const override;
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
|
||||
private:
|
||||
void setupWidget();
|
||||
|
@ -110,9 +110,9 @@ QList<CustomElementPart *> EllipseEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief EllipseEditor::updateForm
|
||||
* @brief EllipseEditor::updateFormPriv
|
||||
*/
|
||||
void EllipseEditor::updateForm()
|
||||
void EllipseEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) {
|
||||
return;
|
||||
|
@ -43,7 +43,7 @@ class EllipseEditor : public ElementItemEditor
|
||||
bool setParts(QList<CustomElementPart *> parts) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
QList<CustomElementPart*> currentParts() const override;
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
|
||||
private slots:
|
||||
void on_m_x_sb_editingFinished();
|
||||
|
@ -176,10 +176,10 @@ QList<CustomElementPart *> LineEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
@brief LineEditor::updateForm
|
||||
@brief LineEditor::updateFormPriv
|
||||
Reimplemented from ElementItemEditor
|
||||
*/
|
||||
void LineEditor::updateForm()
|
||||
void LineEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) {
|
||||
return;
|
||||
|
@ -43,7 +43,7 @@ class LineEditor : public ElementItemEditor
|
||||
bool setParts(QList <CustomElementPart *> parts) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
QList<CustomElementPart *> currentParts() const override;
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
|
||||
private:
|
||||
void setUpChangeConnections();
|
||||
|
@ -130,10 +130,10 @@ QList<CustomElementPart*> PolygonEditor::currentParts() const
|
||||
}
|
||||
|
||||
/**
|
||||
@brief PolygonEditor::updateForm
|
||||
@brief PolygonEditor::updateFormPriv
|
||||
Update the widget
|
||||
*/
|
||||
void PolygonEditor::updateForm()
|
||||
void PolygonEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) {
|
||||
return;
|
||||
|
@ -39,7 +39,7 @@ class PolygonEditor : public ElementItemEditor
|
||||
bool setPart(CustomElementPart *part) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
QList<CustomElementPart*> currentParts() const override;
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
QVector<QPointF> pointsFromTree();
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
|
||||
|
@ -136,7 +136,7 @@ QPointF RectangleEditor::editedTopLeft() const
|
||||
/**
|
||||
@brief RectangleEditor::updateForm
|
||||
*/
|
||||
void RectangleEditor::updateForm()
|
||||
void RectangleEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) {
|
||||
return;
|
||||
|
@ -48,7 +48,7 @@ class RectangleEditor : public ElementItemEditor
|
||||
QPointF editedTopLeft () const;
|
||||
|
||||
public slots:
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
private:
|
||||
void editingFinished();
|
||||
void activeConnections(bool active);
|
||||
|
@ -46,11 +46,11 @@ TerminalEditor::~TerminalEditor()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalEditor::updateForm
|
||||
* @brief TerminalEditor::updateFormPriv
|
||||
* Reimplemented from ElementItemEditor
|
||||
* Update the content of this widget
|
||||
*/
|
||||
void TerminalEditor::updateForm()
|
||||
void TerminalEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) {
|
||||
return;
|
||||
|
@ -39,7 +39,7 @@ class TerminalEditor : public ElementItemEditor
|
||||
TerminalEditor(QETElementEditor *editor, QWidget *parent = nullptr);
|
||||
~TerminalEditor() override;
|
||||
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
bool setPart(CustomElementPart *new_part) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
QList<CustomElementPart *> currentParts() const override {return QList<CustomElementPart *>();}
|
||||
|
@ -48,7 +48,7 @@ TextEditor::~TextEditor() {}
|
||||
@brief TextEditor::updateForm
|
||||
Update the gui
|
||||
*/
|
||||
void TextEditor::updateForm()
|
||||
void TextEditor::updateFormPriv()
|
||||
{
|
||||
if (m_text.isNull()) {
|
||||
return;
|
||||
|
@ -38,7 +38,7 @@ class TextEditor : public ElementItemEditor {
|
||||
explicit TextEditor(QETElementEditor *editor, PartText *text = nullptr, QWidget *parent = nullptr);
|
||||
~TextEditor() override;
|
||||
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
bool setPart(CustomElementPart *part) override;
|
||||
bool setParts(QList <CustomElementPart *>) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user