Fix warnings about marking functions override
Change-Id: I7737469d3016f9522e497b443edd864fa4d714cc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
346d30144a
commit
d0ba43f0f5
@ -128,11 +128,13 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int iterationCount) {
|
||||
void draw(QPainter *p, const QRect &rect, int iterationCount) override
|
||||
{
|
||||
p->fillRect(rect, randomColor(iterationCount));
|
||||
}
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
return QString::fromLatin1("fillRect(%1)").arg(m_size.width());
|
||||
}
|
||||
};
|
||||
@ -154,11 +156,10 @@ public:
|
||||
m_brush = QBrush(m_content);
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int) {
|
||||
p->fillRect(rect, m_brush);
|
||||
}
|
||||
void draw(QPainter *p, const QRect &rect, int) override { p->fillRect(rect, m_brush); }
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
return QString::fromLatin1("fillRect with image(%1)").arg(m_size.width());
|
||||
}
|
||||
|
||||
@ -176,17 +177,16 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void begin(QPainter *p, int) {
|
||||
void begin(QPainter *p, int) override
|
||||
{
|
||||
p->setPen(Qt::NoPen);
|
||||
p->setBrush(randomColor(m_size.width()));
|
||||
}
|
||||
|
||||
void draw(QPainter *p, const QRect &rect, int) override { p->drawRect(rect); }
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int) {
|
||||
p->drawRect(rect);
|
||||
}
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
return QString::fromLatin1("drawRect(%1)").arg(m_size.width());
|
||||
}
|
||||
};
|
||||
@ -200,17 +200,16 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void begin(QPainter *p, int) {
|
||||
p->setPen(Qt::NoPen);
|
||||
}
|
||||
void begin(QPainter *p, int) override { p->setPen(Qt::NoPen); }
|
||||
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int i) {
|
||||
void draw(QPainter *p, const QRect &rect, int i) override
|
||||
{
|
||||
p->setBrush(randomColor(i));
|
||||
p->drawRect(rect);
|
||||
}
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
return QString::fromLatin1("drawRect with brushchange(%1)").arg(m_size.width());
|
||||
}
|
||||
};
|
||||
@ -224,16 +223,19 @@ public:
|
||||
m_roundness = size / 4.;
|
||||
}
|
||||
|
||||
virtual void begin(QPainter *p, int) {
|
||||
void begin(QPainter *p, int) override
|
||||
{
|
||||
p->setPen(Qt::NoPen);
|
||||
p->setBrush(Qt::red);
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int) {
|
||||
void draw(QPainter *p, const QRect &rect, int) override
|
||||
{
|
||||
p->drawRoundedRect(rect, m_roundness, m_roundness);
|
||||
}
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
return QString::fromLatin1("drawRoundedRect(%1)").arg(m_size.width());
|
||||
}
|
||||
|
||||
@ -262,7 +264,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void begin(QPainter *p, int) {
|
||||
void begin(QPainter *p, int) override
|
||||
{
|
||||
if (m_type & Stroked)
|
||||
p->setPen(Qt::black);
|
||||
else
|
||||
@ -274,7 +277,8 @@ public:
|
||||
p->setBrush(Qt::NoBrush);
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int) {
|
||||
void draw(QPainter *p, const QRect &rect, int) override
|
||||
{
|
||||
switch (m_type & Shapes) {
|
||||
case ArcShape:
|
||||
p->drawArc(rect, 45*16, 120*16);
|
||||
@ -291,7 +295,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
QString fillStroke;
|
||||
|
||||
if ((m_type & (Stroked|Filled)) == (Stroked|Filled)) {
|
||||
@ -336,18 +341,18 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void begin(QPainter *p, int) {
|
||||
p->scale(m_scale, m_scale);
|
||||
}
|
||||
void begin(QPainter *p, int) override { p->scale(m_scale, m_scale); }
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int) {
|
||||
void draw(QPainter *p, const QRect &rect, int) override
|
||||
{
|
||||
if (m_as_pixmap)
|
||||
p->drawPixmap(rect.topLeft(), m_pixmap);
|
||||
else
|
||||
p->drawImage(rect.topLeft(), m_image);
|
||||
}
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
return QString::fromLatin1("draw%4(%1) at scale=%2, depth=%3")
|
||||
.arg(m_size.width())
|
||||
.arg(m_scale)
|
||||
@ -382,7 +387,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int) {
|
||||
void draw(QPainter *p, const QRect &rect, int) override
|
||||
{
|
||||
QTransform oldTransform = p->transform();
|
||||
p->translate(0.5 * rect.width() + rect.left(), 0.5 * rect.height() + rect.top());
|
||||
p->shear(0.25, 0.0);
|
||||
@ -394,7 +400,8 @@ public:
|
||||
p->setTransform(oldTransform);
|
||||
}
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
return QString::fromLatin1("draw%3(%1) w/transform, depth=%2")
|
||||
.arg(m_size.width())
|
||||
.arg(m_as_pixmap ? m_pixmap.depth() : m_image.depth())
|
||||
@ -428,14 +435,16 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int) {
|
||||
void draw(QPainter *p, const QRect &rect, int) override
|
||||
{
|
||||
if (m_as_pixmap)
|
||||
p->drawPixmap(rect.topLeft(), m_pixmap);
|
||||
else
|
||||
p->drawImage(rect.topLeft(), m_image);
|
||||
}
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
return QString::fromLatin1("draw%2(%1), depth=%3")
|
||||
.arg(m_size.width())
|
||||
.arg(m_type)
|
||||
@ -469,7 +478,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void begin(QPainter *p, int iterations) {
|
||||
void begin(QPainter *p, int iterations) override
|
||||
{
|
||||
m_staticTexts.clear();
|
||||
m_currentStaticText = 0;
|
||||
m_pixmaps.clear();
|
||||
@ -557,7 +567,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int)
|
||||
void draw(QPainter *p, const QRect &rect, int) override
|
||||
{
|
||||
switch (m_mode) {
|
||||
case PainterMode:
|
||||
@ -589,7 +599,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
int letters = m_text.length();
|
||||
int lines = m_text.count('\n');
|
||||
if (lines == 0)
|
||||
@ -644,7 +655,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual void begin(QPainter *p, int) {
|
||||
void begin(QPainter *p, int) override
|
||||
{
|
||||
QRect m_bounds = QRect(0,0,p->device()->width(), p->device()->height());
|
||||
p->setPen(Qt::NoPen);
|
||||
p->setBrush(Qt::red);
|
||||
@ -706,11 +718,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int) {
|
||||
p->drawRect(rect);
|
||||
}
|
||||
void draw(QPainter *p, const QRect &rect, int) override { p->drawRect(rect); }
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
QString namedType;
|
||||
switch (m_type) {
|
||||
case RectClip:
|
||||
@ -764,7 +775,8 @@ public:
|
||||
|
||||
}
|
||||
|
||||
virtual void draw(QPainter *p, const QRect &rect, int) {
|
||||
void draw(QPainter *p, const QRect &rect, int) override
|
||||
{
|
||||
switch (m_type) {
|
||||
case Horizontal_Integer:
|
||||
p->drawLine(QLine(rect.x(), rect.y(), rect.x() + m_length, rect.y()));
|
||||
@ -787,7 +799,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual QString name() const {
|
||||
QString name() const override
|
||||
{
|
||||
const char *names[] = {
|
||||
"Hor_I",
|
||||
"Diag_I",
|
||||
|
@ -39,7 +39,7 @@ class BenchWidget : public QWidget
|
||||
public:
|
||||
BenchWidget(Benchmark *benchmark);
|
||||
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
bool done() const { return m_done; }
|
||||
qreal result() const { return m_result; }
|
||||
|
@ -56,7 +56,7 @@ class RectWidget : public QGraphicsWidget
|
||||
public:
|
||||
RectWidget(QGraphicsItem *parent = nullptr) : QGraphicsWidget(parent){}
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
|
||||
{
|
||||
Q_UNUSED(option);
|
||||
Q_UNUSED(widget);
|
||||
|
@ -49,7 +49,7 @@ class RectWidget : public QGraphicsWidget
|
||||
public:
|
||||
RectWidget(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = { }) : QGraphicsWidget(parent, wFlags), setGeometryCalls(0) {}
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
|
||||
{
|
||||
Q_UNUSED(option);
|
||||
Q_UNUSED(widget);
|
||||
@ -58,7 +58,7 @@ public:
|
||||
painter->drawLine(rect().bottomLeft(), rect().topRight());
|
||||
}
|
||||
|
||||
void setGeometry(const QRectF &rect)
|
||||
void setGeometry(const QRectF &rect) override
|
||||
{
|
||||
//qDebug() << "setGeometry():" << this->data(0).toString();
|
||||
setGeometryCalls->insert(this, rect);
|
||||
|
@ -47,7 +47,7 @@ private slots:
|
||||
struct MySquareWidget : public QGraphicsWidget
|
||||
{
|
||||
MySquareWidget() {}
|
||||
virtual QSizeF sizeHint ( Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override
|
||||
{
|
||||
if (which != Qt::PreferredSize)
|
||||
return QGraphicsWidget::sizeHint(which, constraint);
|
||||
|
@ -37,14 +37,14 @@ class Chip : public QGraphicsItem
|
||||
public:
|
||||
Chip(const QColor &color, int x, int y);
|
||||
|
||||
QRectF boundingRect() const;
|
||||
QPainterPath shape() const;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget);
|
||||
QRectF boundingRect() const override;
|
||||
QPainterPath shape() const override;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) override;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
|
||||
|
||||
private:
|
||||
int x, y;
|
||||
|
@ -54,8 +54,8 @@ public:
|
||||
void setOperation(Operation operation);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void timerEvent(QTimerEvent *event);
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void timerEvent(QTimerEvent *event) override;
|
||||
|
||||
private:
|
||||
void populateScene();
|
||||
|
@ -81,14 +81,14 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event)
|
||||
void paintEvent(QPaintEvent *event) override
|
||||
{
|
||||
QGraphicsView::paintEvent(event);
|
||||
if (waiting)
|
||||
eventLoop.exit();
|
||||
}
|
||||
|
||||
void timerEvent(QTimerEvent *event)
|
||||
void timerEvent(QTimerEvent *event) override
|
||||
{
|
||||
if (event->timerId() == timerId)
|
||||
eventLoop.exit();
|
||||
@ -479,7 +479,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
void advance(int i)
|
||||
void advance(int i) override
|
||||
{
|
||||
if (!i)
|
||||
return;
|
||||
@ -587,7 +587,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
void advance(int i)
|
||||
void advance(int i) override
|
||||
{
|
||||
if (!i)
|
||||
return;
|
||||
@ -693,14 +693,15 @@ public:
|
||||
yspeed = y;
|
||||
}
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0)
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
QWidget *widget = 0) override
|
||||
{
|
||||
QGraphicsPixmapItem::paint(painter,option,widget);
|
||||
//We just want to wait, and we don't want to process the event loop with qWait
|
||||
QTest::qSleep(3);
|
||||
}
|
||||
protected:
|
||||
void advance(int i)
|
||||
void advance(int i) override
|
||||
{
|
||||
if (!i)
|
||||
return;
|
||||
@ -792,12 +793,13 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0)
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
QWidget *widget = 0) override
|
||||
{
|
||||
QGraphicsPixmapItem::paint(painter,option,widget);
|
||||
}
|
||||
protected:
|
||||
void advance(int i)
|
||||
void advance(int i) override
|
||||
{
|
||||
Q_UNUSED(i);
|
||||
if (partial)
|
||||
|
@ -45,11 +45,11 @@ public:
|
||||
row_count(rows),
|
||||
column_count(columns) {}
|
||||
|
||||
int rowCount(const QModelIndex& = QModelIndex()) const { return row_count; }
|
||||
int columnCount(const QModelIndex& = QModelIndex()) const { return column_count; }
|
||||
int rowCount(const QModelIndex & = QModelIndex()) const override { return row_count; }
|
||||
int columnCount(const QModelIndex & = QModelIndex()) const override { return column_count; }
|
||||
bool isEditable(const QModelIndex &) const { return true; }
|
||||
|
||||
QVariant data(const QModelIndex &idx, int role) const
|
||||
QVariant data(const QModelIndex &idx, int role) const override
|
||||
{
|
||||
if (!idx.isValid() || idx.row() >= row_count || idx.column() >= column_count) {
|
||||
qWarning() << "Invalid modelIndex [%d,%d,%p]" << idx;
|
||||
@ -62,7 +62,7 @@ public:
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
bool insertRows(int start, int count, const QModelIndex &parent = QModelIndex())
|
||||
bool insertRows(int start, int count, const QModelIndex &parent = QModelIndex()) override
|
||||
{
|
||||
if (start < 0 || start > row_count)
|
||||
return false;
|
||||
@ -73,7 +73,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool removeRows(int start, int count, const QModelIndex &parent = QModelIndex())
|
||||
bool removeRows(int start, int count, const QModelIndex &parent = QModelIndex()) override
|
||||
{
|
||||
if (start < 0 || start >= row_count || row_count < count)
|
||||
return false;
|
||||
@ -84,7 +84,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool insertColumns(int start, int count, const QModelIndex &parent = QModelIndex())
|
||||
bool insertColumns(int start, int count, const QModelIndex &parent = QModelIndex()) override
|
||||
{
|
||||
if (start < 0 || start > column_count)
|
||||
return false;
|
||||
@ -95,7 +95,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool removeColumns(int start, int count, const QModelIndex &parent = QModelIndex())
|
||||
bool removeColumns(int start, int count, const QModelIndex &parent = QModelIndex()) override
|
||||
{
|
||||
if (start < 0 || start >= column_count || column_count < count)
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user