Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

porting: add override to methods #67

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/configappearancewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private Q_SLOTS:
void showColorDialog();

private:
void showEvent(QShowEvent *);
void showEvent(QShowEvent *) override;
void setHighlightedForeground(const QString &colorName);
void setItemToolTip(QTableWidgetItem *item, const QFont &font);

Expand Down
4 changes: 2 additions & 2 deletions app/configdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class ConfigDialog : public PageDialog
void settingsChanged();

private Q_SLOTS:
void accept();
void accept() override;

private:
void keyPressEvent(QKeyEvent *event);
void keyPressEvent(QKeyEvent *event) override;

ConfigAppearanceWidget *m_configAppearanceWidget;
ConfigEditorWidget *m_configEditorWidget;
Expand Down
2 changes: 1 addition & 1 deletion app/editgotolinewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Q_SLOTS:
void focusEditor();

protected:
virtual void keyPressEvent(QKeyEvent *event);
virtual void keyPressEvent(QKeyEvent *event) override;

protected Q_SLOTS:
void hide();
Expand Down
4 changes: 2 additions & 2 deletions app/editindentwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class IndentWidget : public QWidget
void hidden();

protected:
virtual void showEvent(QShowEvent *event);
virtual void keyPressEvent(QKeyEvent *event);
virtual void showEvent(QShowEvent *event) override;
virtual void keyPressEvent(QKeyEvent *event) override;

private Q_SLOTS:
void indent();
Expand Down
4 changes: 2 additions & 2 deletions app/editreplacecurrentwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class ReplaceCurrentWidget : public QWidget
void hidden();

protected:
virtual void showEvent(QShowEvent *event);
virtual void keyPressEvent(QKeyEvent *event);
virtual void showEvent(QShowEvent *event) override;
virtual void keyPressEvent(QKeyEvent *event) override;

protected Q_SLOTS:
void hide();
Expand Down
4 changes: 2 additions & 2 deletions app/editreplacewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public Q_SLOTS:
void replace(const QString &text, const QString &replacement, QTextDocument::FindFlags flags);

protected:
virtual void showEvent(QShowEvent *event);
virtual void keyPressEvent(QKeyEvent *event);
virtual void showEvent(QShowEvent *event) override;
virtual void keyPressEvent(QKeyEvent *event) override;

protected Q_SLOTS:
void hide();
Expand Down
8 changes: 4 additions & 4 deletions app/linenumberwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class LineNumberWidget : public QWidget
Q_OBJECT
public:
explicit LineNumberWidget(TikzEditor *editor);
QSize sizeHint() const;
QSize sizeHint() const override;

protected:
virtual void paintEvent(QPaintEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *);
virtual void paintEvent(QPaintEvent *event) override;
virtual void mousePressEvent(QMouseEvent *event) override;
virtual void mouseReleaseEvent(QMouseEvent *) override;

private:
TikzEditor *m_editor;
Expand Down
2 changes: 1 addition & 1 deletion app/loghighlighter.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LogHighlighter : public QSyntaxHighlighter
/** Implements QSyntaxHighlighter::highlightBlock()
* @see QSyntaxHighlighter::highlightBlock()
*/
void highlightBlock(const QString &text);
void highlightBlock(const QString &text) override;

private:
struct LogHighlightingRule
Expand Down
2 changes: 1 addition & 1 deletion app/logtextedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class LogTextEdit : public QTextEdit
public:
explicit LogTextEdit(QWidget *parent = 0);
~LogTextEdit();
virtual QSize sizeHint() const;
virtual QSize sizeHint() const override;

public Q_SLOTS:
void updateLog(const QString &logText);
Expand Down
14 changes: 7 additions & 7 deletions app/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ class MainWindow : public QMainWindow, public MainWidget
MainWindow();
virtual ~MainWindow();

