QElectroTech  0.70
templatelogomanager.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 TITLEBLOCK_SLASH_TEMPLATE_LOGO_MANAGER
19 #define TITLEBLOCK_SLASH_TEMPLATE_LOGO_MANAGER
20 #include <QtWidgets>
21 class TitleBlockTemplate;
22 
27 class TitleBlockTemplateLogoManager : public QWidget {
28  Q_OBJECT
29  // Constructor, destructor
30  public:
31  TitleBlockTemplateLogoManager(TitleBlockTemplate *, QWidget * = nullptr);
33 
34  // methods
35  public:
36  QString currentLogo() const;
37  bool isReadOnly() const;
38  void setReadOnly(bool);
39 
40  signals:
41  void logosChanged(const TitleBlockTemplate *);
42 
43  protected:
45 
46  private:
47  void initWidgets();
48  void fillView();
49  QSize iconsize() const;
50  QString confirmLogoName(const QString &);
51 
52  private slots:
53  void updateLogoInformations(QListWidgetItem *, QListWidgetItem *);
54  void addLogo();
55  void exportLogo();
56  void removeLogo();
57  void renameLogo();
58 
59  // attributes
60  private:
62  QVBoxLayout *vlayout0_, *vlayout1_;
63  QHBoxLayout *hlayout0_, *hlayout1_;
64  QLabel *logos_label_;
65  QListWidget *logos_view_;
66  QPushButton *add_button_;
67  QPushButton *export_button_;
68  QPushButton *delete_button_;
69  QGroupBox *logo_box_;
70  QLabel *logo_name_label_;
71  QLineEdit *logo_name_;
72  QPushButton *rename_button_;
73  QLabel *logo_type_;
74  QDialogButtonBox *buttons_;
76  bool read_only_;
77 };
78 #endif
QLineEdit * logo_name_
current logo name
QLabel * logo_name_label_
"name:" label
QListWidget * logos_view_
area showing the logos
QVBoxLayout * vlayout1_
vertical layouts
QLabel * logo_type_
current logo type
bool read_only_
Whether this logo manager should allow logo edition (renaming, addition, deletion) ...
QHBoxLayout * hlayout1_
horizontal layouts
QGroupBox * logo_box_
current logo properties box
QString confirmLogoName(const QString &)
QPushButton * export_button_
button to export an embedded logo
QPushButton * rename_button_
button to rename the current logo
QDialogButtonBox * buttons_
ok/cancel buttons
TitleBlockTemplateLogoManager(TitleBlockTemplate *, QWidget *=nullptr)
void logosChanged(const TitleBlockTemplate *)
QPushButton * add_button_
button to add a new logo
QLabel * logos_label_
simple displayed label
TitleBlockTemplate * managed_template_
title block template which this class manages logos
void updateLogoInformations(QListWidgetItem *, QListWidgetItem *)
QPushButton * delete_button_
button to delete an embedded logo
QDir open_dialog_dir_
last opened directory