-
-
Notifications
You must be signed in to change notification settings - Fork 342
Expand file tree
/
Copy pathDialogArguments.cpp
More file actions
41 lines (35 loc) · 757 Bytes
/
Copy pathDialogArguments.cpp
File metadata and controls
41 lines (35 loc) · 757 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Copyright (C) 2006 - 2025 Evan Teran <evan.teran@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "DialogArguments.h"
#include <QListWidgetItem>
/**
* @brief
*/
DialogArguments::DialogArguments(QWidget *parent, Qt::WindowFlags f)
: QDialog(parent, f) {
ui.setupUi(this);
}
/**
* @brief
*/
QList<QByteArray> DialogArguments::arguments() const {
QList<QByteArray> ret;
for (int i = 0; i < ui.listWidget->count(); ++i) {
ret << ui.listWidget->item(i)->text().toUtf8();
}
return ret;
}
/**
* @brief
*/
void DialogArguments::setArguments(const QList<QByteArray> &args) {
ui.listWidget->clear();
QStringList l;
for (const QByteArray &ba : args) {
l << QString::fromUtf8(ba);
}
ui.listWidget->addItems(l);
}