• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

parley

  • sources
  • kde-4.12
  • kdeedu
  • parley
  • src
  • vocabulary
vocabularydelegate.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  Copyright 2006, 2007 Peter Hedlund <peter.hedlund@kdemail.net>
4  Copyright 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
5 
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef VOCABULARYDELEGATE_H
18 #define VOCABULARYDELEGATE_H
19 
20 #include "basiccontainermodel.h"
21 #include "../scripts/translator.h"
22 
23 #include <QItemDelegate>
24 #include <QModelIndex>
25 
26 class KEduVocDocument;
27 
28 namespace Editor {
29 
30 class VocabularyDelegate : public QItemDelegate
31 {
32  Q_OBJECT
33 public:
34  VocabularyDelegate(QObject *parent = 0);
35 
36  QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
37 
38  void setEditorData(QWidget *editor, const QModelIndex &index) const;
39  void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
40  void setTranslator(Translator * translator);
41 
42 public slots:
43  void setDocument(KEduVocDocument *doc);
44 
45 private:
46  KEduVocDocument *m_doc;
47  Translator * m_translator;
48 
50  QSet<QString> getTranslations(const QModelIndex & index) const;
51 
52  // for the word type combo
53  class WordTypeBasicModel;
54 };
55 
56 class VocabularyDelegate::WordTypeBasicModel :public BasicContainerModel
57 {
58 public:
59  explicit WordTypeBasicModel(QObject *parent = 0);
60 protected:
61  KEduVocContainer * rootContainer() const;
62 };
63 
64 }
65 
66 #endif
Editor::BasicContainerModel
Definition: basiccontainermodel.h:34
Editor::VocabularyDelegate::setEditorData
void setEditorData(QWidget *editor, const QModelIndex &index) const
Definition: vocabularydelegate.cpp:163
Editor::VocabularyDelegate::setDocument
void setDocument(KEduVocDocument *doc)
Definition: vocabularydelegate.cpp:254
QWidget
Editor::VocabularyDelegate::WordTypeBasicModel::rootContainer
KEduVocContainer * rootContainer() const
Definition: vocabularydelegate.cpp:282
Editor::VocabularyDelegate
Definition: vocabularydelegate.h:30
Editor::VocabularyDelegate::setModelData
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Definition: vocabularydelegate.cpp:197
QObject
Editor::BasicContainerModel::parent
virtual QModelIndex parent(const QModelIndex &index) const
Definition: basiccontainermodel.cpp:93
Editor::VocabularyDelegate::WordTypeBasicModel::WordTypeBasicModel
WordTypeBasicModel(QObject *parent=0)
Definition: vocabularydelegate.cpp:277
QAbstractItemModel
Translator
Keeps the translated words.
Definition: translator.h:74
Editor::VocabularyDelegate::createEditor
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: vocabularydelegate.cpp:76
QItemDelegate
Editor::VocabularyDelegate::setTranslator
void setTranslator(Translator *translator)
Sets the member variable m_translator to a Translator object.
Definition: vocabularydelegate.cpp:294
Editor::VocabularyDelegate::VocabularyDelegate
VocabularyDelegate(QObject *parent=0)
Definition: vocabularydelegate.cpp:40
basiccontainermodel.h
Editor::VocabularyDelegate::WordTypeBasicModel
Definition: vocabularydelegate.h:56
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal