parley
KVTLessonView Class Reference
#include <kvtlessonview.h>

Detailed Description
View for the lesson list.Actually a QTreeView because QListView cannot have checkboxes.
Definition at line 34 of file kvtlessonview.h.
Public Slots | |
| void | slotModelReset () |
| void | slotCreateNewLesson () |
| void | slotRenameLesson () |
| void | slotDeleteLesson () |
| void | slotSelectLesson (int lesson) |
| void | selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) |
| void | slotCheckAllLessons () |
| void | slotCheckNoLessons () |
| void | slotSplitLesson () |
Signals | |
| void | signalCurrentLessonChanged (int currentIndex) |
| void | lessonsInQueryChanged () |
Public Member Functions | |
| KVTLessonView (QWidget *parent=0) | |
| void | setModel (KVTLessonModel *model) |
| void | initializeSelection () |
Constructor & Destructor Documentation
| KVTLessonView::KVTLessonView | ( | QWidget * | parent = 0 |
) |
Set up the lesson list widget.
Also creates the menu to manipulate the lessons.
- Parameters:
-
parent parent widget
Definition at line 40 of file kvtlessonview.cpp.
Member Function Documentation
| void KVTLessonView::setModel | ( | KVTLessonModel * | model | ) |
Set the model for the view.
- Parameters:
-
model the model
Definition at line 53 of file kvtlessonview.cpp.
| void KVTLessonView::initializeSelection | ( | ) |
| void KVTLessonView::slotModelReset | ( | ) | [slot] |
Append an action to the right click menu.
- Parameters:
-
appendAction The model was reset, we need to update the selection using initializeSelection.
Definition at line 59 of file kvtlessonview.cpp.
| void KVTLessonView::slotCreateNewLesson | ( | ) | [slot] |
Append a lesson to the model and automatically set an edit up so the user can change "New lesson" into something meaningfull.
Definition at line 79 of file kvtlessonview.cpp.
| void KVTLessonView::slotRenameLesson | ( | ) | [slot] |
Create an editor to let the user type a new name for the lesson.
Definition at line 88 of file kvtlessonview.cpp.
| void KVTLessonView::slotDeleteLesson | ( | ) | [slot] |
Remove a lesson.
Ask if it's not empty.
- Todo:
- maybe a better message here...
Definition at line 94 of file kvtlessonview.cpp.
| void KVTLessonView::slotSelectLesson | ( | int | lesson | ) | [slot] |
Set the selection to a lesson.
- Parameters:
-
lesson the index of the new selection.
Definition at line 113 of file kvtlessonview.cpp.
| void KVTLessonView::selectionChanged | ( | const QItemSelection & | selected, | |
| const QItemSelection & | deselected | |||
| ) | [slot] |
Slot from model/view - a new item has been selected.
We only extract the newly selected lesson and call slotSelectLesson.
- Parameters:
-
selected is the new selection deselected was selected before
Reimplemented from QTreeView.
Definition at line 106 of file kvtlessonview.cpp.
| void KVTLessonView::slotCheckAllLessons | ( | ) | [slot] |
Add all lessons to query.
Activated from menu, passes to m_model.
Definition at line 69 of file kvtlessonview.cpp.
| void KVTLessonView::slotCheckNoLessons | ( | ) | [slot] |
Remove all lessons from query.
Activated from menu, passes to m_model.
Definition at line 74 of file kvtlessonview.cpp.
| void KVTLessonView::slotSplitLesson | ( | ) | [slot] |
Creates many small lessons with the contents of the original lesson.
- Todo:
- Let the user select if entries are taken by random or order.
- Todo:
- A nicer dialog would be great. Maybe with radio buttons to ask, if the entries should be in random order or as they come.
Definition at line 127 of file kvtlessonview.cpp.
| void KVTLessonView::signalCurrentLessonChanged | ( | int | currentIndex | ) | [signal] |
Emitted when a new lesson is selected.
Indicates the selected lesson.
| void KVTLessonView::lessonsInQueryChanged | ( | ) | [signal] |
Emitted when any of the checkboxes for the query change.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference