QElectroTech  0.70
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
XRefProperties Class Reference

The XRefProperties class this class store properties used by XrefItem. More...

#include <xrefproperties.h>

Public Types

enum  DisplayHas { Cross, Contacts }
 
enum  SnapTo { Bottom, Label }
 

Public Member Functions

 XRefProperties ()
 XRefProperties::XRefProperties Default Constructor. More...
 
void toSettings (QSettings &settings, const QString=QString()) const override
 XRefProperties::toSettings Save to settings. More...
 
void fromSettings (const QSettings &settings, const QString=QString()) override
 XRefProperties::fromSettings load from settings. More...
 
void toXml (QDomElement &xml_element) const override
 XRefProperties::toXml Save to xml. More...
 
void fromXml (const QDomElement &xml_element) override
 XRefProperties::fromXml Load from xml. More...
 
bool operator== (const XRefProperties &xrp) const
 
bool operator!= (const XRefProperties &xrp) const
 
void setShowPowerContac (const bool a)
 
bool showPowerContact () const
 
void setDisplayHas (const DisplayHas dh)
 
DisplayHas displayHas () const
 
void setSnapTo (const SnapTo st)
 
SnapTo snapTo () const
 
void setPrefix (const QString &key, const QString &value)
 
QString prefix (const QString &key) const
 
void setMasterLabel (const QString master)
 
QString masterLabel () const
 
void setSlaveLabel (const QString slave)
 
QString slaveLabel () const
 
void setOffset (const int offset)
 
int offset () const
 
- Public Member Functions inherited from PropertiesInterface
 PropertiesInterface ()
 

Static Public Member Functions

static QHash< QString, XRefPropertiesdefaultProperties ()
 XRefProperties::defaultProperties. More...
 

Private Attributes

bool m_show_power_ctc
 
DisplayHas m_display
 
SnapTo m_snap_to
 
QHash< QString, QString > m_prefix
 
QStringList m_prefix_keys
 
QString m_master_label
 
QString m_slave_label
 
int m_offset
 

Detailed Description

The XRefProperties class this class store properties used by XrefItem.

Definition at line 28 of file xrefproperties.h.

Member Enumeration Documentation

◆ DisplayHas

Enumerator
Cross 
Contacts 

Definition at line 33 of file xrefproperties.h.

◆ SnapTo

Enumerator
Bottom 
Label 

Definition at line 38 of file xrefproperties.h.

Constructor & Destructor Documentation

◆ XRefProperties()

XRefProperties::XRefProperties ( )

Member Function Documentation

◆ defaultProperties()

QHash< QString, XRefProperties > XRefProperties::defaultProperties ( )
static

XRefProperties::defaultProperties.

Returns
the default properties stored in the setting file For the xref, there is 2 propreties. For coil, stored with the string "coil" in the returned QHash. For protection, stored with the string "protection" in the returned QHash.

Definition at line 127 of file xrefproperties.cpp.

References fromSettings().

Referenced by NewDiagramPage::NewDiagramPage(), and QETProject::readDefaultPropertiesXml().

◆ displayHas()

DisplayHas XRefProperties::displayHas ( ) const
inline

◆ fromSettings()

void XRefProperties::fromSettings ( const QSettings &  settings,
const QString  prefix = QString() 
)
overridevirtual

XRefProperties::fromSettings load from settings.

Parameters
settingsQSettings to use
prefixprefix before properties name

Implements PropertiesInterface.

Definition at line 65 of file xrefproperties.cpp.

References Bottom, Contacts, Cross, Label, m_display, m_master_label, m_offset, m_prefix, m_prefix_keys, m_show_power_ctc, m_slave_label, m_snap_to, and prefix().

Referenced by defaultProperties().

◆ fromXml()

void XRefProperties::fromXml ( const QDomElement &  xml_element)
overridevirtual

XRefProperties::fromXml Load from xml.

Parameters
xml_elementQDomElement to use for load

Implements PropertiesInterface.

Definition at line 106 of file xrefproperties.cpp.

References Bottom, Contacts, Cross, Label, m_display, m_master_label, m_offset, m_prefix, m_prefix_keys, m_show_power_ctc, m_slave_label, and m_snap_to.

Referenced by QETProject::readDefaultPropertiesXml().

◆ masterLabel()

QString XRefProperties::masterLabel ( ) const
inline

◆ offset()

int XRefProperties::offset ( ) const
inline

◆ operator!=()

bool XRefProperties::operator!= ( const XRefProperties xrp) const

Definition at line 156 of file xrefproperties.cpp.

◆ operator==()

bool XRefProperties::operator== ( const XRefProperties xrp) const

◆ prefix()

QString XRefProperties::prefix ( const QString &  key) const
inline

◆ setDisplayHas()

void XRefProperties::setDisplayHas ( const DisplayHas  dh)
inline

Definition at line 56 of file xrefproperties.h.

References m_display.

Referenced by XRefPropertiesWidget::saveProperties().

◆ setMasterLabel()

void XRefProperties::setMasterLabel ( const QString  master)
inline

Definition at line 65 of file xrefproperties.h.

References m_master_label.

Referenced by XRefPropertiesWidget::saveProperties().

◆ setOffset()

void XRefProperties::setOffset ( const int  offset)
inline

Definition at line 71 of file xrefproperties.h.

References m_offset, and offset().

Referenced by XRefPropertiesWidget::saveProperties().

◆ setPrefix()

void XRefProperties::setPrefix ( const QString &  key,
const QString &  value 
)
inline

Definition at line 62 of file xrefproperties.h.

References m_prefix.

Referenced by XRefPropertiesWidget::saveProperties().

◆ setShowPowerContac()

void XRefProperties::setShowPowerContac ( const bool  a)
inline

Definition at line 53 of file xrefproperties.h.

References m_show_power_ctc.

Referenced by XRefPropertiesWidget::saveProperties().

◆ setSlaveLabel()

void XRefProperties::setSlaveLabel ( const QString  slave)
inline

Definition at line 68 of file xrefproperties.h.

References m_slave_label.

Referenced by XRefPropertiesWidget::saveProperties().

◆ setSnapTo()

void XRefProperties::setSnapTo ( const SnapTo  st)
inline

Definition at line 59 of file xrefproperties.h.

References m_snap_to.

Referenced by XRefPropertiesWidget::saveProperties().

◆ showPowerContact()

bool XRefProperties::showPowerContact ( ) const
inline

◆ slaveLabel()

QString XRefProperties::slaveLabel ( ) const
inline

◆ snapTo()

SnapTo XRefProperties::snapTo ( ) const
inline

◆ toSettings()

void XRefProperties::toSettings ( QSettings &  settings,
const QString  prefix = QString() 
) const
overridevirtual

XRefProperties::toSettings Save to settings.

Parameters
settingsQSettings to use
prefixprefix before properties name

Implements PropertiesInterface.

Definition at line 42 of file xrefproperties.cpp.

References Bottom, Cross, m_display, m_master_label, m_offset, m_prefix, m_show_power_ctc, m_slave_label, m_snap_to, offset(), and prefix().

Referenced by NewDiagramPage::applyConf().

◆ toXml()

void XRefProperties::toXml ( QDomElement &  xml_element) const
overridevirtual

XRefProperties::toXml Save to xml.

Parameters
xml_elementQDomElement to use for saving

Implements PropertiesInterface.

Definition at line 84 of file xrefproperties.cpp.

References Bottom, Cross, m_display, m_master_label, m_offset, m_prefix, m_show_power_ctc, m_slave_label, m_snap_to, and offset().

Member Data Documentation

◆ m_display

DisplayHas XRefProperties::m_display
private

◆ m_master_label

QString XRefProperties::m_master_label
private

◆ m_offset

int XRefProperties::m_offset
private

◆ m_prefix

QHash<QString, QString> XRefProperties::m_prefix
private

Definition at line 78 of file xrefproperties.h.

Referenced by fromSettings(), fromXml(), operator==(), prefix(), setPrefix(), toSettings(), and toXml().

◆ m_prefix_keys

QStringList XRefProperties::m_prefix_keys
private

Definition at line 79 of file xrefproperties.h.

Referenced by fromSettings(), fromXml(), and XRefProperties().

◆ m_show_power_ctc

bool XRefProperties::m_show_power_ctc
private

◆ m_slave_label

QString XRefProperties::m_slave_label
private

◆ m_snap_to

SnapTo XRefProperties::m_snap_to
private

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