QElectroTech  0.70
titleblockpropertieswidget.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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 TITLEBLOCKPROPERTIESWIDGET_H
19 #define TITLEBLOCKPROPERTIESWIDGET_H
20 
21 #include "qetproject.h"
22 #include <QWidget>
23 #include "titleblockproperties.h"
24 #include "diagramcontextwidget.h"
25 #include "qet.h"
26 #include "numerotationcontext.h"
27 
29 class QETProject;
30 class QMenu;
32 
33 namespace Ui {
35 }
36 
37 class TitleBlockPropertiesWidget : public QWidget
38 {
39  Q_OBJECT
40 
41  public:
42  explicit TitleBlockPropertiesWidget(const TitleBlockProperties &titleblock = TitleBlockProperties(), bool current_date = false, QETProject *project = nullptr, QWidget *parent = nullptr);
43  explicit TitleBlockPropertiesWidget(TitleBlockTemplatesCollection *tbt_collection, const TitleBlockProperties &titleblock = TitleBlockProperties(), bool current_date = false, QETProject *project = nullptr, QWidget *parent = nullptr);
44  explicit TitleBlockPropertiesWidget(QList <TitleBlockTemplatesCollection *> tbt_collection, const TitleBlockProperties &titleblock = TitleBlockProperties(), bool current_date = false, QETProject *project = nullptr, QWidget *parent = nullptr);
45  ~TitleBlockPropertiesWidget() override;
46 
49  TitleBlockProperties propertiesAutoNum(QString autoNum) const;
51  void setPropertiesWithAutoNum(const TitleBlockProperties &properties, QString autoNum);
52 
53  void setTitleBlockTemplatesVisible(const bool &visible);
54  void setReadOnly (const bool &ro);
55 
56  private:
57  void addCollection (TitleBlockTemplatesCollection *tbt_collection);
58  QString currentTitleBlockTemplateName () const;
59  void initDialog(const bool &current_date, QETProject *project);
60  int getIndexFor (const QString &tbt_name, const QET::QetCollection collection) const;
61 
62  private slots:
65  void updateTemplateList();
69 
70  signals:
71  void set_auto_page_num() const;
72  void openAutoNumFolioEditor (QString);
73 
74  private:
75  Ui::TitleBlockPropertiesWidget *ui;
78  QMenu *m_tbt_menu;
79  QList <TitleBlockTemplatesCollection *> m_tbt_collection_list;
80  QList <QET::QetCollection> m_map_index_to_collection_type;
81  QList <QString> keys_2;
82 };
83 
84 #endif // TITLEBLOCKPROPERTIESWIDGET_H
void setProperties(const TitleBlockProperties &properties)
TitleBlockPropertiesWidget::setProperties.
void setReadOnly(const bool &ro)
TitleBlockPropertiesWidget::setReadOnly if true, this widget is disable.
void addCollection(TitleBlockTemplatesCollection *tbt_collection)
TitleBlockPropertiesWidget::addCollection add a collection of title block available in the combo box...
void setTitleBlockTemplatesVisible(const bool &visible)
TitleBlockPropertiesWidget::setTitleBlockTemplatesVisible if true, title block template combo box and...
void changeCurrentTitleBlockTemplate(int)
TitleBlockPropertiesWidget::changeCurrentTitleBlockTemplate Load the additionnal field of title block...
TitleBlockTemplateLocation currentTitleBlockLocation() const
void on_m_edit_autofolionum_pb_clicked()
TitleBlockPropertiesWidget::on_m_edit_autofolionum_pb_clicked Open Auto Folio Num dialog...
void openAutoNumFolioEditor(QString)
void set_auto_page_num() const
QetCollection
Enum used to specify the origin of a collection of thing (title block, element etc...)
Definition: qet.h:150
QList< TitleBlockTemplatesCollection * > m_tbt_collection_list
void updateTemplateList()
TitleBlockPropertiesWidget::updateTemplateList Update the title block template list available in the ...
~TitleBlockPropertiesWidget() override
TitleBlockPropertiesWidget::~TitleBlockPropertiesWidget destructor.
TitleBlockProperties propertiesAutoNum(QString autoNum) const
TitleBlockPropertiesWidget::properties.
TitleBlockProperties properties() const
TitleBlockPropertiesWidget::properties.
void setPropertiesWithAutoNum(const TitleBlockProperties &properties, QString autoNum)
QString currentTitleBlockTemplateName() const
TitleBlockPropertiesWidget::currentTitleBlockTemplateName.
Ui::TitleBlockPropertiesWidget * ui
int getIndexFor(const QString &tbt_name, const QET::QetCollection collection) const
TitleBlockPropertiesWidget::getIndexFor Find the index of the combo box for the title block availabl...
QIcon ro
Definition: qeticons.cpp:199
void initDialog(const bool &current_date, QETProject *project)
TitleBlockPropertiesWidget::initDialog Init this dialog.
QList< QET::QetCollection > m_map_index_to_collection_type
void on_m_date_now_pb_clicked()
TitleBlockPropertiesWidget::on_m_date_now_pb_clicked Set the date to current date.
TitleBlockPropertiesWidget(const TitleBlockProperties &titleblock=TitleBlockProperties(), bool current_date=false, QETProject *project=nullptr, QWidget *parent=nullptr)
TitleBlockPropertiesWidget::TitleBlockPropertiesWidget default constructor.