Skip to content

Commit

Permalink
Better project edit
Browse files Browse the repository at this point in the history
  • Loading branch information
pasbi committed Oct 21, 2024
1 parent 64fe034 commit d36bde9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/views/perioddetailview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <QApplication>
#include <QHeaderView>
#include <QLineEdit>
#include <QMenu>
#include <QMessageBox>
#include <QPainter>
Expand Down Expand Up @@ -94,9 +95,11 @@ class ProjectItemDelegate final : public QStyledItemDelegate

void setEditorData(QWidget* const editor, const QModelIndex& index) const override
{
auto& combo_box = dynamic_cast<QComboBox&>(*editor);
if (const auto* const project = interval(index).project(); project != nullptr) {
dynamic_cast<QComboBox&>(*editor).setCurrentText(project->name());
combo_box.setCurrentText(project->name());
}
combo_box.lineEdit()->selectAll();
}

void setModelData(QWidget* const editor, QAbstractItemModel* const model, const QModelIndex& index) const override
Expand Down

0 comments on commit d36bde9

Please sign in to comment.