VPTissue Reference Manual
SelectByIDWidget.h
Go to the documentation of this file.
1 #ifndef SIMPT_EDITOR_SELECT_BY_ID_WIDGET_H_INCLUDED
2 #define SIMPT_EDITOR_SELECT_BY_ID_WIDGET_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include <QRegExp>
23 #include <QWidget>
24 
25 class QLineEdit;
26 class QPushButton;
27 
28 namespace SimPT_Editor {
29 
38 class SelectByIDWidget : public QWidget
39 {
40  Q_OBJECT
41 public:
42  SelectByIDWidget(QWidget* parent = nullptr);
43 
44  virtual ~SelectByIDWidget();
45 
49  void SetMaxID(unsigned int maxID);
50 
51 signals:
55  void IDsSelected(const std::list<unsigned int>& ids, bool locked);
56 
57 private slots:
61  void ProcessInput();
62 
66  void SetTextBoxStyle(bool error = false);
67 
68 private:
72  void ParseText();
73 
77  void SetupGui();
78 
79 private:
80  QLineEdit* m_line_edit;
81  QPushButton* m_lock;
82  QRegExp m_regex;
83  int m_max_id;
84 };
85 
86 } // namespace
87 
88 #endif // end-of-include-guard
Namespace for SimPT tissue editor package.
Definition: Cell.h:32
Class for selecting an item by ID.
void SetMaxID(unsigned int maxID)
Set the maximal ID and reset the text.
void IDsSelected(const std::list< unsigned int > &ids, bool locked)
Emitted when IDs have been selected.
see the online Qt documentation