Clang warnings.

--HG--
branch : develop
This commit is contained in:
dismine 2014-10-03 14:40:39 +03:00
parent ea9ba2a11a
commit 01e37bf4bf
13 changed files with 59 additions and 17 deletions

View File

@ -1068,6 +1068,10 @@ qreal QmuParserBase::ParseCmdCodeBulk(int nOffset, int nThreadID) const
case cmFUNC: case cmFUNC:
{ {
int iArgCount = pTok->Fun.argc; int iArgCount = pTok->Fun.argc;
#ifdef Q_CC_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundefined-reinterpret-cast"
#endif
// switch according to argument count // switch according to argument count
switch (iArgCount) switch (iArgCount)
@ -1259,6 +1263,11 @@ qreal QmuParserBase::ParseCmdCodeBulk(int nOffset, int nThreadID) const
Error(ecINTERNAL_ERROR, 3); Error(ecINTERNAL_ERROR, 3);
return 0; return 0;
} // switch CmdCode } // switch CmdCode
#ifdef Q_CC_CLANG
#pragma clang diagnostic pop
#endif
} // for all bytecode tokens } // for all bytecode tokens
return Stack[m_nFinalResultIdx]; return Stack[m_nFinalResultIdx];

View File

@ -80,7 +80,7 @@ void VColorPropertyEditor::setColor(const QColor& color_)
QPixmap VColorPropertyEditor::getColorPixmap(const QColor& color, unsigned int size) QPixmap VColorPropertyEditor::getColorPixmap(const QColor& color, unsigned int size)
{ {
QImage tmpImgage(size, size, QImage::Format_ARGB32_Premultiplied); QImage tmpImgage(static_cast<int>(size), static_cast<int>(size), QImage::Format_ARGB32_Premultiplied);
tmpImgage.fill(static_cast<unsigned int>(color.rgb())); tmpImgage.fill(static_cast<unsigned int>(color.rgb()));
return QPixmap::fromImage(tmpImgage); return QPixmap::fromImage(tmpImgage);
// todo: support alpha channel // todo: support alpha channel

View File

@ -64,8 +64,9 @@ signals:
public slots: public slots:
//! Sets the current file, does not check if it is valid //! Sets the current file, does not check if it is valid
//! \param file The new filepath the widget should show //! \param getFile The new filepath the widget should show
//! \emit_signal If true, this will emit the dataChangedByUser()-signal (if file differs from the current file) //! \param emit_signal If true, this will emit the dataChangedByUser()-signal (if file differs from the current
//! file)
void setFile(const QString &getFile, bool emit_signal = false); void setFile(const QString &getFile, bool emit_signal = false);
//! Sets a filter for the file field //! Sets a filter for the file field

View File

@ -139,7 +139,7 @@ void VIntegerProperty::valueChanged(int i)
const double VDoubleProperty::StandardPrecision = 5; const double VDoubleProperty::StandardPrecision = 5;
VDoubleProperty::VDoubleProperty(const QString& name, const QMap<QString, QVariant>& settings) VDoubleProperty::VDoubleProperty(const QString& name, const QMap<QString, QVariant>& settings)
: VIntegerProperty(name), Precision(StandardPrecision) : VIntegerProperty(name), Precision(static_cast<int>(StandardPrecision))
{ {
VProperty::setSettings(settings); VProperty::setSettings(settings);
VProperty::d_ptr->VariantValue.setValue(0); VProperty::d_ptr->VariantValue.setValue(0);
@ -148,7 +148,7 @@ VDoubleProperty::VDoubleProperty(const QString& name, const QMap<QString, QVaria
} }
VDoubleProperty::VDoubleProperty(const QString &name) VDoubleProperty::VDoubleProperty(const QString &name)
: VIntegerProperty(name), Precision(StandardPrecision) : VIntegerProperty(name), Precision(static_cast<int>(StandardPrecision))
{ {
VProperty::d_ptr->VariantValue.setValue(0); VProperty::d_ptr->VariantValue.setValue(0);
VProperty::d_ptr->VariantValue.convert(QVariant::Double); VProperty::d_ptr->VariantValue.convert(QVariant::Double);

View File

@ -29,11 +29,17 @@ namespace VPE
class VProperty; class VProperty;
#ifdef Q_CC_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#endif
class VPROPERTYEXPLORERSHARED_EXPORT VAbstractPropertyFactory class VPROPERTYEXPLORERSHARED_EXPORT VAbstractPropertyFactory
{ {
public: public:
//! Empty virtual destructor //! Empty virtual destructor
virtual ~VAbstractPropertyFactory() {} virtual ~VAbstractPropertyFactory()
{}
//! Creates a new property of a certain type and assigns a name and description (otionally) //! Creates a new property of a certain type and assigns a name and description (otionally)
//! \param type The type of the property as string //! \param type The type of the property as string
@ -42,6 +48,10 @@ public:
virtual VProperty* createProperty(const QString& type, const QString &name) = 0; virtual VProperty* createProperty(const QString& type, const QString &name) = 0;
}; };
#ifdef Q_CC_CLANG
#pragma clang diagnostic pop
#endif
} }
#endif // VABSTRACTPROPERTYFACTORY_H #endif // VABSTRACTPROPERTYFACTORY_H

View File

@ -113,7 +113,7 @@ QWidget* VProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& o
factory->registerEditor(QVariant::String, lineCreator); factory->registerEditor(QVariant::String, lineCreator);
QItemEditorFactory::setDefaultFactory(factory); QItemEditorFactory::setDefaultFactory(factory);
d_ptr->editor = factory->createEditor(d_ptr->PropertyVariantType, parent); d_ptr->editor = factory->createEditor(static_cast<int>(d_ptr->PropertyVariantType), parent);
return d_ptr->editor; return d_ptr->editor;
} }
@ -174,7 +174,7 @@ Qt::ItemFlags VProperty::flags(int column) const
void VProperty::setValue(const QVariant &value) void VProperty::setValue(const QVariant &value)
{ {
d_ptr->VariantValue = value; d_ptr->VariantValue = value;
d_ptr->VariantValue.convert(d_ptr->PropertyVariantType); d_ptr->VariantValue.convert(static_cast<int>(d_ptr->PropertyVariantType));
if (d_ptr->editor != nullptr) if (d_ptr->editor != nullptr)
{ {
setEditorData(d_ptr->editor); setEditorData(d_ptr->editor);

View File

@ -31,6 +31,11 @@ namespace VPE
class VPropertyModel; class VPropertyModel;
class VPropertySet; class VPropertySet;
#ifdef Q_CC_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#endif
class VPropertyFormViewPrivate : public VPropertyFormWidgetPrivate class VPropertyFormViewPrivate : public VPropertyFormWidgetPrivate
{ {
public: public:
@ -68,6 +73,10 @@ private:
Q_DISABLE_COPY(VPropertyFormViewPrivate) Q_DISABLE_COPY(VPropertyFormViewPrivate)
}; };
#ifdef Q_CC_CLANG
#pragma clang diagnostic pop
#endif
} }
#endif // VPROPERTYFORMVIEW_P_H #endif // VPROPERTYFORMVIEW_P_H

View File

@ -29,6 +29,11 @@
namespace VPE namespace VPE
{ {
#ifdef Q_CC_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#endif
class VPropertyFormWidgetPrivate class VPropertyFormWidgetPrivate
{ {
public: public:
@ -67,6 +72,10 @@ public:
{} {}
}; };
#ifdef Q_CC_CLANG
#pragma clang diagnostic pop
#endif
} }
#endif // VPROPERTYFORMWIDGET_P_H #endif // VPROPERTYFORMWIDGET_P_H

View File

@ -63,7 +63,8 @@ public:
//! \param property The property to add //! \param property The property to add
//! \param id The property ID. If id is empty, the property will not be accessable by it's id but still be added. //! \param id The property ID. If id is empty, the property will not be accessable by it's id but still be added.
//! If the property was filed under another ID before, that will no longer be valid. //! If the property was filed under another ID before, that will no longer be valid.
//! \param parentid The property to which to add the property as child. Pass NULL to add it to the root properties. //! \param parent_property The property to which to add the property as child. Pass NULL to add it to the root
//! properties.
virtual bool addProperty(VProperty* property, const QString& id, VProperty* parent_property = nullptr); virtual bool addProperty(VProperty* property, const QString& id, VProperty* parent_property = nullptr);
//! Checks whether a property belongs to this set and returns the result //! Checks whether a property belongs to this set and returns the result

View File

@ -40,7 +40,7 @@ public:
explicit VPropertyTreeView(QWidget *parent = 0); explicit VPropertyTreeView(QWidget *parent = 0);
//! The destructor, taking a model and setting it to the tree view //! The destructor, taking a model and setting it to the tree view
//! \param The model to set as model for this tree view //! \param model The model to set as model for this tree view
VPropertyTreeView(VPropertyModel* model, QWidget *parent = 0); VPropertyTreeView(VPropertyModel* model, QWidget *parent = 0);
//! Destructor //! Destructor

View File

@ -53,9 +53,6 @@ VSerializedProperty::VSerializedProperty(const QString &id, const QString &type,
{ {
} }
VPE::VSerializedProperty::~VSerializedProperty()
{}
void VSerializedProperty::initChildren(const VProperty *property, const VPropertySet *set) void VSerializedProperty::initChildren(const VProperty *property, const VPropertySet *set)
{ {
if (property && set) if (property && set)

View File

@ -49,9 +49,6 @@ public:
//! Constructor //! Constructor
VSerializedProperty(const QString& id, const QString& type, const QVariant& value); VSerializedProperty(const QString& id, const QString& type, const QVariant& value);
//! Destructor
~VSerializedProperty();
//! The property type //! The property type
QString ID; QString ID;

View File

@ -31,6 +31,11 @@
namespace VPE namespace VPE
{ {
#ifdef Q_CC_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#endif
class VWidgetPropertyPrivate : public VPropertyPrivate class VWidgetPropertyPrivate : public VPropertyPrivate
{ {
public: public:
@ -46,7 +51,7 @@ public:
: VPropertyPrivate(), Widget(nullptr) {} : VPropertyPrivate(), Widget(nullptr) {}
//! Destructor //! Destructor
~VWidgetPropertyPrivate() virtual ~VWidgetPropertyPrivate()
{ {
if (Widget) if (Widget)
{ {
@ -55,6 +60,10 @@ public:
} }
}; };
#ifdef Q_CC_CLANG
#pragma clang diagnostic pop
#endif
} }
#endif // VWIDGETPROPERTY_P_H #endif // VWIDGETPROPERTY_P_H