2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2012-01-01 22:51:51 +00:00
|
|
|
Copyright 2006-2012 Xavier Guerrin
|
2007-12-01 10:47:15 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2007-04-13 11:50:16 +00:00
|
|
|
#ifndef NAMES_LIST_WIDGET_H
|
|
|
|
#define NAMES_LIST_WIDGET_H
|
2007-04-07 02:37:57 +00:00
|
|
|
#include <QtGui>
|
2007-04-13 15:48:00 +00:00
|
|
|
#include "nameslist.h"
|
2007-04-07 02:37:57 +00:00
|
|
|
/**
|
|
|
|
Cette classe represente une interface permettant de saisir les noms des
|
|
|
|
categories et elements.
|
|
|
|
*/
|
2007-04-13 11:50:16 +00:00
|
|
|
class NamesListWidget : public QWidget {
|
2007-04-07 02:37:57 +00:00
|
|
|
Q_OBJECT
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
// constructeurs, destructeur
|
2007-04-07 02:37:57 +00:00
|
|
|
public:
|
2007-04-13 11:50:16 +00:00
|
|
|
NamesListWidget(QWidget * = 0);
|
|
|
|
virtual ~NamesListWidget();
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
private:
|
2007-04-13 11:50:16 +00:00
|
|
|
NamesListWidget(const NamesListWidget &);
|
2007-04-07 02:37:57 +00:00
|
|
|
|
|
|
|
// attributs
|
|
|
|
private:
|
|
|
|
QTreeWidget *tree_names;
|
|
|
|
QPushButton *button_add_line;
|
2007-04-13 15:48:00 +00:00
|
|
|
NamesList hash_names;
|
2007-06-30 17:41:07 +00:00
|
|
|
bool read_only;
|
2007-04-07 02:37:57 +00:00
|
|
|
|
|
|
|
// methodes
|
|
|
|
public:
|
|
|
|
bool checkOneName();
|
2007-04-13 15:48:00 +00:00
|
|
|
NamesList names();
|
|
|
|
void setNames(const NamesList &);
|
2007-06-30 17:41:07 +00:00
|
|
|
void setReadOnly(bool);
|
|
|
|
bool isReadOnly() const;
|
2007-04-12 03:13:13 +00:00
|
|
|
|
2007-04-07 02:37:57 +00:00
|
|
|
private:
|
|
|
|
void clean();
|
|
|
|
void updateHash();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void addLine();
|
2007-06-30 17:41:07 +00:00
|
|
|
void check();
|
|
|
|
|
|
|
|
signals:
|
2007-12-16 14:05:39 +00:00
|
|
|
/**
|
|
|
|
Signal emis lors de la verification de la saisie s'il y a au moins un
|
|
|
|
nom saisi
|
|
|
|
*/
|
2007-06-30 17:41:07 +00:00
|
|
|
void inputChecked();
|
2007-04-07 02:37:57 +00:00
|
|
|
};
|
|
|
|
#endif
|