Commit 55dabc54 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECLARE_OVERRIDE

parent 49a82bca
......@@ -43,24 +43,24 @@ public:
explicit ContainerModel(KEduVocContainer::EnumContainerType type, QObject *parent = 0);
virtual QVariant data(const QModelIndex &index, int role) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
virtual Qt::DropActions supportedDropActions() const;
virtual QStringList mimeTypes() const;
virtual QMimeData * mimeData(const QModelIndexList &indexes) const;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent);
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
QStringList mimeTypes() const Q_DECL_OVERRIDE;
QMimeData * mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
/** Change the name or checkbox of a lesson.
* @param index which lesson
* @param value new name
* @param role
* @return bool @c true it worked */
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
QModelIndex appendContainer(const QModelIndex& parent, const QString & containerName = QString());
......@@ -69,7 +69,7 @@ public:
/** Indicate supported drag actions
@return enum of actions supported **/
virtual Qt::DropActions supportedDragActions() const ;
Qt::DropActions supportedDragActions() const Q_DECL_OVERRIDE;
signals:
/**
......
......@@ -50,7 +50,7 @@ protected:
private:
// intentionally hide this to make sure a proper model is passed
virtual void setModel(QAbstractItemModel *model) {
void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE {
Q_UNUSED(model)
}
};
......
......@@ -34,9 +34,9 @@ public:
explicit LessonModel(QObject *parent = 0);
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual QVariant data(const QModelIndex &index, int role) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
/**
* Divide a lesson into smaller ones.
......@@ -48,7 +48,7 @@ public:
void splitLesson(const QModelIndex& containerIndex, int entriesPerLesson, SplitLessonOrder order);
protected:
KEduVocContainer * rootContainer() const;
KEduVocContainer * rootContainer() const Q_DECL_OVERRIDE;
};
......
......@@ -37,17 +37,17 @@ class ReadonlyContainerModel : public QAbstractItemModel
public:
explicit ReadonlyContainerModel(KEduVocContainer::EnumContainerType type, QObject *parent = 0);
virtual QVariant data(const QModelIndex &index, int role) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
virtual QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const;
QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
QModelIndex index(KEduVocContainer* container) const;
virtual QModelIndex parent(const QModelIndex &index) const;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE;
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
KEduVocContainer::EnumContainerType containerType();
......
......@@ -38,10 +38,10 @@ public slots:
void setSearchString(const QString& expression);
protected:
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const Q_DECL_OVERRIDE;
private:
virtual void setSourceModel(QAbstractItemModel *model) {
void setSourceModel(QAbstractItemModel *model) Q_DECL_OVERRIDE {
Q_UNUSED(model)
}
......
......@@ -43,9 +43,9 @@ public:
QList<KEduVocTranslation *> translationList() const;
QList<VocabularyMimeData::MimeExpression> expressionList() const;
QVariant retrieveData(const QString & mimeType, QVariant::Type type) const;
QVariant retrieveData(const QString & mimeType, QVariant::Type type) const Q_DECL_OVERRIDE;
QStringList formats() const;
QStringList formats() const Q_DECL_OVERRIDE;
private:
......
......@@ -58,13 +58,13 @@ public:
~VocabularyModel();
int rowCount(const QModelIndex&) const;
int columnCount(const QModelIndex&) const;
QVariant data(const QModelIndex&, int) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
Qt::ItemFlags flags(const QModelIndex &index) const;
int rowCount(const QModelIndex&) const Q_DECL_OVERRIDE;
int columnCount(const QModelIndex&) const Q_DECL_OVERRIDE;
QVariant data(const QModelIndex&, int) const Q_DECL_OVERRIDE;
bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_OVERRIDE;
Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
/**
* Returns the name of the entryColumns column
......@@ -85,10 +85,10 @@ public:
QModelIndex appendEntry(KEduVocExpression *expression = 0);
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex()) Q_DECL_OVERRIDE;
QStringList mimeTypes() const;
QMimeData * mimeData(const QModelIndexList &indexes) const;
QStringList mimeTypes() const Q_DECL_OVERRIDE;
QMimeData * mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE;
// bool dropMimeData(const QMimeData *data, Qt::DropAction action,
// int row, int column, const QModelIndex &parent);
......
......@@ -33,7 +33,7 @@ public:
void deleteWordClass(const QModelIndex& wordTypeIndex);
protected:
KEduVocContainer * rootContainer() const;
KEduVocContainer * rootContainer() const Q_DECL_OVERRIDE;
};
......
......@@ -37,7 +37,7 @@ public:
void setDue(WordCount &wc);
protected:
void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
private:
int m_dueWords[8];
......
......@@ -30,9 +30,9 @@ public:
virtual ~ButtonDelegate();
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
QModelIndex hoveredIndex() const;
......
......@@ -57,7 +57,7 @@ public:
RemoveButton(QWidget *parent = 0);
protected:
void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
};
......
......@@ -22,6 +22,6 @@ public:
GradeReferenceWidget(QWidget *parent = 0);
protected:
void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
};
......@@ -49,7 +49,7 @@ private slots:
void slotImageChanged(const QString & url);
protected:
bool eventFilter(QObject *obj, QEvent *event);
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
private:
/// Column in the document - corresponds to the language (-KV_COL_TRANS)
......
......@@ -76,8 +76,8 @@ class LatexDelegate : public QItemDelegate
public:
LatexDelegate(QObject *parent = 0);
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const Q_DECL_OVERRIDE;
void setMathModeCheckBox(QCheckBox *checkBox) {
m_checkBox = checkBox;
}
......
......@@ -80,14 +80,14 @@ public slots:
void collapseAllLesson();
protected slots:
void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
void currentChanged(const QModelIndex & current, const QModelIndex & previous);
void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected) Q_DECL_OVERRIDE;
void currentChanged(const QModelIndex & current, const QModelIndex & previous) Q_DECL_OVERRIDE;
private:
virtual void setModel(ContainerModel *model) {
void setModel(ContainerModel *model) Q_DECL_OVERRIDE {
Q_UNUSED(model)
}
virtual void setModel(QAbstractItemModel *model) {
void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE {
Q_UNUSED(model)
}
......
......@@ -48,7 +48,7 @@ public slots:
void setTranslation(KEduVocExpression *entry, int translation);
protected:
bool eventFilter(QObject *obj, QEvent *event);
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
private slots:
void slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
......
......@@ -101,7 +101,7 @@ class SummaryWordDelegate : public QItemDelegate
public:
SummaryWordDelegate(QObject *parent = 0);
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
};
}
......
......@@ -49,7 +49,7 @@ public:
VocabularyColumnsDialog(KEduVocDocument *doc, QWidget *parent);
~VocabularyColumnsDialog();
void accept();
void accept() Q_DECL_OVERRIDE;
private:
/**
......
......@@ -48,11 +48,11 @@ public:
VocabularyDelegate(QObject *parent = 0);
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const Q_DECL_OVERRIDE;
void setTranslator(Translator * translator);
static int columnType(int column);
......@@ -66,7 +66,7 @@ public:
public slots:
void setDocument(KEduVocDocument *doc);
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index );
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index ) Q_DECL_OVERRIDE;
private:
KEduVocDocument *m_doc;
......@@ -84,7 +84,7 @@ class VocabularyDelegate::WordTypeBasicModel : public ReadonlyContainerModel
public:
explicit WordTypeBasicModel(QObject *parent = 0);
protected:
KEduVocContainer * rootContainer() const;
KEduVocContainer * rootContainer() const Q_DECL_OVERRIDE;
};
}
......
......@@ -60,7 +60,7 @@ public:
QModelIndexList getSelectedIndexes() const;
public slots:
void reset();
void reset() Q_DECL_OVERRIDE;
void appendEntry();
/** Delete the currently selected entries */
......@@ -106,10 +106,10 @@ private slots:
private:
void selectIndex(const QModelIndex &index);
// trap enter presses at the end of the document to add a new entry instead of moving to the first cell
bool eventFilter(QObject *obj, QEvent *event);
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
// Make this private to avoid inadvertent use. Instead use setFilter() which is public.
virtual void setModel(QAbstractItemModel *model) {
void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE {
Q_UNUSED(model)
}
......
......@@ -47,7 +47,7 @@ signals:
void selectedWordTypeChanged(KEduVocWordType* wordType);
protected:
void contextMenuEvent(QContextMenuEvent * event);
void contextMenuEvent(QContextMenuEvent * event) Q_DECL_OVERRIDE;
private slots:
void setWordTypeNone();
......
......@@ -28,7 +28,7 @@ public:
ExportDialog(ParleyDocument *doc, QWidget *parent = 0);
private slots:
void accept();
void accept() Q_DECL_OVERRIDE;
private:
QUrl getFileName(const QString& filter);
......
......@@ -104,12 +104,12 @@ public slots:
void slotUpdateWindowCaption();
/** When quitting, ask for confirmation if the doc has not been saved */
bool queryClose();
bool queryClose() Q_DECL_OVERRIDE;
/** remove an entry from the list of recent files */
void removeRecentFile(const QUrl &url);
QSize sizeHint() const;
QSize sizeHint() const Q_DECL_OVERRIDE;
/** set up options */
void slotGeneralOptions();
......
......@@ -27,7 +27,7 @@ class BoxesWidget : public ImageWidget
public:
BoxesWidget(QWidget* parent = 0);
virtual QSize minimumSizeHint() const;
QSize minimumSizeHint() const Q_DECL_OVERRIDE;
void setRenderer(ThemedBackgroundRenderer *renderer);
void setBoxCount(int boxCount);
......@@ -36,7 +36,7 @@ public:
void updatePixmap();
protected:
bool event(QEvent *e);
bool event(QEvent *e) Q_DECL_OVERRIDE;
private:
void drawElement(QPainter *p, const QString& id);
......
......@@ -29,17 +29,17 @@ public:
ComparisonBackendMode(AbstractFrontend *frontend,
QObject *parent, Practice::SessionManagerBase* sessionManager, KEduVocDocument* doc);
virtual bool setTestEntry(TestEntry* current);
virtual grade_t currentPreGradeForEntry() const;
virtual grade_t currentGradeForEntry() const;
bool setTestEntry(TestEntry* current) Q_DECL_OVERRIDE;
grade_t currentPreGradeForEntry() const Q_DECL_OVERRIDE;
grade_t currentGradeForEntry() const Q_DECL_OVERRIDE;
void checkAnswer();
void checkAnswer() Q_DECL_OVERRIDE;
public Q_SLOTS:
virtual void hintAction();
void hintAction() Q_DECL_OVERRIDE;
protected:
virtual void updateGrades();
void updateGrades() Q_DECL_OVERRIDE;
private:
......
......@@ -32,31 +32,31 @@ class ComparisonModeWidget: public AbstractModeWidget
public:
ComparisonModeWidget(GuiFrontend *frontend, QWidget *parent = 0);
virtual QVariant userInput();
QVariant userInput() Q_DECL_OVERRIDE;
virtual void setQuestion(const QVariant& question);
virtual void setSolution(const QVariant& solution);
virtual void setHint(const QVariant& hint);
virtual void setFeedback(const QVariant& feedback);
virtual void setFeedbackState(AbstractFrontend::ResultState feedbackState) {
void setQuestion(const QVariant& question) Q_DECL_OVERRIDE;
void setSolution(const QVariant& solution) Q_DECL_OVERRIDE;
void setHint(const QVariant& hint) Q_DECL_OVERRIDE;
void setFeedback(const QVariant& feedback) Q_DECL_OVERRIDE;
void setFeedbackState(AbstractFrontend::ResultState feedbackState) Q_DECL_OVERRIDE {
Q_UNUSED(feedbackState);
}
virtual void setResultState(AbstractFrontend::ResultState resultState) {
void setResultState(AbstractFrontend::ResultState resultState) Q_DECL_OVERRIDE {
Q_UNUSED(resultState);
}
virtual void setQuestionFont(const QFont& font);
virtual void setSolutionFont(const QFont& font);
virtual void setQuestionSound(const QUrl& soundUrl);
virtual void setSolutionSound(const QUrl& soundUrl);
virtual void setSolutionPronunciation(const QString& pronunciationText);
virtual void setQuestionPronunciation(const QString& pronunciationText);
virtual void setSynonym(const QString& /*entry*/) {}
void setQuestionFont(const QFont& font) Q_DECL_OVERRIDE;
void setSolutionFont(const QFont& font) Q_DECL_OVERRIDE;
void setQuestionSound(const QUrl& soundUrl) Q_DECL_OVERRIDE;
void setSolutionSound(const QUrl& soundUrl) Q_DECL_OVERRIDE;
void setSolutionPronunciation(const QString& pronunciationText) Q_DECL_OVERRIDE;
void setQuestionPronunciation(const QString& pronunciationText) Q_DECL_OVERRIDE;
void setSynonym(const QString& /*entry*/) Q_DECL_OVERRIDE {}
public Q_SLOTS:
virtual void showQuestion();
virtual void showSolution();
virtual void showSynonym() {}
void showQuestion() Q_DECL_OVERRIDE;
void showSolution() Q_DECL_OVERRIDE;
void showSynonym() Q_DECL_OVERRIDE {}
private Q_SLOTS:
void nextComparisonForm();
......
......@@ -47,28 +47,28 @@ private slots:
/**
* Called when the user clicks Apply or OK.
*/
void updateSettings();
void updateSettings() Q_DECL_OVERRIDE;
/**
* Updates dialog widgets. Here only used after loading a profile.
* Profiles only store the settings of the last three pages in the dialog.
*/
void updateWidgets();
void updateWidgets() Q_DECL_OVERRIDE;
/**
* Called when the user clicks Default
*/
void updateWidgetsDefault();
void updateWidgetsDefault() Q_DECL_OVERRIDE;
/**
* Returns true if the current state of the dialog is different from the saved settings
*/
bool hasChanged();
bool hasChanged() Q_DECL_OVERRIDE;
private:
/**
* Returns true if the current state of the dialog represents the default settings.
*/
bool isDefault();
bool isDefault() Q_DECL_OVERRIDE;
GeneralPracticeOptions *m_generalPracticeOptions;
BlockOptions *m_blockOptions;
......
......@@ -29,18 +29,18 @@ public:
ConjugationBackendMode(AbstractFrontend *frontend,
QObject *parent, Practice::SessionManagerBase* sessionManager, KEduVocDocument* doc);
virtual bool setTestEntry(TestEntry* current);
bool setTestEntry(TestEntry* current) Q_DECL_OVERRIDE;
/** Return the worst pregrade for any pronoun of the current entry */
virtual grade_t currentPreGradeForEntry() const;
grade_t currentPreGradeForEntry() const Q_DECL_OVERRIDE;
/** Return the worst grade for any pronoun of the current entry */
virtual grade_t currentGradeForEntry() const;
grade_t currentGradeForEntry() const Q_DECL_OVERRIDE;
virtual void updateGrades();
void updateGrades() Q_DECL_OVERRIDE;
public Q_SLOTS:
virtual void hintAction();
virtual void checkAnswer();
void hintAction() Q_DECL_OVERRIDE;
void checkAnswer() Q_DECL_OVERRIDE;
private:
QStringList validPersonalPronouns();
......
......@@ -34,31 +34,31 @@ class ConjugationModeWidget: public AbstractModeWidget
public:
ConjugationModeWidget(GuiFrontend *frontend, QWidget *parent = 0);
virtual ~ConjugationModeWidget();
virtual QVariant userInput();
QVariant userInput() Q_DECL_OVERRIDE;
virtual void setQuestion(const QVariant& question);
virtual void setSolution(const QVariant& solution);
virtual void setHint(const QVariant& hint);
virtual void setFeedback(const QVariant& feedback);
virtual void setFeedbackState(AbstractFrontend::ResultState feedbackState) {
void setQuestion(const QVariant& question) Q_DECL_OVERRIDE;
void setSolution(const QVariant& solution) Q_DECL_OVERRIDE;
void setHint(const QVariant& hint) Q_DECL_OVERRIDE;
void setFeedback(const QVariant& feedback) Q_DECL_OVERRIDE;
void setFeedbackState(AbstractFrontend::ResultState feedbackState) Q_DECL_OVERRIDE {
Q_UNUSED(feedbackState);
}
virtual void setResultState(AbstractFrontend::ResultState resultState) {
void setResultState(AbstractFrontend::ResultState resultState) Q_DECL_OVERRIDE {
Q_UNUSED(resultState);
}
virtual void setQuestionFont(const QFont& font);
virtual void setSolutionFont(const QFont& font);
virtual void setQuestionSound(const QUrl& soundUrl);
virtual void setSolutionSound(const QUrl& soundUrl);
virtual void setSolutionPronunciation(const QString& pronunciationText);
virtual void setQuestionPronunciation(const QString& pronunciationText);
virtual void setSynonym(const QString& /*entry*/) {}
void setQuestionFont(const QFont& font) Q_DECL_OVERRIDE;
void setSolutionFont(const QFont& font) Q_DECL_OVERRIDE;
void setQuestionSound(const QUrl& soundUrl) Q_DECL_OVERRIDE;
void setSolutionSound(const QUrl& soundUrl) Q_DECL_OVERRIDE;
void setSolutionPronunciation(const QString& pronunciationText) Q_DECL_OVERRIDE;
void setQuestionPronunciation(const QString& pronunciationText) Q_DECL_OVERRIDE;
void setSynonym(const QString& /*entry*/) Q_DECL_OVERRIDE {}
public Q_SLOTS:
virtual void showQuestion();
virtual void showSolution();
virtual void showSynonym() {}
void showQuestion() Q_DECL_OVERRIDE;
void showSolution() Q_DECL_OVERRIDE;
void showSynonym() Q_DECL_OVERRIDE {}
private Q_SLOTS:
void nextConjugationForm();
......
......@@ -27,7 +27,7 @@ public:
ExampleSentenceBackendMode(Practice::AbstractFrontend* frontend, QObject* parent,
Practice::SessionManagerBase* sessionManager, KEduVocDocument* doc);