1 #ifndef SELECT_FROM_LIST_DIALOG_H
2 #define SELECT_FROM_LIST_DIALOG_H
6 #include "ui_selectlistdialog.h"
19 bool single_selection =
true, QWidget* parent = 0);
36 Ui::SelectXAxisDialog*
ui;
43 bool single_selection, QWidget* parent)
44 : QDialog(parent), ui(new
Ui::SelectXAxisDialog), _single_selection(single_selection)
46 auto flags = this->windowFlags();
47 this->setWindowFlags(flags | Qt::WindowStaysOnTopHint);
53 ui->listFieldsWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
57 ui->pushButtonSelectAll->hide();
61 for (
int i = 0; i < fields.size(); i++)
63 auto item =
new QListWidgetItem(QString::fromStdString(fields[i]));
64 ui->listFieldsWidget->addItem(item);
66 if (fields.size() == 1)
68 item->setSelected(
true);
85 QModelIndexList indexes =
ui->listFieldsWidget->selectionModel()->selectedIndexes();
86 ui->buttonBox->setEnabled(indexes.empty() ==
false);
91 QModelIndexList indexes =
ui->listFieldsWidget->selectionModel()->selectedIndexes();
93 foreach (QModelIndex index, indexes)
101 QModelIndexList indexes =
ui->listFieldsWidget->selectionModel()->selectedIndexes();
102 ui->buttonBox->setEnabled(indexes.empty() ==
false);
116 for (
int i = 0; i <
ui->listFieldsWidget->count(); i++)
123 #endif // SELECTXAXISDIALOG_H