parley
vocabularydelegate.cpp
Go to the documentation of this file.
73 QWidget * VocabularyDelegate::createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const
113 //if there is only one word and that is the suggestion word (in translations) then don't create the combobox
114 if (!translations.isEmpty() && !(translations.size() == 1 && (*translations.begin()) == index.model()->data(index, Qt::DisplayRole).toString())) {
163 if (audioPainterPath.contains(event->pos()) && hasAudio(index) && (column == Translation || column == Pronunciation)) {
166 else if (imagePainterPath.contains(event->pos()) && hasImage(index) && (column == Translation || column == Pronunciation)) {
227 void VocabularyDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
277 void VocabularyDelegate::setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const
333 QPair< QString, QString > VocabularyDelegate::guessWordType(const QString & entry, int language) const
339 if ( article == ->identifier(language).articles().article(KEduVocWordFlag::Singular| KEduVocWordFlag::Definite| KEduVocWordFlag::Masculine) ) {
341 return qMakePair(m_doc->wordTypes().specialTypeNoun(), m_doc->wordTypes().specialTypeNounMale());
Model for the tree of containers (lessons, word types).
Definition: readonlycontainermodel.h:33
bool isValid() const
Type type() const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
void setEditorData(QWidget *editor, const QModelIndex &index) const
Definition: vocabularydelegate.cpp:247
Definition: vocabularyfilter.h:26
int size() const
bool hasImage(const QModelIndex &index) const
Definition: vocabularydelegate.cpp:203
Definition: vocabularymodel.h:36
bool contains(const QPointF &point) const
void setDocument(KEduVocDocument *doc)
Definition: vocabularydelegate.cpp:327
KEduVocContainer * rootContainer() const
Definition: vocabularydelegate.cpp:355
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: vocabularydelegate.cpp:227
Definition: vocabularymodel.h:34
virtual void setVisible(bool visible)
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Definition: vocabularydelegate.cpp:277
void save()
const QPoint & pos() const
T value() const
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule)
int height() const
int x() const
int y() const
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
void showText(const QPoint &pos, const QString &text, QWidget *w)
QString tr(const char *sourceText, const char *disambiguation, int n)
QDBusMessage call(const QString &method, const QVariant &arg1, const QVariant &arg2, const QVariant &arg3, const QVariant &arg4, const QVariant &arg5, const QVariant &arg6, const QVariant &arg7, const QVariant &arg8)
QString imageUrl(const QModelIndex &index) const
Definition: vocabularydelegate.cpp:215
bool isValid() const
void addPolygon(const QPolygonF &polygon)
static int columnType(int column)
Returns the type of the column specified.
Definition: vocabularymodel.cpp:315
QString audioUrl(const QModelIndex &index) const
Definition: vocabularydelegate.cpp:208
void setPen(const QColor &color)
const QPoint & globalPos() const
WordTypeBasicModel(QObject *parent=0)
Definition: vocabularydelegate.cpp:350
bool isEmpty() const
int row() const
void setBrush(const QBrush &brush)
void * internalPointer() const
virtual QVariant data(const QModelIndex &index, int role) const =0
Definition: vocabularymodel.h:50
QModelIndex parent() const
Definition: vocabularymodel.h:51
Definition: languagesettings.h:10
Definition: vocabularymodel.h:29
iterator begin()
void hideText()
void expandAll()
void restore()
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: vocabularydelegate.cpp:73
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const
int width() const
const QAbstractItemModel * model() const
QSet< T > & unite(const QSet< T > &other)
QVariant data(int role) const
bool hasAudio(const QModelIndex &index) const
Definition: vocabularydelegate.cpp:198
static bool automaticTranslation()
Get Enable automatic translation of the unit entries.
Definition: prefs.h:241
virtual void setModel(QAbstractItemModel *model)
virtual int columnCount(const QModelIndex &parent) const =0
static int translation(int column)
Returns which translation this column matches.
Definition: vocabularymodel.cpp:310
void setDocument(KEduVocDocument *doc)
Set the new source kvtml file.
Definition: readonlycontainermodel.cpp:43
int column() const
Definition: vocabularymodel.h:53
Definition: vocabularymodel.h:52
bool isEmpty() const
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
QList< T > toList() const
QHeaderView * header() const
void setTranslator(Translator *translator)
Sets the member variable m_translator to a Translator object.
Definition: vocabularydelegate.cpp:367
VocabularyDelegate(QObject *parent=0)
Definition: vocabularydelegate.cpp:40
void setRootIsDecorated(bool show)
QSet< QString > * getTranslation(QString word, QString fromLanguage, QString toLanguage)
Returns a QStringList with all the translations of word from fromLanguage to toLanguage.
Definition: translator.cpp:45
QPolygon imagePolygon(const QStyleOptionViewItem &option) const
Definition: vocabularydelegate.cpp:188
QString toString() const
QPolygon audioPolygon(const QStyleOptionViewItem &option) const
Definition: vocabularydelegate.cpp:178
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index)
Definition: vocabularydelegate.cpp:150
QString keyboardLayout() const
Get Keyboard layout for this locale.
Definition: languagesettings.h:29
static int columnType(int column)
Definition: vocabularydelegate.cpp:222
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.