Commit b34d865e authored by Dan Leinir Turthra Jensen's avatar 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
......@@ -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));
}
......@@ -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);
......
......@@ -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));
}
......@@ -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;
......
Markdown is supported
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