Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Miguel Lopez
Krita
Commits
b34d865e
Commit
b34d865e
authored
Apr 30, 2014
by
Dan Leinir Turthra Jensen
🌈
Browse files
sketch: Add a way to turn an id into an index on the color model and depth models
parent
89d22061
Changes
4
Hide whitespace changes
Inline
Side-by-side
krita/sketch/models/ColorDepthModel.cpp
View file @
b34d865e
...
...
@@ -89,3 +89,8 @@ QString ColorDepthModel::id(int index)
return
d
->
colorDepths
.
at
(
index
).
id
();
}
int
ColorDepthModel
::
indexOf
(
const
QString
&
id
)
{
return
d
->
colorDepths
.
indexOf
(
KoID
(
id
));
}
krita/sketch/models/ColorDepthModel.h
View file @
b34d865e
...
...
@@ -41,6 +41,7 @@ public:
QString
colorModelId
()
const
;
Q_INVOKABLE
QString
id
(
int
index
);
Q_INVOKABLE
int
indexOf
(
const
QString
&
id
);
public
Q_SLOTS
:
void
setColorModelId
(
const
QString
&
id
);
...
...
krita/sketch/models/ColorModelModel.cpp
View file @
b34d865e
...
...
@@ -69,3 +69,8 @@ QString ColorModelModel::id(int index)
return
d
->
colorModels
.
at
(
index
).
id
();
}
int
ColorModelModel
::
indexOf
(
const
QString
&
id
)
{
return
d
->
colorModels
.
indexOf
(
KoID
(
id
));
}
krita/sketch/models/ColorModelModel.h
View file @
b34d865e
...
...
@@ -38,6 +38,7 @@ public:
virtual
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
;
Q_INVOKABLE
QString
id
(
int
index
);
Q_INVOKABLE
int
indexOf
(
const
QString
&
id
);
private:
class
Private
;
...
...
Write
Preview
Markdown
is supported
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