QElectroTech  0.8-dev
namelistwidget.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 NAMELISTWIDGET_H
19 #define NAMELISTWIDGET_H
20 
21 #include "nameslist.h"
22 #include <QWidget>
23 
24 namespace Ui {
25  class NameListWidget;
26 }
27 
32 class NameListWidget : public QWidget
33 {
34  Q_OBJECT
35 
36  public:
37  explicit NameListWidget(QWidget *parent = nullptr);
39 
40  void addLine();
41  void setNames (const NamesList &name_list);
42  NamesList names() const;
43  void setReadOnly(bool ro);
44  bool isEmpty() const;
45  void setClipboardValue (QHash <QString, QString> value);
46 
47  private slots:
48  void on_m_clipboard_cb_activated(int index);
49 
50  private:
51  void clean();
52 
53  private:
54  Ui::NameListWidget *ui;
55  bool m_read_only = false;
56 };
57 
58 #endif // NAMELISTWIDGET_H
NameListWidget::setReadOnly
void setReadOnly(bool ro)
NameListWidget::setReadOnly Set this dialog to read only or not.
Definition: namelistwidget.cpp:104
NamesList::addName
void addName(const QString &, const QString &)
Definition: nameslist.cpp:43
NameListWidget::isEmpty
bool isEmpty() const
NameListWidget::isEmpty.
Definition: namelistwidget.cpp:125
nameslist.h
NameListWidget::addLine
void addLine()
NameListWidget::addLine Add a new line to the name list widget.
Definition: namelistwidget.cpp:42
NameListWidget::clean
void clean()
NameListWidget::clean Clean the lists of names by removing the emtpy lines.
Definition: namelistwidget.cpp:150
NameListWidget::on_m_clipboard_cb_activated
void on_m_clipboard_cb_activated(int index)
Definition: namelistwidget.cpp:163
NamesList::isEmpty
bool isEmpty() const
Definition: nameslist.cpp:73
NameListWidget::m_read_only
bool m_read_only
Definition: namelistwidget.h:55
NameListWidget::ui
Ui::NameListWidget * ui
Definition: namelistwidget.h:54
NameListWidget::NameListWidget
NameListWidget(QWidget *parent=nullptr)
Definition: namelistwidget.cpp:24
NameListWidget::~NameListWidget
~NameListWidget()
Definition: namelistwidget.cpp:33
NameListWidget::names
NamesList names() const
NameListWidget::names.
Definition: namelistwidget.cpp:82
Ui
Definition: autonumberingdockwidget.h:25
NamesList::langs
QList< QString > langs() const
Definition: nameslist.cpp:66
NamesList
Definition: nameslist.h:30
QET::Icons::ro
QIcon ro
Definition: qeticons.cpp:200
NameListWidget::setClipboardValue
void setClipboardValue(QHash< QString, QString > value)
Definition: namelistwidget.cpp:129
NameListWidget
The NameListWidget class Provide a widget for let user define localized string;.
Definition: namelistwidget.h:33
NameListWidget::setNames
void setNames(const NamesList &name_list)
NameListWidget::setNames Set the current names of this dialog from name_list.
Definition: namelistwidget.cpp:60
namelistwidget.h