19 myList =
new QListWidget(parent);
23 QPushButton* addCondition =
new QPushButton(tr(
"add"),
this);
24 connect(addCondition, SIGNAL(clicked(
bool)),
this, SLOT(
onAddCondition(
bool)));
26 QPushButton* delCondition =
new QPushButton(tr(
"delete"),
this);
27 connect(delCondition, SIGNAL(clicked(
bool)),
this, SLOT(
onDeleteCondition(
bool)));
29 QPushButton* reset =
new QPushButton(tr(
"reset changes"),
this);
30 connect(reset, SIGNAL(clicked(
bool)),
this, SLOT(
onReset(
bool)));
32 QHBoxLayout* buttons =
new QHBoxLayout();
33 buttons->addWidget(addCondition);
34 buttons->addWidget(delCondition);
35 buttons->addWidget(reset);
37 QVBoxLayout* l =
new QVBoxLayout(
this);
39 l->addLayout(buttons);
45 QList<QStringList> value;
46 for (
int i = 0; i <
myList->count(); i++)
48 QListWidgetItem* wi =
myList->item(i);
49 QStringList
data = wi->data(Qt::UserRole).value<QStringList>();
59 QStringList display(item);
62 QListWidgetItem* wi =
new QListWidgetItem(display.join(
" "));
63 wi->setData(Qt::UserRole, QVariant::fromValue(item));
64 wi->setFlags(wi->flags() | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable);
72 for (QStringList item :
data)
75 item.push_front(
"quest");
93 if (
myList->currentRow() == -1)
102 if (QMessageBox::question(
this,
"Confirm reset",
"Reset the conditions to their initial values, losing all changes?") != QMessageBox::StandardButton::Yes)
112 setWindowTitle(tr(
"Message pre-conditions"));
115 setWindowTitle(tr(
"Message post-conditions"));
118 setWindowTitle(tr(
"Step set when conditions are met"));
122 auto layout =
new QVBoxLayout(
this);