formatting
This commit is contained in:
parent
0937fc21e7
commit
0a1c570ffd
3 changed files with 142 additions and 163 deletions
|
@ -142,7 +142,8 @@ GenusModel::CheckableItems &GenusModel::getItems(const QModelIndex &index)
|
||||||
throw std::runtime_error("invalid index");
|
throw std::runtime_error("invalid index");
|
||||||
}
|
}
|
||||||
|
|
||||||
const GenusModel::CheckableItems &GenusModel::getItems(const QModelIndex &index) const
|
const GenusModel::CheckableItems &GenusModel::getItems(
|
||||||
|
const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
switch (index.row())
|
switch (index.row())
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,37 +40,16 @@ class GenusModel : public QAbstractTableModel
|
||||||
private:
|
private:
|
||||||
using CheckableItems = std::map<size_t, CheckableItem>;
|
using CheckableItems = std::map<size_t, CheckableItem>;
|
||||||
|
|
||||||
CheckableItems m_tiere =
|
CheckableItems m_tiere = {{0, {"Tiger"}}, {1, {"Bär"}}, {2, {"Katze"}},
|
||||||
{
|
{3, {"Pferd"}}, {4, {"Gans"}}, {5, {"Elefant"}}, {6, {"Katze"}},
|
||||||
{0, {"Tiger"}},
|
{7, {"Hund"}}};
|
||||||
{1, {"Bär"}},
|
|
||||||
{2, {"Katze"}},
|
|
||||||
{3, {"Pferd"}},
|
|
||||||
{4, {"Gans"}},
|
|
||||||
{5, {"Elefant"}},
|
|
||||||
{6, {"Katze"}},
|
|
||||||
{7, {"Hund"}}
|
|
||||||
};
|
|
||||||
|
|
||||||
CheckableItems m_futter =
|
CheckableItems m_futter = {{0, {"Salat"}}, {1, {"Fleisch"}},
|
||||||
{
|
{2, {"Knocken"}}, {3, {"Banane"}}, {4, {"Apfel"}}, {5, {"Möhre"}},
|
||||||
{0, {"Salat"}},
|
{6, {"Honig"}}, {7, {"Zucker"}}};
|
||||||
{1, {"Fleisch"}},
|
|
||||||
{2, {"Knocken"}},
|
|
||||||
{3, {"Banane"}},
|
|
||||||
{4, {"Apfel"}},
|
|
||||||
{5, {"Möhre"}},
|
|
||||||
{6, {"Honig"}},
|
|
||||||
{7, {"Zucker"}}
|
|
||||||
};
|
|
||||||
|
|
||||||
CheckableItems m_zirkus =
|
CheckableItems m_zirkus = {
|
||||||
{
|
{0, {"Kiste"}}, {1, {"Holz"}}, {2, {"Vorhang"}}, {3, {"Baum"}}};
|
||||||
{0, {"Kiste"}},
|
|
||||||
{1, {"Holz"}},
|
|
||||||
{2, {"Vorhang"}},
|
|
||||||
{3, {"Baum"}}
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GenusModel(QObject *parent);
|
GenusModel(QObject *parent);
|
||||||
|
@ -97,4 +76,3 @@ private:
|
||||||
CheckableItem &getItem(const QModelIndex &index);
|
CheckableItem &getItem(const QModelIndex &index);
|
||||||
const CheckableItem &getItem(const QModelIndex &index) const;
|
const CheckableItem &getItem(const QModelIndex &index) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue