1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-18 04:00:03 +02:00

gui/MultiSelect: Add user_add_item parameter to constructor

adds a button and signal to the MultiSelect, allowing client code to implement adding items from user input.
This commit is contained in:
Henrik Hautakoski 2020-04-14 21:56:04 +02:00
parent 925ef7e8ad
commit 50a2805c3f
2 changed files with 23 additions and 3 deletions

View file

@ -43,7 +43,7 @@ class MultiSelect : public QPushButton
{
Q_OBJECT
public:
MultiSelect(const QString& text, QWidget *parent = 0);
MultiSelect(const QString& text, bool user_add_item = false, QWidget *parent = 0);
// Items.
@ -61,6 +61,10 @@ signals:
// This signal is emitted whenever the user has made a new selection.
void selectionChanged(QStringList selected);
// This signal is emitted whenever the user clicks the "Add" button.
// NOTE: Will only be emitted if `user_add_item` has been set to `true` in the constructor.
void addNewItem();
private slots :
// Called when the dialog is accepted.
@ -69,6 +73,9 @@ private slots :
// Called when a list item is clicked on.
void listItemClicked(QListWidgetItem *item);
// Called when the add button is clicked on.
void addBtnClicked();
protected :
// Event handlers