1 #ifndef SELECT_FROM_LIST_DIALOG_H 2 #define SELECT_FROM_LIST_DIALOG_H 6 #include "ui_selectlistdialog.h" 17 explicit SelectFromListDialog(
const std::deque<std::string> &fields,
bool single_selection =
true, QWidget *parent = 0);
20 std::vector<int> getSelectedRowNumber()
const;
23 void on_buttonBox_accepted();
25 void on_listFieldsWidget_currentRowChanged(
int currentRow);
27 void on_listFieldsWidget_doubleClicked(
const QModelIndex &index);
29 void on_pushButtonSelectAll_pressed();
31 void on_listFieldsWidget_clicked(
const QModelIndex &index);
34 Ui::SelectXAxisDialog *
ui;
43 ui(new
Ui::SelectXAxisDialog),
44 _single_selection( single_selection )
46 auto flags = this->windowFlags();
47 this->setWindowFlags(
flags | Qt::WindowStaysOnTopHint);
52 ui->listFieldsWidget->setSelectionMode( QAbstractItemView::ExtendedSelection );
55 ui->pushButtonSelectAll->hide();
59 for (
int i=0;
i< fields.size();
i++)
61 auto item =
new QListWidgetItem( QString::fromStdString(fields[
i]) );
62 ui->listFieldsWidget->addItem( item );
64 if( fields.size() == 1){
65 item->setSelected(
true);
82 QModelIndexList indexes =
ui->listFieldsWidget->selectionModel()->selectedIndexes();
83 ui->buttonBox->setEnabled( indexes.empty() == false );
88 QModelIndexList indexes =
ui->listFieldsWidget->selectionModel()->selectedIndexes();
90 foreach(QModelIndex index, indexes)
98 QModelIndexList indexes =
ui->listFieldsWidget->selectionModel()->selectedIndexes();
99 ui->buttonBox->setEnabled( indexes.empty() == false );
112 for (
int i=0;
i<
ui->listFieldsWidget->count();
i++)
119 #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)