Commit 0171d3e9 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECL_OVERRIDE

parent 3985e63f
......@@ -265,7 +265,7 @@ public:
}
protected:
virtual void paintEvent(QPaintEvent*)
void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE
{
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
......
......@@ -73,12 +73,12 @@ public:
, mMode(Contains)
{}
virtual bool needsSemanticInfo() const
bool needsSemanticInfo() const Q_DECL_OVERRIDE
{
return false;
}
virtual bool acceptsIndex(const QModelIndex& index) const
bool acceptsIndex(const QModelIndex& index) const Q_DECL_OVERRIDE
{
if (mText.isEmpty()) {
return true;
......@@ -141,12 +141,12 @@ public:
, mMode(GreaterOrEqual)
{}
virtual bool needsSemanticInfo() const
bool needsSemanticInfo() const Q_DECL_OVERRIDE
{
return false;
}
virtual bool acceptsIndex(const QModelIndex& index) const
bool acceptsIndex(const QModelIndex& index) const Q_DECL_OVERRIDE
{
if (!mDate.isValid()) {
return true;
......@@ -215,12 +215,12 @@ public:
, mRating(0)
, mMode(GreaterOrEqual) {}
virtual bool needsSemanticInfo() const
bool needsSemanticInfo() const Q_DECL_OVERRIDE
{
return true;
}
virtual bool acceptsIndex(const QModelIndex& index) const
bool acceptsIndex(const QModelIndex& index) const Q_DECL_OVERRIDE
{
SemanticInfo info = model()->semanticInfoForSourceIndex(index);
switch (mMode) {
......@@ -278,12 +278,12 @@ public:
, mWantMatchingTag(true)
{}
virtual bool needsSemanticInfo() const
bool needsSemanticInfo() const Q_DECL_OVERRIDE
{
return true;
}
virtual bool acceptsIndex(const QModelIndex& index) const
bool acceptsIndex(const QModelIndex& index) const Q_DECL_OVERRIDE
{
if (mTag.isEmpty()) {
return true;
......
......@@ -52,7 +52,7 @@ public:
{}
protected:
void dragEnterEvent(QDragEnterEvent* event)
void dragEnterEvent(QDragEnterEvent* event) Q_DECL_OVERRIDE
{
QAbstractItemView::dragEnterEvent(event);
setDirtyRegion(mDropRect);
......@@ -61,7 +61,7 @@ protected:
}
}
void dragMoveEvent(QDragMoveEvent* event)
void dragMoveEvent(QDragMoveEvent* event) Q_DECL_OVERRIDE
{
QAbstractItemView::dragMoveEvent(event);
......@@ -80,7 +80,7 @@ protected:
}
}
void dropEvent(QDropEvent* event)
void dropEvent(QDropEvent* event) Q_DECL_OVERRIDE
{
const QList<QUrl> urlList = KUrlMimeData::urlsFromMimeData(event->mimeData());
const QModelIndex index = indexAt(event->pos());
......
......@@ -51,7 +51,7 @@ public:
{}
protected:
virtual 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
{
QStyleOptionViewItem option = _option;
if (!index.parent().isValid()) {
......@@ -64,7 +64,7 @@ protected:
}
}
virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const Q_DECL_OVERRIDE
{
QSize sh = QStyledItemDelegate::sizeHint(option, index);
if (!index.parent().isValid()) {
......@@ -85,7 +85,7 @@ public:
{}
protected:
virtual void rowsInserted(const QModelIndex& parent, int start, int end)
void rowsInserted(const QModelIndex& parent, int start, int end) Q_DECL_OVERRIDE
{
QTreeView::rowsInserted(parent, start, end);
if (!parent.isValid()) {
......@@ -95,7 +95,7 @@ protected:
}
}
virtual void reset()
void reset() Q_DECL_OVERRIDE
{
QTreeView::reset();
if (model()) {
......
......@@ -118,14 +118,14 @@ public:
setSizePolicy(policy);
}
QSize sizeHint() const
QSize sizeHint() const Q_DECL_OVERRIDE
{
int width = 150;
int height = heightForWidth(width);
return QSize(width, height);
}
int heightForWidth(int w) const
int heightForWidth(int w) const Q_DECL_OVERRIDE
{
int height = 0;
Q_FOREACH(Row* row, mRows) {
......@@ -175,13 +175,13 @@ public:
}
protected:
void showEvent(QShowEvent* event)
void showEvent(QShowEvent* event) Q_DECL_OVERRIDE
{
QWidget::showEvent(event);
layoutRows();
}
void resizeEvent(QResizeEvent* event)
void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE
{
QWidget::resizeEvent(event);
layoutRows();
......
......@@ -101,7 +101,7 @@ public:
setMinimumSize(pix.size());
}
void paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*)
void paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*) Q_DECL_OVERRIDE
{
painter->drawPixmap(
(size().width() - mPix.width()) / 2,
......
......@@ -45,13 +45,13 @@ namespace Gwenview
class SideBarButton : public QToolButton
{
protected:
virtual void paintEvent(QPaintEvent* event)
void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE
{
forceIcon();
QToolButton::paintEvent(event);
}
virtual QSize sizeHint() const
QSize sizeHint() const Q_DECL_OVERRIDE
{
const_cast<SideBarButton*>(this)->forceIcon();
return QToolButton::sizeHint();
......
......@@ -42,7 +42,7 @@ public:
void clear();
protected:
virtual void paintEvent(QPaintEvent*);
void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
private:
SideBarGroupPrivate* const d;
......@@ -77,7 +77,7 @@ public:
QString currentPage() const;
void setCurrentPage(const QString& name);
virtual QSize sizeHint() const;
QSize sizeHint() const Q_DECL_OVERRIDE;
private:
SideBarPrivate* const d;
......
......@@ -35,7 +35,7 @@ public:
{}
protected:
virtual void paintEvent(QPaintEvent* event)
void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE
{
QSplitterHandle::paintEvent(event);
......@@ -65,7 +65,7 @@ public:
}
protected:
virtual QSplitterHandle* createHandle()
QSplitterHandle* createHandle() Q_DECL_OVERRIDE
{
return new SplitterHandle(orientation(), this);
}
......
......@@ -61,15 +61,15 @@ public:
: AbstractThumbnailViewHelper(parent)
{}
virtual void showContextMenu(QWidget*)
void showContextMenu(QWidget*) Q_DECL_OVERRIDE
{
}
virtual void showMenuForUrlDroppedOnViewport(QWidget*, const QList<QUrl>&)
void showMenuForUrlDroppedOnViewport(QWidget*, const QList<QUrl>&) Q_DECL_OVERRIDE
{
}
virtual void showMenuForUrlDroppedOnDir(QWidget*, const QList<QUrl>&, const QUrl&)
void showMenuForUrlDroppedOnDir(QWidget*, const QList<QUrl>&, const QUrl&) Q_DECL_OVERRIDE
{
}
};
......
......@@ -74,7 +74,7 @@ public:
int statusBarHeight() const;
virtual QSize sizeHint() const;
QSize sizeHint() const Q_DECL_OVERRIDE;
/**
* Returns the url of the current document, or an invalid url if unknown
......
......@@ -40,7 +40,7 @@ public:
ImportDialog();
~ImportDialog();
virtual QSize sizeHint() const;
QSize sizeHint() const Q_DECL_OVERRIDE;
public Q_SLOTS:
void setSourceUrl(const QUrl&, const QString& deviceUdi);
......
......@@ -66,13 +66,13 @@ public:
: AbstractThumbnailViewHelper(parent)
{}
void showContextMenu(QWidget*)
void showContextMenu(QWidget*) Q_DECL_OVERRIDE
{}
void showMenuForUrlDroppedOnViewport(QWidget*, const QList<QUrl>&)
void showMenuForUrlDroppedOnViewport(QWidget*, const QList<QUrl>&) Q_DECL_OVERRIDE
{}
void showMenuForUrlDroppedOnDir(QWidget*, const QList<QUrl>&, const QUrl&)
void showMenuForUrlDroppedOnDir(QWidget*, const QList<QUrl>&, const QUrl&) Q_DECL_OVERRIDE
{}
};
......@@ -366,7 +366,7 @@ public:
{}
bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const // reimp
{
Q_DECL_OVERRIDE {
if (sourceParent.isValid()) {
return true;
}
......@@ -376,7 +376,7 @@ public:
}
QVariant data(const QModelIndex& index, int role) const // reimp
{
Q_DECL_OVERRIDE {
if (index.parent().isValid()) {
return QSortFilterProxyModel::data(index, role);
}
......
......@@ -46,7 +46,7 @@ public:
delete mOp;
}
virtual void undo()
void undo() Q_DECL_OVERRIDE
{
mOp->undo();
}
......
......@@ -95,7 +95,7 @@ public:
}
protected:
void callMethod()
void callMethod() Q_DECL_OVERRIDE
{
(mReceiver->*mMethod)(mArg);
}
......
......@@ -43,7 +43,7 @@ public:
: mRect(rect)
{}
virtual void threadedStart()
void threadedStart() Q_DECL_OVERRIDE
{
if (!checkDocumentEditor()) {
return;
......
......@@ -186,7 +186,7 @@ struct VideoViewAdapterPrivate
class DoubleClickableProxyWidget : public QGraphicsProxyWidget
{
protected:
void mousePressEvent(QGraphicsSceneMouseEvent* event)
void mousePressEvent(QGraphicsSceneMouseEvent* event) Q_DECL_OVERRIDE
{
QGraphicsWidget::mousePressEvent(event);
}
......
......@@ -47,7 +47,7 @@ public:
void setAutoHidingEnabled(bool);
virtual QSize sizeHint() const;
QSize sizeHint() const Q_DECL_OVERRIDE;
public Q_SLOTS:
void slideIn();
......@@ -59,7 +59,7 @@ private Q_SLOTS:
void delayedInstallEventFilter();
protected:
virtual bool eventFilter(QObject*, QEvent*);
bool eventFilter(QObject*, QEvent*) Q_DECL_OVERRIDE;
private:
FullScreenBarPrivate* const d;
......
......@@ -139,7 +139,7 @@ private:
setData(i18n("Last visited: %1", date), Qt::ToolTipRole);
}
bool operator<(const QStandardItem& other) const {
bool operator<(const QStandardItem& other) const Q_DECL_OVERRIDE {
return mDateTime > static_cast<const HistoryItem*>(&other)->mDateTime;
}
};
......
......@@ -49,7 +49,7 @@ public:
: mRectF(rectF)
{}
void threadedStart()
void threadedStart() Q_DECL_OVERRIDE
{
if (!checkDocumentEditor()) {
return;
......
......@@ -49,7 +49,7 @@ public:
: mSize(size)
{}
virtual void threadedStart()
void threadedStart() Q_DECL_OVERRIDE
{
if (!checkDocumentEditor()) {
return;
......
......@@ -72,7 +72,7 @@ public:
}
protected:
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const
bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const Q_DECL_OVERRIDE
{
QModelIndex sourceIndex = sourceModel()->index(sourceRow, 0, sourceParent);
SemanticInfoTag tag = sourceIndex.data(TagModel::TagRole).toString();
......@@ -97,7 +97,7 @@ public:
{}
protected:
virtual bool eventFilter(QObject*, QEvent* event)
bool eventFilter(QObject*, QEvent* event) Q_DECL_OVERRIDE
{
if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
......
......@@ -73,9 +73,9 @@ public:
void setRowCount(int);
protected:
virtual void resizeEvent(QResizeEvent * event);
virtual void wheelEvent(QWheelEvent* event);
virtual void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
void resizeEvent(QResizeEvent * event) Q_DECL_OVERRIDE;
void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE;
void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) Q_DECL_OVERRIDE;
private Q_SLOTS:
void slotFrameChanged(int);
......
......@@ -58,7 +58,7 @@ public:
int verticalMargin() const;
protected:
bool eventFilter(QObject*, QEvent*);
bool eventFilter(QObject*, QEvent*) Q_DECL_OVERRIDE;
private:
WidgetFloaterPrivate* const d;
......
......@@ -97,7 +97,7 @@ void ContextManagerTest::testInvalidDirUrl()
setAutoErrorHandlingEnabled(false, 0);
}
bool openUrl(const QUrl &url, OpenUrlFlags flags = NoFlags)
bool openUrl(const QUrl &url, OpenUrlFlags flags = NoFlags) Q_DECL_OVERRIDE
{
mOpenUrlCalled = true;
return KDirLister::openUrl(url, flags);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment