QElectroTech  0.8-dev
xrefpropertieswidget.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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 XREFPROPERTIESWIDGET_H
19 #define XREFPROPERTIESWIDGET_H
20 
21 #include <QWidget>
23 
24 namespace Ui {
26 }
27 
32 class XRefPropertiesWidget : public QWidget
33 {
34  Q_OBJECT
35 
36  public:
37  XRefPropertiesWidget(QHash <QString, XRefProperties> properties = QHash <QString, XRefProperties>(), QWidget *parent = nullptr);
38  ~XRefPropertiesWidget() override;
39 
40  void setProperties (const QHash <QString, XRefProperties> &properties);
41  QHash <QString, XRefProperties> properties();
42 
43  void setReadOnly (bool = true);
44 
45  private:
46  void buildUi();
47  void saveProperties(int index);
48 
49  private slots:
50  void updateDisplay();
51  void typeChanged();
52  void enableOffsetSB(int i);
53 
54 
55  private:
56  Ui::XRefPropertiesWidget *ui;
57  QHash <QString, XRefProperties> m_properties;
59 };
60 
61 #endif // XREFPROPERTIESWIDGET_H
XRefPropertiesWidget::saveProperties
void saveProperties(int index)
XRefPropertiesWidget::saveProperties Save the properties of the type define at index of the combo box...
Definition: xrefpropertieswidget.cpp:118
XRefProperties::setSnapTo
void setSnapTo(const SnapTo st)
Definition: xrefproperties.h:61
XRefPropertiesWidget::buildUi
void buildUi()
XRefPropertiesWidget::buildUi Build some widget of this ui.
Definition: xrefpropertieswidget.cpp:96
XRefPropertiesWidget::enableOffsetSB
void enableOffsetSB(int i)
XRefPropertiesWidget::enableOffsetSB Enable Offset SB only if Snap to Footer is selected.
Definition: xrefpropertieswidget.cpp:214
XRefProperties::getXrefPos
Qt::AlignmentFlag getXrefPos() const
Definition: xrefproperties.h:65
XRefProperties::setMasterLabel
void setMasterLabel(const QString master)
Definition: xrefproperties.h:69
XRefProperties::Cross
@ Cross
Definition: xrefproperties.h:34
XRefProperties::setSlaveLabel
void setSlaveLabel(const QString slave)
Definition: xrefproperties.h:72
XRefProperties::setOffset
void setOffset(const int offset)
Definition: xrefproperties.h:75
XRefProperties::Label
@ Label
Definition: xrefproperties.h:40
XRefProperties::setPrefix
void setPrefix(const QString &key, const QString &value)
Definition: xrefproperties.h:66
XRefProperties::offset
int offset() const
Definition: xrefproperties.h:76
XRefPropertiesWidget::properties
QHash< QString, XRefProperties > properties()
XRefPropertiesWidget::properties.
Definition: xrefpropertieswidget.cpp:72
XRefProperties
The XRefProperties class this class store properties used by XrefItem.
Definition: xrefproperties.h:29
XRefProperties::masterLabel
QString masterLabel() const
Definition: xrefproperties.h:70
XRefProperties::slaveLabel
QString slaveLabel() const
Definition: xrefproperties.h:73
xrefproperties.h
XRefPropertiesWidget
The XRefPropertiesWidget class This class provide a widget to edit the XRefProperties.
Definition: xrefpropertieswidget.h:33
XRefPropertiesWidget::setReadOnly
void setReadOnly(bool=true)
XRefPropertiesWidget::setReadOnly Set all of this widget disable if true.
Definition: xrefpropertieswidget.cpp:82
XRefProperties::setXrefPos
void setXrefPos(const Qt::AlignmentFlag xref)
Definition: xrefproperties.h:64
XRefProperties::Contacts
@ Contacts
Definition: xrefproperties.h:35
XRefPropertiesWidget::typeChanged
void typeChanged()
XRefPropertiesWidget::typeChanged manage the save of the current properties, when the combo box of ty...
Definition: xrefpropertieswidget.cpp:200
XRefProperties::setShowPowerContac
void setShowPowerContac(const bool a)
Definition: xrefproperties.h:55
XRefProperties::DisplayHas
DisplayHas
Definition: xrefproperties.h:33
XRefPropertiesWidget::setProperties
void setProperties(const QHash< QString, XRefProperties > &properties)
XRefPropertiesWidget::setProperties set new properties for this widget.
Definition: xrefpropertieswidget.cpp:61
XRefPropertiesWidget::~XRefPropertiesWidget
~XRefPropertiesWidget() override
XRefPropertiesWidget::~XRefPropertiesWidget Default destructor.
Definition: xrefpropertieswidget.cpp:48
XRefPropertiesWidget::XRefPropertiesWidget
XRefPropertiesWidget(QHash< QString, XRefProperties > properties=QHash< QString, XRefProperties >(), QWidget *parent=nullptr)
XRefPropertiesWidget::XRefPropertiesWidget Default constructor.
Definition: xrefpropertieswidget.cpp:31
XRefPropertiesWidget::m_previous_type_index
int m_previous_type_index
Definition: xrefpropertieswidget.h:58
Ui
Definition: autonumberingdockwidget.h:25
XRefProperties::showPowerContact
bool showPowerContact() const
Definition: xrefproperties.h:56
QET::Icons::ro
QIcon ro
Definition: qeticons.cpp:200
XRefProperties::prefix
QString prefix(const QString &key) const
Definition: xrefproperties.h:67
XRefProperties::Bottom
@ Bottom
Definition: xrefproperties.h:39
XRefProperties::setDisplayHas
void setDisplayHas(const DisplayHas dh)
Definition: xrefproperties.h:58
xrefpropertieswidget.h
XRefProperties::displayHas
DisplayHas displayHas() const
Definition: xrefproperties.h:59
XRefPropertiesWidget::updateDisplay
void updateDisplay()
XRefPropertiesWidget::updateDisplay Update display with the curent displayed type.
Definition: xrefpropertieswidget.cpp:153
XRefPropertiesWidget::ui
Ui::XRefPropertiesWidget * ui
Definition: xrefpropertieswidget.h:56
XRefProperties::snapTo
SnapTo snapTo() const
Definition: xrefproperties.h:62
XRefPropertiesWidget::m_properties
QHash< QString, XRefProperties > m_properties
Definition: xrefpropertieswidget.h:57
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206