QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
styleeditor.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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
24class QVBoxLayout;
25class QCheckBox;
26class QComboBox;
27
35{
36 Q_OBJECT
37 // constructors, destructor
38 public:
39 StyleEditor(QETElementEditor *, CustomElementGraphicPart * = nullptr, QWidget * = nullptr);
40 ~StyleEditor() override;
41
42 private:
44
45 // attributes
46 private:
48 QList <CustomElementGraphicPart *> m_part_list;
49 QList <CustomElementPart *> m_cep_list;
50 QCheckBox *antialiasing;
52
53 // methods
54 public:
55 bool setPart(CustomElementPart *) override;
56 bool setParts(QList<CustomElementPart *>) override;
57 CustomElementPart *currentPart() const override;
58 QList<CustomElementPart*> currentParts() const override;
59
60 static bool isStyleEditable (QList <CustomElementPart *> cep_list);
61
62 public slots:
63 void updateForm() override;
65 void updatePartColor();
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
The CustomElementGraphicPart class This class is the base for all home-made primitive like line,...
Definition customelementgraphicpart.h:36
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition customelementpart.h:40
Definition elementitemeditor.h:34
Definition qetelementeditor.h:39
Definition styleeditor.h:35
QList< CustomElementPart * > m_cep_list
Definition styleeditor.h:49
QComboBox * outline_color
Definition styleeditor.h:51
CustomElementPart * currentPart() const override
Definition styleeditor.cpp:551
QList< CustomElementGraphicPart * > m_part_list
Definition styleeditor.h:48
void makeUndo(const QString &undo_text, const char *property_name, const QVariant &new_value)
Definition styleeditor.cpp:599
QComboBox * size_weight
Definition styleeditor.h:51
QComboBox * filling_color
Definition styleeditor.h:51
QComboBox * line_style
Definition styleeditor.h:51
void updateForm() override
StyleEditor::updateForm Update the edition form according to the value of edited part(s)
Definition styleeditor.cpp:446
bool setParts(QList< CustomElementPart * >) override
StyleEditor::setParts Set several parts to edit by this editor. Note : editor can accept or refuse to...
Definition styleeditor.cpp:522
void updatePartLineWeight()
Update weight with undo command.
Definition styleeditor.cpp:431
QCheckBox * antialiasing
Definition styleeditor.h:50
void updatePartFilling()
Update color filling with undo command.
Definition styleeditor.cpp:437
CustomElementGraphicPart * part
Definition styleeditor.h:47
static bool isStyleEditable(QList< CustomElementPart * > cep_list)
StyleEditor::isStyleEditable.
Definition styleeditor.cpp:567
StyleEditor(const StyleEditor &)
void updatePartLineStyle()
Update style with undo command.
Definition styleeditor.cpp:425
QList< CustomElementPart * > currentParts() const override
Definition styleeditor.cpp:556
void updatePartAntialiasing()
Update antialiasing with undo command.
Definition styleeditor.cpp:413
~StyleEditor() override
Destructeur.
Definition styleeditor.cpp:408
bool setPart(CustomElementPart *) override
StyleEditor::setPart Set the part to edit by this editor. Note : editor can accept or refuse to edit ...
Definition styleeditor.cpp:492
void activeConnections(bool)
Definition styleeditor.cpp:583
void updatePartColor()
Update color with undo command.
Definition styleeditor.cpp:419