virtual QWidget *widget();
virtual QWidget *widget() override;
bool isDocumentModified() const;
QString tikzCode() const;
QUrl url() const;
QString tikzCode() const override;
QUrl url() const override;
void setLineNumber(int lineNumber);
int lineNumber() const;

Expand All @@ -99,11 +99,11 @@ public Q_SLOTS:

protected:
#ifdef KTIKZ_USE_KDE
bool queryClose();
void readProperties(const KConfigGroup &group);
void saveProperties(KConfigGroup &group);
bool queryClose() override;
void readProperties(const KConfigGroup &group) override;
void saveProperties(KConfigGroup &group) override;
#endif
void closeEvent(QCloseEvent *event);
void closeEvent(QCloseEvent *event) override;

private Q_SLOTS:
void init();
Expand Down
2 changes: 1 addition & 1 deletion app/tikzcommandwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TikzCommandWidget : public QWidget

public:
explicit TikzCommandWidget(QWidget *parent = 0);
virtual QSize sizeHint() const;
virtual QSize sizeHint() const override;
};

#endif
10 changes: 5 additions & 5 deletions app/tikzeditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ public Q_SLOTS:
void tabIndent(bool isUnindenting);

protected:
void paintEvent(QPaintEvent *event);
void keyPressEvent(QKeyEvent *event);
void focusInEvent(QFocusEvent *event);
void focusOutEvent(QFocusEvent *event);
void paintEvent(QPaintEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void focusInEvent(QFocusEvent *event) override;
void focusOutEvent(QFocusEvent *event) override;
int lineNumberAreaWidth();
void resizeEvent(QResizeEvent *event);
void resizeEvent(QResizeEvent *event) override;

private Q_SLOTS:
void highlightCurrentLine();
Expand Down
2 changes: 1 addition & 1 deletion app/tikzeditorhighlighter.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TikzHighlighter : public QSyntaxHighlighter
/** Implements QSyntaxHighlighter::highlightBlock()
* @see QSyntaxHighlighter::highlightBlock()
*/
void highlightBlock(const QString &text);
void highlightBlock(const QString &text) override;

private:
/// All highlighting rules with their formatting for easy iteration
Expand Down
12 changes: 6 additions & 6 deletions app/tikzeditorview.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TikzEditorView : public TikzEditorViewAbstract

QPlainTextEdit *editor();
QTextDocument *document();
QString text();
QString text() override;
#ifndef KTIKZ_USE_KDE
QMenu *editMenu();
QMenu *bookmarksMenu();
Expand All @@ -56,11 +56,11 @@ class TikzEditorView : public TikzEditorViewAbstract
void applySettings();
void setLine(const QString &line);
int lineNumber() const;
void updateCompleter(bool useCompletion, const QStringList &words);
void clear();
bool isEmpty();
bool isModified();
void setModified(bool value);
void updateCompleter(bool useCompletion, const QStringList &words) override;
void clear() override;
bool isEmpty() override;
bool isModified() override;
void setModified(bool value) override;

public Q_SLOTS:
void setPasteEnabled();
Expand Down
10 changes: 3 additions & 7 deletions app/tikzktexteditorcompletion.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,12 @@ class TikzKTextEditorCompletion : public KTextEditor::CodeCompletionModel,

void updateCompleter(bool useCompletion, const QStringList &words);

// bool shouldStartCompletion(KTextEditor::View *view, const QString &insertedText, bool
// userInsertion, const KTextEditor::Cursor &position) Q_DECL_OVERRIDE;
KTextEditor::Range completionRange(KTextEditor::View *view,
const KTextEditor::Cursor &position) Q_DECL_OVERRIDE;
// QString filterString(KTextEditor::View *view, const KTextEditor::Range &range, const
// KTextEditor::Cursor &position) Q_DECL_OVERRIDE;
const KTextEditor::Cursor &position) override;

