2020-05-01 18:33:11 +02:00
|
|
|
|
/*
|
2019-01-13 16:56:12 +00:00
|
|
|
|
Copyright 2006-2019 The QElectroTech Team
|
2007-12-01 10:47:15 +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/>.
|
|
|
|
|
*/
|
2007-06-30 17:41:07 +00:00
|
|
|
|
#ifndef STYLE_EDITOR_H
|
|
|
|
|
#define STYLE_EDITOR_H
|
2015-07-24 13:41:51 +00:00
|
|
|
|
|
2007-08-25 03:43:05 +00:00
|
|
|
|
#include "elementitemeditor.h"
|
2015-07-24 13:41:51 +00:00
|
|
|
|
|
2007-06-30 17:41:07 +00:00
|
|
|
|
class CustomElementGraphicPart;
|
2015-07-24 13:41:51 +00:00
|
|
|
|
class QVBoxLayout;
|
|
|
|
|
class QCheckBox;
|
|
|
|
|
class QComboBox;
|
|
|
|
|
|
2007-10-21 16:10:21 +00:00
|
|
|
|
/**
|
2012-11-09 21:09:24 +00:00
|
|
|
|
This class provides a widget to edit styles (color, pen style and thickness,
|
|
|
|
|
filling, antialiasing) common to most primitives within the element editor.
|
|
|
|
|
Its appendWidget() method makes the insertion of another widget below it
|
|
|
|
|
easier.
|
2007-10-21 16:10:21 +00:00
|
|
|
|
*/
|
2015-02-15 10:21:32 +00:00
|
|
|
|
class StyleEditor : public ElementItemEditor
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
// constructors, destructor
|
2007-06-30 17:41:07 +00:00
|
|
|
|
public:
|
2017-08-05 02:06:59 +00:00
|
|
|
|
StyleEditor(QETElementEditor *, CustomElementGraphicPart * = nullptr, QWidget * = nullptr);
|
2017-08-05 02:10:01 +00:00
|
|
|
|
~StyleEditor() override;
|
2007-06-30 17:41:07 +00:00
|
|
|
|
|
|
|
|
|
private:
|
2015-02-15 10:21:32 +00:00
|
|
|
|
StyleEditor(const StyleEditor &);
|
2007-06-30 17:41:07 +00:00
|
|
|
|
|
2015-02-15 10:21:32 +00:00
|
|
|
|
// attributes
|
2007-06-30 17:41:07 +00:00
|
|
|
|
private:
|
2015-02-15 10:21:32 +00:00
|
|
|
|
CustomElementGraphicPart *part;
|
|
|
|
|
QList <CustomElementGraphicPart *> m_part_list;
|
|
|
|
|
QList <CustomElementPart *> m_cep_list;
|
|
|
|
|
QCheckBox *antialiasing;
|
|
|
|
|
QComboBox *filling_color, *outline_color, *size_weight, *line_style;
|
2007-06-30 17:41:07 +00:00
|
|
|
|
|
2015-02-15 10:21:32 +00:00
|
|
|
|
// methods
|
2007-06-30 17:41:07 +00:00
|
|
|
|
public:
|
2017-08-05 02:10:01 +00:00
|
|
|
|
bool setPart(CustomElementPart *) override;
|
|
|
|
|
bool setParts(QList<CustomElementPart *>) override;
|
|
|
|
|
CustomElementPart *currentPart() const override;
|
2015-02-15 10:21:32 +00:00
|
|
|
|
|
|
|
|
|
static bool isStyleEditable (QList <CustomElementPart *> cep_list);
|
2007-06-30 17:41:07 +00:00
|
|
|
|
|
|
|
|
|
public slots:
|
2017-08-05 02:10:01 +00:00
|
|
|
|
void updateForm() override;
|
2015-02-15 10:21:32 +00:00
|
|
|
|
void updatePartAntialiasing();
|
|
|
|
|
void updatePartColor();
|
|
|
|
|
void updatePartLineStyle();
|
|
|
|
|
void updatePartLineWeight();
|
|
|
|
|
void updatePartFilling();
|
2007-08-25 03:43:05 +00:00
|
|
|
|
|
|
|
|
|
private:
|
2015-02-15 10:21:32 +00:00
|
|
|
|
void activeConnections(bool);
|
2015-07-24 13:41:51 +00:00
|
|
|
|
void makeUndo(const QString &undo_text, const char *property_name, const QVariant &new_value);
|
2007-06-30 17:41:07 +00:00
|
|
|
|
};
|
|
|
|
|
#endif
|