1 #ifndef SELECT_FROM_LIST_DIALOG_H 2 #define SELECT_FROM_LIST_DIALOG_H 6 #include "ui_selectlistdialog.h" 18 explicit SelectFromListDialog(
const std::deque<std::string>& fields,
bool single_selection =
true,
22 std::vector<int> getSelectedRowNumber()
const;
25 void on_buttonBox_accepted();
27 void on_listFieldsWidget_currentRowChanged(
int currentRow);
29 void on_listFieldsWidget_doubleClicked(
const QModelIndex& index);
31 void on_pushButtonSelectAll_pressed();
33 void on_listFieldsWidget_clicked(
const QModelIndex& index);
36 Ui::SelectXAxisDialog*
ui;
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
SelectFromListDialog(const std::deque< std::string > &fields, bool single_selection=true, QWidget *parent=0)
void on_buttonBox_accepted()
Ui::SelectXAxisDialog * ui
std::vector< int > getSelectedRowNumber() const
void on_pushButtonSelectAll_pressed()
void on_listFieldsWidget_doubleClicked(const QModelIndex &index)
void on_listFieldsWidget_currentRowChanged(int currentRow)
std::vector< int > _selected_row_number
void on_listFieldsWidget_clicked(const QModelIndex &index)