Fix several compiler warnings:

fix -Wunused-parameter
fix -Winconsistent-missing-override
fix -Wsometimes-uninitialized
This commit is contained in:
wmayer
2019-04-08 15:04:07 +02:00
parent 78965d27d6
commit 881b04a979
4 changed files with 23 additions and 21 deletions

View File

@@ -60,7 +60,9 @@ Gui::GUIApplicationNativeEventAware::~GUIApplicationNativeEventAware()
void Gui::GUIApplicationNativeEventAware::initSpaceball(QMainWindow *window)
{
#if defined(_USE_3DCONNEXION_SDK) || defined(SPNAV_FOUND)
nativeEvent->initSpaceball(window);
nativeEvent->initSpaceball(window);
#else
Q_UNUSED(window);
#endif
Spaceball::MotionEvent::MotionEventType = QEvent::registerEventType();
Spaceball::ButtonEvent::ButtonEventType = QEvent::registerEventType();

View File

@@ -79,7 +79,7 @@ enum PointPos { none, start, end, mid };
class SketcherExport Constraint : public Base::Persistence
{
TYPESYSTEM_HEADER();
TYPESYSTEM_HEADER_WITH_OVERRIDE();
public:
Constraint();

View File

@@ -43,9 +43,9 @@ public:
enum {Type = QGraphicsItem::UserType + 170};
int type() const { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
virtual QPainterPath shape() const { return path(); }
int type() const override { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) override;
virtual QPainterPath shape() const override { return path(); }
void setHighlighted(bool state);
virtual void setPrettyNormal();
@@ -58,9 +58,9 @@ public:
virtual void setNormalColor(QColor c);
protected:
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
virtual QColor getNormalColor(void);

View File

@@ -181,20 +181,20 @@ void QGIViewBalloon::onAttachPointPicked(QGIView *view, QPointF pos)
QGVPage* page;
if (mdi != nullptr) {
page = mdi->getQGVPage();
QString labelText = QString::fromUtf8(std::to_string(page->balloonIndex).c_str());
balloon->Text.setValue(std::to_string(page->balloonIndex++).c_str());
QFont font = balloonLabel->getFont();
font.setPointSizeF(Rez::guiX(vp->Fontsize.getValue()));
font.setFamily(QString::fromUtf8(vp->Font.getValue()));
balloonLabel->setFont(font);
prepareGeometryChange();
// Default label position
balloonLabel->setPosFromCenter(pos.x() + 200, pos.y() -200);
balloonLabel->setDimString(labelText, Rez::guiX(balloon->TextWrapLen.getValue()));
}
QString labelText = QString::fromUtf8(std::to_string(page->balloonIndex).c_str());
balloon->Text.setValue(std::to_string(page->balloonIndex++).c_str());
QFont font = balloonLabel->getFont();
font.setPointSizeF(Rez::guiX(vp->Fontsize.getValue()));
font.setFamily(QString::fromUtf8(vp->Font.getValue()));
balloonLabel->setFont(font);
prepareGeometryChange();
// Default label position
balloonLabel->setPosFromCenter(pos.x() + 200, pos.y() -200);
balloonLabel->setDimString(labelText, Rez::guiX(balloon->TextWrapLen.getValue()));
}
draw();