void completionInvoked(KTextEditor::View *view, const KTextEditor::Range &range,
KTextEditor::CodeCompletionModel::InvocationType it) Q_DECL_OVERRIDE;
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
KTextEditor::CodeCompletionModel::InvocationType it) override;
QVariant data(const QModelIndex &index, int role) const override;

private:
void findMatches();
Expand Down
12 changes: 6 additions & 6 deletions app/tikzktexteditorview.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ class TikzKTextEditorView : public TikzEditorViewAbstract

KTextEditor::Document *editor();
KTextEditor::Document *document();
QString text();
QString text() override;
KTextEditor::View *view();

void updateCompleter(bool useCompletion, const QStringList &words);
void clear();
bool isEmpty();
bool isModified();
void setModified(bool value);
void updateCompleter(bool useCompletion, const QStringList &words) override;
void clear() override;
bool isEmpty() override;
bool isModified() override;
void setModified(bool value) override;

Q_SIGNALS:
void documentUrlChanged(const QUrl &url);
Expand Down
2 changes: 1 addition & 1 deletion app/usercommandeditdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class UserCommandEditDialog : public QDialog
Ui::UserCommandEditDialog ui;

public Q_SLOTS:
void accept();
void accept() override;

private Q_SLOTS:
void readSettings();
Expand Down
2 changes: 1 addition & 1 deletion common/templatewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TemplateWidget : public QWidget
void focusEditor();

protected:
void keyPressEvent(QKeyEvent *event);
void keyPressEvent(QKeyEvent *event) override;

private Q_SLOTS:
void selectTemplateFile();
Expand Down
12 changes: 6 additions & 6 deletions common/tikzpreview.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TikzPreview : public QGraphicsView
explicit TikzPreview(QWidget *parent = 0);
~TikzPreview();

virtual QSize sizeHint() const;
virtual QSize sizeHint() const override;
QList<QAction *> actions();
QToolBar *toolBar();
QImage renderToImage(double xres, double yres, int pageNumber);
Expand All @@ -67,11 +67,11 @@ public Q_SLOTS:
void generatePreview(Poppler::Document *tikzPdfDoc, qreal zoomFactor, int currentPage);

protected:
void contextMenuEvent(QContextMenuEvent *event);
void paintEvent(QPaintEvent *event);
void wheelEvent(QWheelEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void contextMenuEvent(QContextMenuEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void wheelEvent(QWheelEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;

private Q_SLOTS:
void setZoomFactor(qreal zoomFactor);
Expand Down
2 changes: 1 addition & 1 deletion common/tikzpreviewmessagewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TikzPreviewMessageWidget : public QFrame
explicit TikzPreviewMessageWidget(QWidget *parent = 0);
~TikzPreviewMessageWidget();

virtual QSize sizeHint() const;
virtual QSize sizeHint() const override;
void setText(const QString &message, PixmapVisibility pixmapVisibility = PixmapNotVisible);

private:
Expand Down
2 changes: 1 addition & 1 deletion common/utils/printpreviewdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PrintPreviewDialog : public QDialog
public:
explicit PrintPreviewDialog(QPrinter *printer, QWidget *parent = 0);

void setVisible(bool visible);
void setVisible(bool visible) override;

Q_SIGNALS:
void paintRequested(QPrinter *printer);
Expand Down
12 changes: 6 additions & 6 deletions part/part.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ class Part : public KParts::ReadOnlyPart, public MainWidget

public:
explicit Part(QWidget *parentWidget, QObject *parent, const QVariantList &args);
virtual ~Part() Q_DECL_OVERRIDE;
virtual ~Part() override;

static KAboutData *createAboutData();
virtual QWidget *widget();
QString tikzCode() const;
QUrl url() const;
virtual QWidget *widget() override;
QString tikzCode() const override;
QUrl url() const override;

protected:
/** Reimplemented from KParts::PartBase. */
bool openFile() Q_DECL_OVERRIDE;
bool closeUrl();
bool openFile() override;
bool closeUrl() override;

private slots:
void showAboutDialog();
Expand Down