QElectroTech  0.70
Public Slots | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
StyleEditor Class Reference

#include <styleeditor.h>

Public Slots

void updateForm () override
 StyleEditor::updateForm Update the edition form according to the value of edited part(s) More...
 
void updatePartAntialiasing ()
 Update antialiasing with undo command. More...
 
void updatePartColor ()
 Update color with undo command. More...
 
void updatePartLineStyle ()
 Update style with undo command. More...
 
void updatePartLineWeight ()
 Update weight with undo command. More...
 
void updatePartFilling ()
 Update color filling with undo command. More...
 

Public Member Functions

 StyleEditor (QETElementEditor *, CustomElementGraphicPart *=nullptr, QWidget *=nullptr)
 
 ~StyleEditor () override
 Destructeur. More...
 
bool setPart (CustomElementPart *) override
 StyleEditor::setPart Set the part to edit by this editor. Note : editor can accept or refuse to edit a part. More...
 
bool setParts (QList< CustomElementPart *>) override
 StyleEditor::setParts Set several parts to edit by this editor. Note : editor can accept or refuse to edit several parts. More...
 
CustomElementPartcurrentPart () const override
 
- Public Member Functions inherited from ElementItemEditor
 ElementItemEditor (QETElementEditor *, QWidget *=nullptr)
 
 ~ElementItemEditor () override
 
virtual QETElementEditorelementEditor () const
 
virtual ElementSceneelementScene () const
 
virtual QUndoStack & undoStack () const
 
virtual QString elementTypeName () const
 
virtual void setElementTypeName (const QString &)
 
virtual void detach ()
 
virtual void updateForm ()=0
 

Static Public Member Functions

static bool isStyleEditable (QList< CustomElementPart *> cep_list)
 StyleEditor::isStyleEditable. More...
 

Private Member Functions

 StyleEditor (const StyleEditor &)
 
void activeConnections (bool)
 
void makeUndo (const QString &undo_text, const char *property_name, const QVariant &new_value)
 

Private Attributes

CustomElementGraphicPartpart
 
QList< CustomElementGraphicPart * > m_part_list
 
QList< CustomElementPart * > m_cep_list
 
QVBoxLayout * main_layout
 
QCheckBox * antialiasing
 
QComboBox * filling_color
 
QComboBox * outline_color
 
QComboBox * size_weight
 
QComboBox * line_style
 

Detailed Description

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.

Definition at line 34 of file styleeditor.h.

Constructor & Destructor Documentation

◆ StyleEditor() [1/2]

StyleEditor::StyleEditor ( QETElementEditor editor,
CustomElementGraphicPart p = nullptr,
QWidget *  parent = nullptr 
)

Constructeur

Parameters
editorL'editeur d'element concerne
pLa partie a editer
parentle Widget parent

Definition at line 33 of file styleeditor.cpp.

References antialiasing, CustomElementGraphicPart::BdiagFilling, CustomElementGraphicPart::BigWeight, CustomElementGraphicPart::BlackColor, CustomElementGraphicPart::BlackFilling, CustomElementGraphicPart::BlueColor, CustomElementGraphicPart::BlueFilling, CustomElementGraphicPart::BrunColor, CustomElementGraphicPart::BrunFilling, CustomElementGraphicPart::CyanColor, CustomElementGraphicPart::CyanFilling, CustomElementGraphicPart::DashdottedStyle, CustomElementGraphicPart::DashedStyle, CustomElementGraphicPart::DottedStyle, CustomElementGraphicPart::FdiagFilling, filling_color, CustomElementGraphicPart::GrayColor, CustomElementGraphicPart::GrayFilling, CustomElementGraphicPart::GreenColor, CustomElementGraphicPart::GreenFilling, CustomElementGraphicPart::HorFilling, CustomElementGraphicPart::LightgrayColor, CustomElementGraphicPart::LightgrayFilling, line_style, CustomElementGraphicPart::MagentaColor, CustomElementGraphicPart::MagentaFilling, main_layout, CustomElementGraphicPart::NoneColor, CustomElementGraphicPart::NoneFilling, CustomElementGraphicPart::NoneWeight, CustomElementGraphicPart::NormalStyle, CustomElementGraphicPart::NormalWeight, CustomElementGraphicPart::OrangeColor, CustomElementGraphicPart::OrangeFilling, outline_color, CustomElementGraphicPart::PurpleColor, CustomElementGraphicPart::PurpleFilling, CustomElementGraphicPart::RedColor, CustomElementGraphicPart::RedFilling, size_weight, CustomElementGraphicPart::ThinWeight, QET::Icons::tr, CustomElementGraphicPart::UltraWeight, updateForm(), CustomElementGraphicPart::VerFilling, CustomElementGraphicPart::WhiteColor, CustomElementGraphicPart::WhiteFilling, CustomElementGraphicPart::YellowColor, and CustomElementGraphicPart::YellowFilling.

◆ ~StyleEditor()

StyleEditor::~StyleEditor ( )
override

Destructeur.

Definition at line 125 of file styleeditor.cpp.

◆ StyleEditor() [2/2]

StyleEditor::StyleEditor ( const StyleEditor )
private

Member Function Documentation

◆ activeConnections()

void StyleEditor::activeConnections ( bool  active)
private

Active ou desactive les connexionx signaux/slots entre les widgets internes.

Parameters
activetrue pour activer les connexions, false pour les desactiver

Definition at line 281 of file styleeditor.cpp.

References antialiasing, filling_color, line_style, outline_color, size_weight, updatePartAntialiasing(), updatePartColor(), updatePartFilling(), updatePartLineStyle(), and updatePartLineWeight().

