Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Leander Schulten
Lichtsteuerung
Commits
8ebb3759
Commit
8ebb3759
authored
Sep 29, 2019
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/modules/programblock.h
View file @
8ebb3759
...
...
@@ -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
)
;
}
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment