QElectroTech  0.8-dev
titleblockpropertieswidget.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 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:
43  const TitleBlockProperties &titleblock = TitleBlockProperties(),
44  bool current_date = false,
45  QETProject *project = nullptr,
46  QWidget *parent = nullptr);
48  TitleBlockTemplatesCollection *tbt_collection,
49  const TitleBlockProperties &titleblock = TitleBlockProperties(),
50  bool current_date = false,
51  QETProject *project = nullptr,
52  QWidget *parent = nullptr);
54  QList <TitleBlockTemplatesCollection *> tbt_collection,
55  const TitleBlockProperties &titleblock = TitleBlockProperties(),
56  bool current_date = false,
57  QETProject *project = nullptr,
58  QWidget *parent = nullptr);
59  ~TitleBlockPropertiesWidget() override;
60 
63  TitleBlockProperties propertiesAutoNum(QString autoNum) const;
67  QString autoNum);
68 
69  void setTitleBlockTemplatesVisible(const bool &visible);
70  void setReadOnly (const bool &ro);
71 
72  private:
73  void addCollection (
74  TitleBlockTemplatesCollection *tbt_collection);
75  QString currentTitleBlockTemplateName () const;
76  void initDialog(const bool &current_date, QETProject *project);
77  int getIndexFor (const QString &tbt_name,
78  const QET::QetCollection collection) const;
79 
80  private slots:
83  void updateTemplateList();
87 
88  signals:
89  void set_auto_page_num() const;
90  void openAutoNumFolioEditor (QString);
91 
92  private:
93  Ui::TitleBlockPropertiesWidget *ui;
96  QMenu *m_tbt_menu;
97  QList <TitleBlockTemplatesCollection *> m_tbt_collection_list;
98  QList <QET::QetCollection> m_map_index_to_collection_type;
99  QList <QString> keys_2;
100 };
101 
102 #endif // TITLEBLOCKPROPERTIESWIDGET_H
TitleBlockPropertiesWidget::setReadOnly
void setReadOnly(const bool &ro)
TitleBlockPropertiesWidget::setReadOnly if true, this widget is disable.
Definition: titleblockpropertieswidget.cpp:278
TitleBlockPropertiesWidget::m_map_index_to_collection_type
QList< QET::QetCollection > m_map_index_to_collection_type
Definition: titleblockpropertieswidget.h:98
TitleBlockPropertiesWidget::setProperties
void setProperties(const TitleBlockProperties &properties)
TitleBlockPropertiesWidget::setProperties.
Definition: titleblockpropertieswidget.cpp:112
TitleBlockPropertiesWidget::setTitleBlockTemplatesVisible
void setTitleBlockTemplatesVisible(const bool &visible)
TitleBlockPropertiesWidget::setTitleBlockTemplatesVisible if true, title block template combo box and...
Definition: titleblockpropertieswidget.cpp:267
TitleBlockPropertiesWidget
Definition: titleblockpropertieswidget.h:38
QET::Custom
@ Custom
From user collection.
Definition: qet.h:154
titleblockproperties.h
TitleBlockProperties::collection
QET::QetCollection collection
Specify the location of the title block.
Definition: titleblockproperties.h:68
QET::QetCollection
QetCollection
Enum used to specify the origin of a collection of thing (title block, element etc....
Definition: qet.h:152
TitleBlockPropertiesWidget::TitleBlockPropertiesWidget
TitleBlockPropertiesWidget(const TitleBlockProperties &titleblock=TitleBlockProperties(), bool current_date=false, QETProject *project=nullptr, QWidget *parent=nullptr)
TitleBlockPropertiesWidget::TitleBlockPropertiesWidget default constructor.
Definition: titleblockpropertieswidget.cpp:35
TitleBlockPropertiesWidget::getIndexFor
int getIndexFor(const QString &tbt_name, const QET::QetCollection collection) const
TitleBlockPropertiesWidget::getIndexFor Find the index of the combo box for the title block tbt_name ...
Definition: titleblockpropertieswidget.cpp:365
TitleBlockPropertiesWidget::m_dcw
DiagramContextWidget * m_dcw
Definition: titleblockpropertieswidget.h:94
TitleBlockPropertiesWidget::openAutoNumFolioEditor
void openAutoNumFolioEditor(QString)
TitleBlockPropertiesWidget::currentTitleBlockTemplateName
QString currentTitleBlockTemplateName() const
TitleBlockPropertiesWidget::currentTitleBlockTemplateName.
Definition: titleblockpropertieswidget.cpp:286
TitleBlockPropertiesWidget::duplicateCurrentTitleBlockTemplate
void duplicateCurrentTitleBlockTemplate()
Definition: titleblockpropertieswidget.cpp:381
TitleBlockProperties::auto_page_num
QString auto_page_num
Definition: titleblockproperties.h:63
TitleBlockPropertiesWidget::currentTitleBlockLocation
TitleBlockTemplateLocation currentTitleBlockLocation() const
Definition: titleblockpropertieswidget.cpp:249
TitleBlockPropertiesWidget::m_tbt_edit
QAction * m_tbt_edit
Definition: titleblockpropertieswidget.h:95
TitleBlockPropertiesWidget::addCollection
void addCollection(TitleBlockTemplatesCollection *tbt_collection)
TitleBlockPropertiesWidget::addCollection add a collection of title block available in the combo box.
Definition: titleblockpropertieswidget.cpp:298
TitleBlockPropertiesWidget::keys_2
QList< QString > keys_2
Definition: titleblockpropertieswidget.h:99
TitleBlockPropertiesWidget::propertiesAutoNum
TitleBlockProperties propertiesAutoNum(QString autoNum) const
TitleBlockPropertiesWidget::properties.
Definition: titleblockpropertieswidget.cpp:211
TitleBlockPropertiesWidget::setPropertiesWithAutoNum
void setPropertiesWithAutoNum(const TitleBlockProperties &properties, QString autoNum)
TitleBlockProperties::date
QDate date
Date (displayed by the default template)
Definition: titleblockproperties.h:56
NumerotationContext
Definition: numerotationcontext.h:31
titleblockpropertieswidget.h
TitleBlockPropertiesWidget::changeCurrentTitleBlockTemplate
void changeCurrentTitleBlockTemplate(int)
TitleBlockPropertiesWidget::changeCurrentTitleBlockTemplate Load the additionnal field of title block...
Definition: titleblockpropertieswidget.cpp:429
qetapp.h
TitleBlockProperties::context
DiagramContext context
Container for the additional, user-defined fields.
Definition: titleblockproperties.h:66
TitleBlockTemplate
The TitleBlockTemplate class This class represents an title block template for an electric diagram....
Definition: titleblocktemplate.h:36
QET::Icons::Home
QIcon Home
Definition: qeticons.cpp:114
TitleBlockProperties::title
QString title
Folio title (displayed by the default template)
Definition: titleblockproperties.h:54
qeticons.h
qet.h
DiagramContextWidget
Definition: diagramcontextwidget.h:29
TitleBlockPropertiesWidget::updateTemplateList
void updateTemplateList()
TitleBlockPropertiesWidget::updateTemplateList Update the title block template list available in the ...
Definition: titleblockpropertieswidget.cpp:389
TitleBlockProperties
Definition: titleblockproperties.h:29
TitleBlockPropertiesWidget::on_m_edit_autofolionum_pb_clicked
void on_m_edit_autofolionum_pb_clicked()
TitleBlockPropertiesWidget::on_m_edit_autofolionum_pb_clicked Open Auto Folio Num dialog.
Definition: titleblockpropertieswidget.cpp:466
TitleBlockProperties::locmach
QString locmach
Location(displayed by the default template)
Definition: titleblockproperties.h:59
TitleBlockPropertiesWidget::initDialog
void initDialog(const bool &current_date, QETProject *project)
TitleBlockPropertiesWidget::initDialog Init this dialog.
Definition: titleblockpropertieswidget.cpp:311
TitleBlockTemplateLocation
Definition: templatelocation.h:29
TitleBlockProperties::plant
QString plant
Plant (displayed by the default template)
Definition: titleblockproperties.h:58
templatescollection.h
numerotationcontext.h
QET::Icons::QETLogo
QIcon QETLogo
Definition: qeticons.cpp:151
qetproject.h
TitleBlockProperties::filename
QString filename
Filename (displayed by the default template)
Definition: titleblockproperties.h:57
TitleBlockPropertiesWidget::on_m_date_now_pb_clicked
void on_m_date_now_pb_clicked()
TitleBlockPropertiesWidget::on_m_date_now_pb_clicked Set the date to current date.
Definition: titleblockpropertieswidget.cpp:458
TitleBlockPropertiesWidget::editCurrentTitleBlockTemplate
void editCurrentTitleBlockTemplate()
Definition: titleblockpropertieswidget.cpp:377
TitleBlockPropertiesWidget::set_auto_page_num
void set_auto_page_num() const
QETApp::instance
static QETApp * instance()
QETApp::instance.
Definition: qetapp.cpp:153
Ui
Definition: autonumberingdockwidget.h:25
QETApp::openTitleBlockTemplate
void openTitleBlockTemplate(const TitleBlockTemplateLocation &, bool=false)
QETApp::openTitleBlockTemplate Launch a new title block template editor to edit the given template.
Definition: qetapp.cpp:1677
TitleBlockPropertiesWidget::~TitleBlockPropertiesWidget
~TitleBlockPropertiesWidget() override
TitleBlockPropertiesWidget::~TitleBlockPropertiesWidget destructor.
Definition: titleblockpropertieswidget.cpp:103
QETProject
Definition: qetproject.h:51
QET::Icons::ro
QIcon ro
Definition: qeticons.cpp:200
TitleBlockProperties::display_at
Qt::Edge display_at
Edge to display the titleblock.
Definition: titleblockproperties.h:67
TitleBlockProperties::author
QString author
Author of the diagram/folio (displayed by the default template)
Definition: titleblockproperties.h:55
diagramcontextwidget.h
QET::Embedded
@ Embedded
From an embedded collection (a project for exemple)
Definition: qet.h:155
TitleBlockPropertiesWidget::ui
Ui::TitleBlockPropertiesWidget * ui
Definition: titleblockpropertieswidget.h:93
TitleBlockProperties::useDate
DateManagement useDate
Wheter to use the date attribute.
Definition: titleblockproperties.h:64
TitleBlockTemplatesCollection
Definition: templatescollection.h:34
TitleBlockProperties::template_name
QString template_name
Name of the template used to render the title block - an empty string means "the default template pro...
Definition: titleblockproperties.h:65
TitleBlockPropertiesWidget::m_tbt_collection_list
QList< TitleBlockTemplatesCollection * > m_tbt_collection_list
Definition: titleblockpropertieswidget.h:97
TitleBlockPropertiesWidget::m_tbt_duplicate
QAction * m_tbt_duplicate
Definition: titleblockpropertieswidget.h:95
TitleBlockPropertiesWidget::properties
TitleBlockProperties properties() const
TitleBlockPropertiesWidget::properties.
Definition: titleblockpropertieswidget.cpp:170
TitleBlockProperties::indexrev
QString indexrev
Revision Index (displayed by the default template)
Definition: titleblockproperties.h:60
titleblocktemplate.h
QET::Common
@ Common
From common collection.
Definition: qet.h:153
DiagramContext::addValue
bool addValue(const QString &, const QVariant &, bool show=true)
Definition: diagramcontext.cpp:91
TitleBlockProperties::folio
QString folio
Folio information (displayed by the default template)
Definition: titleblockproperties.h:62
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
QET::Icons::TitleBlock
QIcon TitleBlock
Definition: qeticons.cpp:165
DiagramContext
Definition: diagramcontext.h:56
TitleBlockProperties::UseDateValue
@ UseDateValue
use the date attribute
Definition: titleblockproperties.h:35
TitleBlockTemplatesCollection::location
virtual TitleBlockTemplateLocation location(const QString &=QString())=0
TitleBlockPropertiesWidget::m_tbt_menu
QMenu * m_tbt_menu
Definition: titleblockpropertieswidget.h:96
TitleBlockProperties::CurrentDate
@ CurrentDate
use the current date
Definition: titleblockproperties.h:36