Commit 685fa121 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECLARE_OVERRIDE

parent fb1ee5ef
......@@ -35,8 +35,8 @@ public:
GasCreator(const QString& className, WorldModel* worldModel, WorldScene* worldScene)
: ItemCreator(className, worldModel, worldScene) {}
bool sceneEvent(QEvent* event);
void start();
bool sceneEvent(QEvent* event) Q_DECL_OVERRIDE;
void start() Q_DECL_OVERRIDE;
protected:
StepCore::Vector2d _topLeft;
......@@ -56,24 +56,24 @@ public:
protected:
StepCore::Gas* gas() const;
StepCore::Vector2d value();
void setValue(const StepCore::Vector2d& value);
StepCore::Vector2d value() Q_DECL_OVERRIDE;
void setValue(const StepCore::Vector2d& value) Q_DECL_OVERRIDE;
};
class GasGraphicsItem: public StepGraphicsItem {
public:
GasGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
void viewScaleChanged();
void stateChanged();
void worldDataChanged(bool);
void viewScaleChanged() Q_DECL_OVERRIDE;
void stateChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool) Q_DECL_OVERRIDE;
protected:
void mouseSetPos(const QPointF& pos, const QPointF&, MovingState);
OnHoverHandlerGraphicsItem* createOnHoverHandler(const QPointF& pos);
void mouseSetPos(const QPointF& pos, const QPointF&, MovingState) Q_DECL_OVERRIDE;
OnHoverHandlerGraphicsItem* createOnHoverHandler(const QPointF& pos) Q_DECL_OVERRIDE;
StepCore::Gas* gas() const;
//ArrowHandlerGraphicsItem *_centerHandler;
......@@ -94,7 +94,7 @@ public:
GasMenuHandler(StepCore::Object* object, WorldModel* worldModel, QObject* parent)
: ItemMenuHandler(object, worldModel, parent) {}
void populateMenu(QMenu* menu, KActionCollection* actions);
void populateMenu(QMenu* menu, KActionCollection* actions) Q_DECL_OVERRIDE;
public slots:
void createGasParticles();
......
......@@ -53,7 +53,7 @@ protected slots:
void syncSelection(bool checked = true);
protected:
void showEvent(QShowEvent* event);
void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
void updateSyncSelection();
WorldModel* _worldModel;
......
......@@ -50,13 +50,13 @@ public:
setProperty("isSeparator", true);
}
QSize sizeHint() const {
QSize sizeHint() const Q_DECL_OVERRIDE {
QStyleOption opt; opt.initFrom(this);
const int extent = style()->pixelMetric(QStyle::PM_ToolBarSeparatorExtent, &opt, parentWidget());
return QSize(extent, extent);
}
void paintEvent(QPaintEvent *) {
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE {
QPainter p(this); QStyleOption opt; opt.initFrom(this);
style()->drawPrimitive(QStyle::PE_IndicatorToolBarSeparator, &opt, &p, parentWidget());
}
......@@ -70,19 +70,19 @@ public:
PaletteLayout(int spacing = -1) { setSpacing(spacing); resetCache(); }
~PaletteLayout() { QLayoutItem *item; while ((item = takeAt(0))) delete item; }
void addItem(QLayoutItem *item) { itemList.append(item); resetCache(); }
int count() const { return itemList.size(); }
QLayoutItem* itemAt(int index) const { return itemList.value(index); }
QLayoutItem* takeAt(int index) {
void addItem(QLayoutItem *item) Q_DECL_OVERRIDE { itemList.append(item); resetCache(); }
int count() const Q_DECL_OVERRIDE { return itemList.size(); }
QLayoutItem* itemAt(int index) const Q_DECL_OVERRIDE { return itemList.value(index); }
QLayoutItem* takeAt(int index) Q_DECL_OVERRIDE {
resetCache();
if (index >= 0 && index < itemList.size()) return itemList.takeAt(index);
else return 0;
}
Qt::Orientations expandingDirections() const { return Qt::Vertical; }
bool hasHeightForWidth() const { return true; }
Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE { return Qt::Vertical; }
bool hasHeightForWidth() const Q_DECL_OVERRIDE { return true; }
int heightForWidth(int width) const {
int heightForWidth(int width) const Q_DECL_OVERRIDE {
if(isCachedHeightForWidth && cachedHeightForWidth.width() == width) {
return cachedHeightForWidth.height();
} else {
......@@ -93,13 +93,13 @@ public:
}
}
void setGeometry(const QRect &rect) {
void setGeometry(const QRect &rect) Q_DECL_OVERRIDE {
resetCache(); QLayout::setGeometry(rect); doLayout(rect, false);
}
QSize sizeHint() const { return minimumSize(); }
QSize sizeHint() const Q_DECL_OVERRIDE { return minimumSize(); }
QSize minimumSize() const {
QSize minimumSize() const Q_DECL_OVERRIDE {
if(isCachedMinimumSize) return cachedMinimumSize;
cachedMinimumSize = QSize();
QLayoutItem *item;
......@@ -112,7 +112,7 @@ public:
void setOneLine(bool b) { oneLine = b; invalidate(); }
bool isOneLine() const { return oneLine; }
void invalidate() { resetCache(); QLayout::invalidate(); }
void invalidate() Q_DECL_OVERRIDE { resetCache(); QLayout::invalidate(); }
protected:
void resetCache() { isCachedMinimumSize = false; isCachedHeightForWidth = false; }
......@@ -171,7 +171,7 @@ public:
PaletteScrollArea(QWidget* parent): QScrollArea(parent) {}
protected:
void resizeEvent(QResizeEvent* event) {
void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE {
if(widget() && widget()->layout()) {
QSize size(maximumViewportSize().width(),
widget()->layout()->heightForWidth(maximumViewportSize().width()));
......
......@@ -54,7 +54,7 @@ protected:
void createToolButton(QAction* action);
void createObjectAction(const StepCore::MetaObject* metaObject);
bool event(QEvent* event);
bool event(QEvent* event) Q_DECL_OVERRIDE;
WorldModel* _worldModel;
QScrollArea* _scrollArea;
......
......@@ -37,14 +37,14 @@ class AnchorGraphicsItem : public StepGraphicsItem
public:
AnchorGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
QPainterPath shape() const Q_DECL_OVERRIDE;
void viewScaleChanged();
void worldDataChanged(bool dynamicOnly);
void viewScaleChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool dynamicOnly) Q_DECL_OVERRIDE;
protected:
void mouseSetPos(const QPointF& pos, const QPointF&, MovingState movingState);
void mouseSetPos(const QPointF& pos, const QPointF&, MovingState movingState) Q_DECL_OVERRIDE;
StepCore::Anchor* anchor() const;
};
......@@ -63,14 +63,14 @@ class PinGraphicsItem: public StepGraphicsItem
public:
PinGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
QPainterPath shape() const Q_DECL_OVERRIDE;
void viewScaleChanged();
void worldDataChanged(bool dynamicOnly);
void viewScaleChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool dynamicOnly) Q_DECL_OVERRIDE;
protected:
void mouseSetPos(const QPointF& pos, const QPointF&, MovingState movingState);
void mouseSetPos(const QPointF& pos, const QPointF&, MovingState movingState) Q_DECL_OVERRIDE;
StepCore::Pin* pin() const;
};
......@@ -90,11 +90,11 @@ class StickHandlerGraphicsItem: public StepGraphicsItem
public:
StickHandlerGraphicsItem(StepCore::Item* item, WorldModel* worldModel,
QGraphicsItem* parent, int num);
void viewScaleChanged();
void worldDataChanged(bool);
void viewScaleChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool) Q_DECL_OVERRIDE;
protected:
void mouseSetPos(const QPointF& pos, const QPointF& diff, MovingState movingState);
void mouseSetPos(const QPointF& pos, const QPointF& diff, MovingState movingState) Q_DECL_OVERRIDE;
int _num;
};
......@@ -103,15 +103,15 @@ class StickGraphicsItem: public StepGraphicsItem
public:
StickGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
QPainterPath shape() const Q_DECL_OVERRIDE;
void viewScaleChanged();
void stateChanged();
void worldDataChanged(bool dynamicOnly);
void viewScaleChanged() Q_DECL_OVERRIDE;
void stateChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool dynamicOnly) Q_DECL_OVERRIDE;
protected:
void mouseSetPos(const QPointF& pos, const QPointF& diff, MovingState);
void mouseSetPos(const QPointF& pos, const QPointF& diff, MovingState) Q_DECL_OVERRIDE;
StepCore::Stick* stick() const { return static_cast<StepCore::Stick*>(_item); }
......
......@@ -99,7 +99,7 @@ protected slots:
protected:
void setupActions();
bool queryClose();
bool queryClose() Q_DECL_OVERRIDE;
bool maybeSave();
protected:
......
......@@ -40,7 +40,7 @@ class LinearMotorCreator: public ItemCreator
public:
LinearMotorCreator(const QString& className, WorldModel* worldModel, WorldScene* worldScene)
: ItemCreator(className, worldModel, worldScene) {}
bool sceneEvent(QEvent* event);
bool sceneEvent(QEvent* event) Q_DECL_OVERRIDE;
protected:
void tryAttach(const QPointF& pos);
......@@ -51,16 +51,16 @@ class LinearMotorGraphicsItem: public StepGraphicsItem
public:
LinearMotorGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
QPainterPath shape() const Q_DECL_OVERRIDE;
void viewScaleChanged();
void worldDataChanged(bool dynamicOnly);
void stateChanged();
void viewScaleChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool dynamicOnly) Q_DECL_OVERRIDE;
void stateChanged() Q_DECL_OVERRIDE;
protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
StepCore::LinearMotor* motor() const;
QPainterPath _path;
ArrowHandlerGraphicsItem* _forceHandler;
......@@ -75,7 +75,7 @@ class CircularMotorCreator: public ItemCreator
public:
CircularMotorCreator(const QString& className, WorldModel* worldModel, WorldScene* worldScene)
: ItemCreator(className, worldModel, worldScene) {}
bool sceneEvent(QEvent* event);
bool sceneEvent(QEvent* event) Q_DECL_OVERRIDE;
protected:
void tryAttach(const QPointF& pos);
......@@ -86,16 +86,16 @@ class CircularMotorGraphicsItem: public StepGraphicsItem
public:
CircularMotorGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
QPainterPath shape() const Q_DECL_OVERRIDE;
void viewScaleChanged();
void worldDataChanged(bool dynamicOnly);
void stateChanged();
void viewScaleChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool dynamicOnly) Q_DECL_OVERRIDE;
void stateChanged() Q_DECL_OVERRIDE;
protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
StepCore::CircularMotor* motor() const;
QPainterPath _path;
CircularArrowHandlerGraphicsItem* _torqueHandler;
......
......@@ -28,12 +28,12 @@ class ParticleGraphicsItem: public StepGraphicsItem {
public:
ParticleGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
void viewScaleChanged();
void stateChanged();
void worldDataChanged(bool);
void viewScaleChanged() Q_DECL_OVERRIDE;
void stateChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool) Q_DECL_OVERRIDE;
protected:
StepCore::Particle* particle() const {
......
......@@ -43,12 +43,12 @@ class RigidBodyGraphicsItem : public StepGraphicsItem
public:
RigidBodyGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
void viewScaleChanged();
void stateChanged();
void worldDataChanged(bool dynamicOnly);
void viewScaleChanged() Q_DECL_OVERRIDE;
void stateChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool dynamicOnly) Q_DECL_OVERRIDE;
protected:
StepCore::RigidBody* rigidBody() const;
......@@ -67,8 +67,8 @@ class DiskCreator: public ItemCreator
public:
DiskCreator(const QString& className, WorldModel* worldModel, WorldScene* worldScene)
: ItemCreator(className, worldModel, worldScene) {}
bool sceneEvent(QEvent* event);
void start();
bool sceneEvent(QEvent* event) Q_DECL_OVERRIDE;
void start() Q_DECL_OVERRIDE;
};
class DiskVertexHandlerGraphicsItem: public OnHoverHandlerGraphicsItem
......@@ -82,18 +82,18 @@ public:
protected:
StepCore::Disk* disk() const;
StepCore::Vector2d value();
void setValue(const StepCore::Vector2d& value);
StepCore::Vector2d value() Q_DECL_OVERRIDE;
void setValue(const StepCore::Vector2d& value) Q_DECL_OVERRIDE;
};
class DiskGraphicsItem: public RigidBodyGraphicsItem
{
public:
DiskGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
void viewScaleChanged();
void viewScaleChanged() Q_DECL_OVERRIDE;
protected:
OnHoverHandlerGraphicsItem* createOnHoverHandler(const QPointF& pos);
OnHoverHandlerGraphicsItem* createOnHoverHandler(const QPointF& pos) Q_DECL_OVERRIDE;
StepCore::Disk* disk() const;
};
......@@ -103,7 +103,7 @@ class BasePolygonGraphicsItem: public RigidBodyGraphicsItem
{
public:
BasePolygonGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
void viewScaleChanged();
void viewScaleChanged() Q_DECL_OVERRIDE;
protected:
StepCore::BasePolygon* basePolygon() const;
......@@ -116,8 +116,8 @@ class BoxCreator: public ItemCreator
public:
BoxCreator(const QString& className, WorldModel* worldModel, WorldScene* worldScene)
: ItemCreator(className, worldModel, worldScene) {}
bool sceneEvent(QEvent* event);
void start();
bool sceneEvent(QEvent* event) Q_DECL_OVERRIDE;
void start() Q_DECL_OVERRIDE;
protected:
StepCore::Vector2d _topLeft;
......@@ -137,8 +137,8 @@ public:
protected:
StepCore::Box* box() const;
StepCore::Vector2d value();
void setValue(const StepCore::Vector2d& value);
StepCore::Vector2d value() Q_DECL_OVERRIDE;
void setValue(const StepCore::Vector2d& value) Q_DECL_OVERRIDE;
};
class BoxGraphicsItem: public BasePolygonGraphicsItem
......@@ -148,7 +148,7 @@ public:
: BasePolygonGraphicsItem(item, worldModel) {}
protected:
OnHoverHandlerGraphicsItem* createOnHoverHandler(const QPointF& pos);
OnHoverHandlerGraphicsItem* createOnHoverHandler(const QPointF& pos) Q_DECL_OVERRIDE;
};
/////////////////////////////////////////////////////////////////////////////////////////
......@@ -158,8 +158,8 @@ class PolygonCreator: public ItemCreator
public:
PolygonCreator(const QString& className, WorldModel* worldModel, WorldScene* worldScene)
: ItemCreator(className, worldModel, worldScene) {}
bool sceneEvent(QEvent* event);
void start();
bool sceneEvent(QEvent* event) Q_DECL_OVERRIDE;
void start() Q_DECL_OVERRIDE;
protected:
void fixCenterOfMass();
......@@ -177,8 +177,8 @@ public:
protected:
StepCore::Polygon* polygon() const;
StepCore::Vector2d value();
void setValue(const StepCore::Vector2d& value);
StepCore::Vector2d value() Q_DECL_OVERRIDE;
void setValue(const StepCore::Vector2d& value) Q_DECL_OVERRIDE;
};
class PolygonGraphicsItem: public BasePolygonGraphicsItem
......@@ -191,7 +191,7 @@ public:
int vertexNum, const StepCore::Vector2d& value);
protected:
OnHoverHandlerGraphicsItem* createOnHoverHandler(const QPointF& pos);
OnHoverHandlerGraphicsItem* createOnHoverHandler(const QPointF& pos) Q_DECL_OVERRIDE;
StepCore::Polygon* polygon() const;
};
......
......@@ -45,16 +45,16 @@ class PropertiesBrowserModel: public QAbstractItemModel
public:
PropertiesBrowserModel(WorldModel* worldModel, QObject* parent = 0);
QVariant data(const QModelIndex &index, int role) const;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &index) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
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;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
Qt::ItemFlags flags(const QModelIndex &index) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_OVERRIDE;
void setObject(StepCore::Object* object);
StepCore::Object* object() { return _object; }
......@@ -590,10 +590,10 @@ class PropertiesBrowserView: public QTreeView
public:
PropertiesBrowserView(QWidget* parent = 0);
protected:
void changeEvent(QEvent* event);
void mousePressEvent(QMouseEvent* event);
void drawBranches(QPainter *painter, const QRect &rect, const QModelIndex &index) const;
QStyleOptionViewItem viewOptions() const;
void changeEvent(QEvent* event) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
void drawBranches(QPainter *painter, const QRect &rect, const QModelIndex &index) const Q_DECL_OVERRIDE;
QStyleOptionViewItem viewOptions() const Q_DECL_OVERRIDE;
const int _windowsDecoSize;
bool _macStyle;
};
......
......@@ -37,10 +37,10 @@ public:
PropertiesBrowserDelegate(QObject* parent = 0):
QItemDelegate(parent), _editor(NULL), _updating(false) {}
QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option,
const QModelIndex& index) const;
void setEditorData(QWidget* editor, const QModelIndex& index) const;
const QModelIndex& index) const Q_DECL_OVERRIDE;
void setEditorData(QWidget* editor, const QModelIndex& index) const Q_DECL_OVERRIDE;
void setModelData(QWidget* editor, QAbstractItemModel* model,
const QModelIndex& index) const;
const QModelIndex& index) const Q_DECL_OVERRIDE;
protected slots:
void editorActivated();
......@@ -76,7 +76,7 @@ protected slots:
void rowsRemoved(const QModelIndex& parent, int start, int end);
protected:
bool eventFilter(QObject* object, QEvent* event);
bool eventFilter(QObject* object, QEvent* event) Q_DECL_OVERRIDE;
WorldModel* _worldModel;
PropertiesBrowserModel* _propertiesBrowserModel;
......
......@@ -43,7 +43,7 @@ public:
: _world(world), _stopThread(0), _delta(0) {}
~SimulationThread();
void run();
void run() Q_DECL_OVERRIDE;
void doWorldEvolve(double delta);
QMutex* mutex() { return &_mutex; }
......
......@@ -38,8 +38,8 @@ public:
SoftBodyCreator(const QString& className, WorldModel* worldModel, WorldScene* worldScene)
: ItemCreator(className, worldModel, worldScene) {}
bool sceneEvent(QEvent* event);
void start();
bool sceneEvent(QEvent* event) Q_DECL_OVERRIDE;
void start() Q_DECL_OVERRIDE;
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
......@@ -54,7 +54,7 @@ public:
SoftBodyMenuHandler(StepCore::Object* object, WorldModel* worldModel, QObject* parent)
: ItemMenuHandler(object, worldModel, parent), _applied(false) {}
void populateMenu(QMenu* menu, KActionCollection* actions);
void populateMenu(QMenu* menu, KActionCollection* actions) Q_DECL_OVERRIDE;
bool applied() const { return _applied; }
......@@ -78,15 +78,15 @@ class SoftBodyGraphicsItem: public StepGraphicsItem
public:
SoftBodyGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
void viewScaleChanged();
void stateChanged();
void worldDataChanged(bool dynamicOnly);
void viewScaleChanged() Q_DECL_OVERRIDE;
void stateChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool dynamicOnly) Q_DECL_OVERRIDE;
protected:
void mouseSetPos(const QPointF& pos, const QPointF& diff, MovingState);
void mouseSetPos(const QPointF& pos, const QPointF& diff, MovingState) Q_DECL_OVERRIDE;
StepCore::SoftBody* softBody() const;
QPainterPath _painterPath;
......@@ -101,7 +101,7 @@ public:
SoftBodyParticleGraphicsItem(StepCore::Item* item, WorldModel* worldModel)
: ParticleGraphicsItem(item, worldModel) {}
void worldDataChanged(bool dynamicOnly);
void worldDataChanged(bool dynamicOnly) Q_DECL_OVERRIDE;
};
class SoftBodySpringGraphicsItem: public SpringGraphicsItem
......@@ -110,7 +110,7 @@ public:
SoftBodySpringGraphicsItem(StepCore::Item* item, WorldModel* worldModel)
: SpringGraphicsItem(item, worldModel) {}
void worldDataChanged(bool dynamicOnly);
void worldDataChanged(bool dynamicOnly) Q_DECL_OVERRIDE;
};
#endif
......
......@@ -37,11 +37,11 @@ public:
SpringHandlerGraphicsItem(StepCore::Item* item, WorldModel* worldModel,
QGraphicsItem* parent, int num);
void viewScaleChanged();
void worldDataChanged(bool);
void viewScaleChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool) Q_DECL_OVERRIDE;
protected:
void mouseSetPos(const QPointF& pos, const QPointF& diff, MovingState movingState);
void mouseSetPos(const QPointF& pos, const QPointF& diff, MovingState movingState) Q_DECL_OVERRIDE;
int _num;
};
......@@ -49,17 +49,17 @@ class SpringGraphicsItem: public StepGraphicsItem {
public:
SpringGraphicsItem(StepCore::Item* item, WorldModel* worldModel);
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const Q_DECL_OVERRIDE;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
void viewScaleChanged();
void stateChanged();
void worldDataChanged(bool);
void viewScaleChanged() Q_DECL_OVERRIDE;
void stateChanged() Q_DECL_OVERRIDE;
void worldDataChanged(bool) Q_DECL_OVERRIDE;
protected:
static void tryAttach(StepCore::Item* item, WorldScene* worldScene, const QPointF& pos, int num);
void mouseSetPos(const QPointF& pos, const QPointF& diff, MovingState);
void mouseSetPos(const QPointF& pos, const QPointF& diff, MovingState) Q_DECL_OVERRIDE;
StepCore::Spring* spring() const {
return static_cast<StepCore::Spring*>(_item); }
......
......@@ -65,7 +65,7 @@ public:
/** Get item bounding rect. Default implementation returns
* value set by setBoundingRect function */
QRectF boundingRect() const { return _boundingRect; }
QRectF boundingRect() const Q_DECL_OVERRIDE { return _boundingRect; }
/** Set current bounding rect. Should be called by subclass. */
void setBoundingRect(const QRectF& rect) { _boundingRect = rect; }
......@@ -88,7 +88,7 @@ public:
/** Virtual function to paint the item. Default implementation
* draws boundingRect() in grey color */
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);