parley
LessonModel Class Reference
Model for the tree of lessons. More...
#include <lessonmodel.h>

Public Types | |
| enum | SplitLessonOrder { Sorted, Random } |
Public Member Functions | |
| LessonModel (QObject *parent=0) | |
| virtual QVariant | data (const QModelIndex &index, int role) const |
| virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
| virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
| void | splitLesson (const QModelIndex &containerIndex, int entriesPerLesson, SplitLessonOrder order) |
Protected Member Functions | |
| KEduVocContainer * | rootContainer () const |
Detailed Description
Model for the tree of lessons.
Definition at line 25 of file lessonmodel.h.
Member Enumeration Documentation
When splitting a lesson into smaller ones - how to sort the entries into lessons.
Definition at line 31 of file lessonmodel.h.
Constructor & Destructor Documentation
| LessonModel::LessonModel | ( | QObject * | parent = 0 |
) | [explicit] |
Definition at line 29 of file lessonmodel.cpp.
Member Function Documentation
| QVariant LessonModel::data | ( | const QModelIndex & | index, | |
| int | role | |||
| ) | const [virtual] |
Reimplemented from ContainerModel.
Definition at line 54 of file lessonmodel.cpp.
| Qt::ItemFlags LessonModel::flags | ( | const QModelIndex & | index | ) | const [virtual] |
Reimplemented from ContainerModel.
Definition at line 42 of file lessonmodel.cpp.
| KEduVocContainer * LessonModel::rootContainer | ( | ) | const [protected, virtual] |
Implements BasicContainerModel.
Definition at line 34 of file lessonmodel.cpp.
| bool LessonModel::setData | ( | const QModelIndex & | index, | |
| const QVariant & | value, | |||
| int | role = Qt::EditRole | |||
| ) | [virtual] |
Change the name or checkbox of a lesson.
- Parameters:
-
index which lesson value new name role
- Returns:
- bool
trueit worked
Reimplemented from ContainerModel.
Definition at line 72 of file lessonmodel.cpp.
| void LessonModel::splitLesson | ( | const QModelIndex & | containerIndex, | |
| int | entriesPerLesson, | |||
| SplitLessonOrder | order | |||
| ) |
Divide a lesson into smaller ones.
Tip: If you create a lesson that is >= the original one and use random order, you get your lesson reshuffled. Maybe that is sometimes useful. For now the lessons are appended at the end.
- Parameters:
-
lessonIndex lesson to split entriesPerLesson number of entries in each new lesson order one of SplitLessonOrder
Definition at line 83 of file lessonmodel.cpp.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference