Use Q_REQUIRED_RESULT where it make sense.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-03-23 17:27:17 +02:00
parent be7277eeba
commit 70fd0be830
35 changed files with 63 additions and 47 deletions

View file

@ -86,9 +86,9 @@ private:
QComboBox *defHeightCombo;
QComboBox *defSizeCombo;
QGroupBox *LangGroup();
QGroupBox *PMSystemGroup();
QGroupBox *GradationGroup();
QGroupBox *LangGroup() Q_REQUIRED_RESULT;
QGroupBox *PMSystemGroup() Q_REQUIRED_RESULT;
QGroupBox *GradationGroup() Q_REQUIRED_RESULT;
void SetLabelComboBox(const QStringList &list);
void RetranslateUi();
};

View file

@ -55,7 +55,7 @@ private:
QTableWidget *pathTable;
QGroupBox *pathGroup;
QGroupBox *PathGroup();
QGroupBox *PathGroup() Q_REQUIRED_RESULT;
void InitTable();
void RetranslateUi();
};

View file

@ -91,7 +91,7 @@ private:
void InitGroup(QTreeWidgetItem **group, const QString &groupName, const QStringList &mList,
const QStringList &list = QStringList());
QTreeWidgetItem *AddGroup(const QString &text);
QTreeWidgetItem *AddGroup(const QString &text) Q_REQUIRED_RESULT;
void AddMeasurement(QTreeWidgetItem *group, const QString &name, const QStringList &list);
void ReadSettings();

View file

@ -178,7 +178,7 @@ private:
QTableWidgetItem *AddCell(const QString &text, int row, int column, int aligment, bool ok = true);
QComboBox *SetGradationList(QLabel *label, const QStringList &list);
QComboBox *SetGradationList(QLabel *label, const QStringList &list) Q_REQUIRED_RESULT;
void SetDefaultHeight(int value);
void SetDefaultSize(int value);

View file

@ -67,7 +67,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = NULL) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
//! Sets the value of the property
virtual void setValue(const QVariant& value) Q_DECL_OVERRIDE;

View file

@ -85,9 +85,9 @@ private:
void ProxyCheckChanged();
void PasswordCheckChanged();
QGroupBox *ServerGroup();
QGroupBox *ProxyGroup();
QGroupBox *UserGroup();
QGroupBox *ServerGroup() Q_REQUIRED_RESULT;
QGroupBox *ProxyGroup() Q_REQUIRED_RESULT;
QGroupBox *UserGroup() Q_REQUIRED_RESULT;
void RetranslateUi();
};

View file

@ -90,12 +90,12 @@ private:
QGroupBox *drawGroup;
QGroupBox *toolBarGroup;
QGroupBox *SaveGroup();
QGroupBox *LangGroup();
QGroupBox *PMSystemGroup();
QGroupBox *SendGroup();
QGroupBox *DrawGroup();
QGroupBox *ToolBarGroup();
QGroupBox *SaveGroup() Q_REQUIRED_RESULT;
QGroupBox *LangGroup() Q_REQUIRED_RESULT;
QGroupBox *PMSystemGroup() Q_REQUIRED_RESULT;
QGroupBox *SendGroup() Q_REQUIRED_RESULT;
QGroupBox *DrawGroup() Q_REQUIRED_RESULT;
QGroupBox *ToolBarGroup() Q_REQUIRED_RESULT;
void SetLabelComboBox(const QStringList &list);
void RetranslateUi();

View file

@ -55,7 +55,7 @@ private:
QTableWidget *pathTable;
QGroupBox *pathGroup;
QGroupBox *PathGroup();
QGroupBox *PathGroup() Q_REQUIRED_RESULT;
void InitTable();
void RetranslateUi();
};

View file

@ -56,9 +56,9 @@ private:
QGroupBox *undoGroup;
QSpinBox *undoCount;
QLabel *countStepsLabel;
QGroupBox *UserGroup();
QGroupBox *GraphOutputGroup();
QGroupBox *UndoGroup();
QGroupBox *UserGroup() Q_REQUIRED_RESULT;
QGroupBox *GraphOutputGroup() Q_REQUIRED_RESULT;
QGroupBox *UndoGroup() Q_REQUIRED_RESULT;
void RetranslateUi();
};

View file

@ -48,7 +48,7 @@ public:
Q_NORETURN virtual void raise() const Q_DECL_OVERRIDE;
// cppcheck-suppress unusedFunction
virtual VException *clone() const Q_DECL_OVERRIDE;
virtual VException *clone() const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
virtual QString ErrorMessage() const;
virtual QString DetailedInformation() const;
QString WhatUtf8() const V_NOEXCEPT_EXPR (true);

View file

@ -42,6 +42,7 @@ inline QString NameRegExp()
#pragma GCC diagnostic pop
#endif
static inline bool QmuFuzzyComparePossibleNulls(double p1, double p2) Q_REQUIRED_RESULT;
static inline bool QmuFuzzyComparePossibleNulls(double p1, double p2)
{
if(qFuzzyIsNull(p1))

View file

@ -78,7 +78,7 @@ public:
QmuParserCallback(const QmuParserCallback &a_Fun);
QmuParserCallback &operator=(const QmuParserCallback &a_Fun);
QmuParserCallback* Clone() const;
QmuParserCallback* Clone() const Q_REQUIRED_RESULT;
bool IsOptimizable() const;
void* GetAddr() const;
ECmdCode GetCode() const;

View file

@ -150,7 +150,7 @@ public:
const QString& GetToken() const;
EErrorCodes GetCode() const;
Q_NORETURN virtual void raise() const Q_DECL_OVERRIDE;
virtual QmuParserError *clone() const Q_DECL_OVERRIDE;
virtual QmuParserError *clone() const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
private:
QString m_sMsg; ///< The message string
QString m_sExpr; ///< Formula string

View file

@ -40,6 +40,7 @@ enum class VarMeasurement : unsigned char { English=0, Metric=1 };
//Default drawing units for AutoCAD DesignCenter blocks:
enum class VarInsunits : unsigned char { Inches=1, Millimeters=4, Centimeters=5 };
static inline bool DL_FuzzyComparePossibleNulls(double p1, double p2) Q_REQUIRED_RESULT;
static inline bool DL_FuzzyComparePossibleNulls(double p1, double p2)
{
if(qFuzzyIsNull(p1))

View file

@ -77,7 +77,7 @@ public:
bool isNull() const;
qint64 Square() const;
QPainterPath ContourPath() const;
QGraphicsItem *GetItem() const;
QGraphicsItem *GetItem() const Q_REQUIRED_RESULT;
private:
QSharedDataPointer<VLayoutDetailData> d;

View file

@ -50,7 +50,7 @@ class VLayoutGenerator :public QObject
{
Q_OBJECT
public:
explicit VLayoutGenerator(QObject *parent = 0);
explicit VLayoutGenerator(QObject *parent = nullptr);
virtual ~VLayoutGenerator() Q_DECL_OVERRIDE;
void SetDetails(const QVector<VLayoutDetail> &details);
@ -74,8 +74,8 @@ public:
LayoutErrors State() const;
QList<QGraphicsItem *> GetPapersItems() const;
QList<QList<QGraphicsItem *>> GetAllDetails() const;
QList<QGraphicsItem *> GetPapersItems() const Q_REQUIRED_RESULT;
QList<QList<QGraphicsItem *>> GetAllDetails() const Q_REQUIRED_RESULT;
bool GetRotate() const;
void SetRotate(bool value);

View file

@ -73,8 +73,8 @@ public:
bool ArrangeDetail(const VLayoutDetail &detail, volatile bool &stop);
int Count() const;
QGraphicsRectItem *GetPaperItem(bool autoCrop) const;
QList<QGraphicsItem *> GetItemDetails() const;
QGraphicsRectItem *GetPaperItem(bool autoCrop) const Q_REQUIRED_RESULT;
QList<QGraphicsItem *> GetItemDetails() const Q_REQUIRED_RESULT;
QVector<VLayoutDetail> GetDetails() const;
void SetDetails(const QList<VLayoutDetail>& details);

View file

@ -606,6 +606,7 @@ QSharedPointer<QPrinter> DefaultPrinter();
QPixmap darkenPixmap(const QPixmap &pixmap);
static inline bool VFuzzyComparePossibleNulls(double p1, double p2) Q_REQUIRED_RESULT;
static inline bool VFuzzyComparePossibleNulls(double p1, double p2)
{
if(qFuzzyIsNull(p1))

View file

@ -61,7 +61,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = NULL) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
protected:
//! Protected constructor

View file

@ -69,7 +69,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
//! Sets the settings. Available settings:
//!

View file

@ -87,7 +87,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
//! Returns whether this is a file (false) or a directory (true)
virtual bool isDirectory() const;

View file

@ -78,7 +78,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
static int IndexOfColor(const QMap<QString, QString> &colors, const QString &color);

View file

@ -79,7 +79,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
static int IndexOfStyle(const QMap<QString, QIcon> &styles, const QString &style);

View file

@ -68,7 +68,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = NULL) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
public slots:
void valueChanged(int i);
protected:

View file

@ -74,7 +74,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
public slots:
void currentIndexChanged(int index);

View file

@ -59,7 +59,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = NULL) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
//! Sets the value of the property
virtual void setValue(const QVariant& value) Q_DECL_OVERRIDE;

View file

@ -62,7 +62,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = NULL) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
//! Sets the value of the property
virtual void setValue(const QVariant& value) Q_DECL_OVERRIDE;

View file

@ -68,7 +68,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
virtual void UpdateParent(const QVariant &value) Q_DECL_OVERRIDE;

View file

@ -58,7 +58,8 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const Q_DECL_OVERRIDE;
virtual VProperty* clone(bool include_children = true,
VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
};
}

View file

@ -190,7 +190,7 @@ public:
//! \param container If a property is being passed here, no new VProperty is being created but instead it is tried
//! to fill all the data into container. This can also be used when subclassing this function.
//! \return Returns the newly created property (or container, if it was not NULL)
virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const;
virtual VProperty* clone(bool include_children = true, VProperty* container = nullptr) const Q_REQUIRED_RESULT;
Property propertyType() const;
void setPropertyType(const Property &type);

View file

@ -58,7 +58,7 @@ class VPROPERTYEXPLORERSHARED_EXPORT VPropertyModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit VPropertyModel(QObject * parent = 0);
explicit VPropertyModel(QObject * parent = nullptr);
virtual ~VPropertyModel() Q_DECL_OVERRIDE;
//! Adds the property to the model and attaches it to the parentid

View file

@ -113,7 +113,7 @@ public:
int getRootPropertyCount() const;
//! Clones the property set
VPropertySet* clone() const;
VPropertySet* clone() const Q_REQUIRED_RESULT;
protected:
//! Checks whether a property belongs to this set and returns the result

View file

@ -46,7 +46,7 @@ public:
//! Creates a new property of a certain type and assigns a name and description (otionally)
//! \param type The type of the property as string
//! \return Returns the created property or NULL if it couldn't be be created
virtual VProperty* createProperty(const QString& type, const QString &name) Q_DECL_OVERRIDE;
virtual VProperty* createProperty(const QString& type, const QString &name) Q_DECL_OVERRIDE Q_REQUIRED_RESULT;
};
}

View file

@ -94,8 +94,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphics
QString formula = dialogTool->GetFormula();
const quint32 splinePathId = dialogTool->getSplinePathId();
const QString color = dialogTool->GetColor();
VToolCutSplinePath* point = Create(0, pointName, formula, splinePathId, 5, 10, color, scene, doc, data, Document::FullParse,
Source::FromGui);
VToolCutSplinePath* point = Create(0, pointName, formula, splinePathId, 5, 10, color, scene, doc, data,
Document::FullParse, Source::FromGui);
if (point != nullptr)
{
point->dialog=dialogTool;

View file

@ -61,7 +61,8 @@ public:
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
static VPointF *CutSplinePath(qreal length, const QSharedPointer<VAbstractCubicBezierPath> &splPath,
const QString &pName, VSplinePath **splPath1, VSplinePath **splPath2);
const QString &pName, VSplinePath **splPath1,
VSplinePath **splPath2) Q_REQUIRED_RESULT;
protected:
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) Q_DECL_OVERRIDE;
virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE;