2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2013-06-18 11:10:19 +00:00
|
|
|
Copyright 2006-2013 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
|
|
|
|
#include <QtGui>
|
2007-08-25 03:43:05 +00:00
|
|
|
#include "elementitemeditor.h"
|
2007-06-30 17:41:07 +00:00
|
|
|
class CustomElementGraphicPart;
|
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
|
|
|
*/
|
2007-08-25 03:43:05 +00:00
|
|
|
class StyleEditor : public ElementItemEditor {
|
2007-06-30 17:41:07 +00:00
|
|
|
Q_OBJECT
|
2012-11-09 21:09:24 +00:00
|
|
|
// constructors, destructor
|
2007-06-30 17:41:07 +00:00
|
|
|
public:
|
2010-02-18 00:42:41 +00:00
|
|
|
StyleEditor(QETElementEditor *, CustomElementGraphicPart * = 0, QWidget * = 0);
|
2007-06-30 17:41:07 +00:00
|
|
|
virtual ~StyleEditor();
|
|
|
|
|
|
|
|
private:
|
|
|
|
StyleEditor(const StyleEditor &);
|
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// attributes
|
2007-06-30 17:41:07 +00:00
|
|
|
private:
|
|
|
|
CustomElementGraphicPart *part;
|
|
|
|
QVBoxLayout *main_layout;
|
2013-06-01 16:09:58 +00:00
|
|
|
QRadioButton *black_color, *white_color, *normal_style, *dashed_style, *dashdotted_style, *dotted_style, *green_color, *red_color, *blue_color;
|
2007-06-30 17:41:07 +00:00
|
|
|
QRadioButton *none_weight, *thin_weight, *normal_weight, *no_filling;
|
2013-05-29 09:02:26 +00:00
|
|
|
QRadioButton *black_filling, *white_filling, *green_filling, *red_filling, *blue_filling;
|
2007-06-30 17:41:07 +00:00
|
|
|
QCheckBox *antialiasing;
|
2013-12-19 23:47:57 +00:00
|
|
|
QComboBox *filling_color, *outline_color, *size_weight, *line_style;
|
2007-06-30 17:41:07 +00:00
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// methods
|
2007-06-30 17:41:07 +00:00
|
|
|
public:
|
2010-02-18 00:42:41 +00:00
|
|
|
virtual bool setPart(CustomElementPart *);
|
|
|
|
virtual CustomElementPart *currentPart() const;
|
2007-06-30 17:41:07 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void updatePart();
|
|
|
|
void updateForm();
|
2007-08-25 03:43:05 +00:00
|
|
|
void updatePartAntialiasing();
|
|
|
|
void updatePartColor();
|
|
|
|
void updatePartLineStyle();
|
|
|
|
void updatePartLineWeight();
|
|
|
|
void updatePartFilling();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void activeConnections(bool);
|
2007-06-30 17:41:07 +00:00
|
|
|
};
|
|
|
|
#endif
|