| 12 | #include <QtWidgets/QVBoxLayout> |
| 13 | |
| 14 | CreateFeatureDialog::CreateFeatureDialog(QWidget * parent, osm::NewFeatureCategories & cats) : QDialog(parent) |
| 15 | { |
| 16 | cats.AddLanguage("en"); |
| 17 | cats.AddLanguage(languages::GetCurrentNorm()); |
| 18 | |
| 19 | QListWidget * allSortedList = new QListWidget(); |
| 20 | |
| 21 | for (auto const & name : cats.GetAllCreatableTypeNames()) |
| 22 | new QListWidgetItem(QString::fromStdString(name), allSortedList); |
| 23 | |
| 24 | connect(allSortedList, &QAbstractItemView::clicked, this, &CreateFeatureDialog::OnListItemSelected); |
| 25 | |
| 26 | QDialogButtonBox * dbb = new QDialogButtonBox(); |
| 27 | dbb->addButton(QDialogButtonBox::Close); |
| 28 | connect(dbb, &QDialogButtonBox::clicked, this, &QDialog::reject); |
| 29 | |
| 30 | QVBoxLayout * vBox = new QVBoxLayout(); |
| 31 | vBox->addWidget(allSortedList); |
| 32 | vBox->addWidget(dbb); |
| 33 | setLayout(vBox); |
| 34 | |
| 35 | setWindowTitle("OSM Editor"); |
| 36 | } |
| 37 | |
| 38 | void CreateFeatureDialog::OnListItemSelected(QModelIndex const & i) |
| 39 | { |
nothing calls this directly
no test coverage detected