QElectroTech  0.70
styleeditor.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef STYLE_EDITOR_H
19 #define STYLE_EDITOR_H
20 
21 #include "elementitemeditor.h"
22 
24 class QVBoxLayout;
25 class QCheckBox;
26 class QComboBox;
27 
35 {
36  Q_OBJECT
37  // constructors, destructor
38  public:
39  StyleEditor(QETElementEditor *, CustomElementGraphicPart * = nullptr, QWidget * = nullptr);
40  ~StyleEditor() override;
41 
42  private:
43  StyleEditor(const StyleEditor &);
44 
45  // attributes
46  private:
48  QList <CustomElementGraphicPart *> m_part_list;
49  QList <CustomElementPart *> m_cep_list;
50  QVBoxLayout *main_layout;
51  QCheckBox *antialiasing;
53 
54  // methods
55  public:
56  bool setPart(CustomElementPart *) override;
57  bool setParts(QList<CustomElementPart *>) override;
58  CustomElementPart *currentPart() const override;
59 
60  static bool isStyleEditable (QList <CustomElementPart *> cep_list);
61 
62  public slots:
63  void updateForm() override;
65  void updatePartColor();
66  void updatePartLineStyle();
67  void updatePartLineWeight();
68  void updatePartFilling();
69 
70  private:
71  void activeConnections(bool);
72  void makeUndo(const QString &undo_text, const char *property_name, const QVariant &new_value);
73 };
74 #endif
CustomElementGraphicPart * part
Definition: styleeditor.h:47
bool setPart(CustomElementPart *) override
StyleEditor::setPart Set the part to edit by this editor. Note : editor can accept or refuse to edit ...
QList< CustomElementGraphicPart * > m_part_list
Definition: styleeditor.h:48
QComboBox * outline_color
Definition: styleeditor.h:52
QComboBox * size_weight
Definition: styleeditor.h:52
void updateForm() override
StyleEditor::updateForm Update the edition form according to the value of edited part(s) ...
bool setParts(QList< CustomElementPart *>) override
StyleEditor::setParts Set several parts to edit by this editor. Note : editor can accept or refuse to...
void updatePartAntialiasing()
Update antialiasing with undo command.
void updatePartColor()
Update color with undo command.
QCheckBox * antialiasing
Definition: styleeditor.h:51
static bool isStyleEditable(QList< CustomElementPart *> cep_list)
StyleEditor::isStyleEditable.
QComboBox * filling_color
Definition: styleeditor.h:52
The CustomElementGraphicPart class This class is the base for all home-made primitive like line...
QList< CustomElementPart * > m_cep_list
Definition: styleeditor.h:49
void updatePartFilling()
Update color filling with undo command.
QVBoxLayout * main_layout
Definition: styleeditor.h:50
QComboBox * line_style
Definition: styleeditor.h:52
void updatePartLineStyle()
Update style with undo command.
void updatePartLineWeight()
Update weight with undo command.
void makeUndo(const QString &undo_text, const char *property_name, const QVariant &new_value)
StyleEditor(QETElementEditor *, CustomElementGraphicPart *=nullptr, QWidget *=nullptr)
Definition: styleeditor.cpp:33
~StyleEditor() override
Destructeur.
CustomElementPart * currentPart() const override
void activeConnections(bool)