Commit 8ebb3759 authored by Leander Schulten's avatar Leander Schulten
Browse files

UI: ControlPane: the add program block dialog now displays the right names

parent 8f82f1f4
Pipeline #188867 passed with stage
in 4 minutes and 37 seconds
......@@ -341,12 +341,11 @@ namespace Modules {
class ProgrammBlockVector : public ModelVector<std::shared_ptr<ProgramBlock>>{
Q_OBJECT
public:
virtual QVariant data(const QModelIndex &index, int role) const override{
auto res = ModelVector<std::shared_ptr<ProgramBlock>>::data(index,role);
if(res.isValid() && res.type() != QVariant::String && role == Qt::DisplayRole){
return res.value<ProgramBlock*>()->getName();
[[nodiscard]] QVariant data(const QModelIndex &index, int role) const override {
if (role == Qt::DisplayRole && index.row() >= 0 && index.row() < ssize()) {
return (*this)[index.row()]->getName();
}
return res;
return ModelVector<std::shared_ptr<ProgramBlock>>::data(index, role);
}
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment