blob: be4269608bd4e651e9f133d1ab45cf99e911251d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include <QLineEdit>
#include <QStringList>
#include <QVBoxLayout>
#include <QVector>
#include <QWidget>
class DynamicWaysEntry : public QWidget
{
public:
DynamicWaysEntry(QWidget *parent = nullptr);
QStringList get_entries() const;
/**
* Parses a string from this entry field, if it is valid.
* @param a string
* @param -1 if the string is not suitable as a way, an integer compatible
* with the cache constructor otherwise.
*/
int parse_valid_way(QString t);
private slots:
void on_number_enter(const QString &t);
private:
QVBoxLayout *l;
QVector<QLineEdit *> fields;
QStringList entries;
void add_field();
void remove_last_field();
};
|