Referenced by updateForm().

◆ currentPart()

CustomElementPart * StyleEditor::currentPart ( ) const
overridevirtual
Returns
la primitive actuellement editee, ou 0 si ce widget n'en edite pas

Implements ElementItemEditor.

Definition at line 256 of file styleeditor.cpp.

References part.

◆ isStyleEditable()

bool StyleEditor::isStyleEditable ( QList< CustomElementPart *>  cep_list)
static

StyleEditor::isStyleEditable.

Parameters
cep_list
Returns
true if all of the content of cep_list can be edited by style editor, else return false.

Definition at line 265 of file styleeditor.cpp.

Referenced by setParts(), and QETElementEditor::slot_updateInformations().

◆ makeUndo()

void StyleEditor::makeUndo ( const QString &  undo_text,
const char *  property_name,
const QVariant &  new_value 
)
private

◆ setPart()

bool StyleEditor::setPart ( CustomElementPart new_part)
overridevirtual

StyleEditor::setPart Set the part to edit by this editor. Note : editor can accept or refuse to edit a part.

Parameters
new_part: part to edit
Returns
true if editor accept to edit this CustomElementPart otherwise false

Implements ElementItemEditor.

Definition at line 199 of file styleeditor.cpp.

References m_part_list, part, and updateForm().

Referenced by RectangleEditor::setPart(), and setParts().

◆ setParts()

bool StyleEditor::setParts ( QList< CustomElementPart *>  part_list)
overridevirtual

StyleEditor::setParts Set several parts to edit by this editor. Note : editor can accept or refuse to edit several parts.

Parameters
part_list
Returns
true if every customeElementPart stored in part_list can be edited by this part editor, otherwise return false (see StyleEditor::isStyleEditable)

Reimplemented from ElementItemEditor.

Definition at line 227 of file styleeditor.cpp.

References isStyleEditable(), m_cep_list, m_part_list, part, setPart(), and updateForm().

◆ updateForm

void StyleEditor::updateForm ( )
overrideslot

StyleEditor::updateForm Update the edition form according to the value of edited part(s)

Definition at line 157 of file styleeditor.cpp.

References activeConnections(), antialiasing, filling_color, line_style, m_part_list, outline_color, part, and size_weight.

Referenced by setPart(), setParts(), and StyleEditor().

◆ updatePartAntialiasing

void StyleEditor::updatePartAntialiasing ( )
slot

Update antialiasing with undo command.

Definition at line 129 of file styleeditor.cpp.

References antialiasing, makeUndo(), and QET::Icons::tr.

Referenced by activeConnections().

◆ updatePartColor

void StyleEditor::updatePartColor ( )
slot

Update color with undo command.

Definition at line 134 of file styleeditor.cpp.

References makeUndo(), outline_color, and QET::Icons::tr.

Referenced by activeConnections().

◆ updatePartFilling

void StyleEditor::updatePartFilling ( )
slot

Update color filling with undo command.

Definition at line 149 of file styleeditor.cpp.

References filling_color, makeUndo(), and QET::Icons::tr.

Referenced by activeConnections().

◆ updatePartLineStyle

void StyleEditor::updatePartLineStyle ( )
slot

Update style with undo command.

Definition at line 139 of file styleeditor.cpp.

References line_style, makeUndo(), and QET::Icons::tr.

Referenced by activeConnections().

◆ updatePartLineWeight

void StyleEditor::updatePartLineWeight ( )
slot

Update weight with undo command.

Definition at line 144 of file styleeditor.cpp.

References makeUndo(), size_weight, and QET::Icons::tr.

Referenced by activeConnections().

Member Data Documentation

◆ antialiasing

QCheckBox* StyleEditor::antialiasing
private

Definition at line 51 of file styleeditor.h.

Referenced by activeConnections(), StyleEditor(), updateForm(), and updatePartAntialiasing().

◆ filling_color

QComboBox* StyleEditor::filling_color
private

Definition at line 52 of file styleeditor.h.

Referenced by activeConnections(), StyleEditor(), updateForm(), and updatePartFilling().

◆ line_style

QComboBox * StyleEditor::line_style
private

Definition at line 52 of file styleeditor.h.

Referenced by activeConnections(), StyleEditor(), updateForm(), and updatePartLineStyle().

◆ m_cep_list

QList<CustomElementPart *> StyleEditor::m_cep_list
private

Definition at line 49 of file styleeditor.h.

Referenced by setParts().

◆ m_part_list

QList<CustomElementGraphicPart *> StyleEditor::m_part_list
private

Definition at line 48 of file styleeditor.h.

Referenced by makeUndo(), setPart(), setParts(), and updateForm().

◆ main_layout

QVBoxLayout* StyleEditor::main_layout
private

Definition at line 50 of file styleeditor.h.

Referenced by StyleEditor().

◆ outline_color

QComboBox * StyleEditor::outline_color
private

Definition at line 52 of file styleeditor.h.

Referenced by activeConnections(), StyleEditor(), updateForm(), and updatePartColor().

◆ part

CustomElementGraphicPart* StyleEditor::part
private

Definition at line 47 of file styleeditor.h.

Referenced by currentPart(), makeUndo(), setPart(), setParts(), and updateForm().

◆ size_weight

QComboBox * StyleEditor::size_weight
private

Definition at line 52 of file styleeditor.h.

Referenced by activeConnections(), StyleEditor(), updateForm(), and updatePartLineWeight().


The documentation for this class was generated from the following files: