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:
{
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 (iArgCount)
@ -1259,6 +1263,11 @@ qreal QmuParserBase::ParseCmdCodeBulk(int nOffset, int nThreadID) const
Error(ecINTERNAL_ERROR, 3);
return 0;
} // switch CmdCode
#ifdef Q_CC_CLANG
#pragma clang diagnostic pop
#endif
} // for all bytecode tokens
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)
{
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()));
return QPixmap::fromImage(tmpImgage);
// todo: support alpha channel

View file

@ -64,8 +64,9 @@ signals:
public slots:
//! Sets the current file, does not check if it is valid
//! \param file 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 getFile The new filepath the widget should show
//! \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);
//! Sets a filter for the file field

View file

@ -139,7 +139,7 @@ void VIntegerProperty::valueChanged(int i)
const double VDoubleProperty::StandardPrecision = 5;
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::d_ptr->VariantValue.setValue(0);
@ -148,7 +148,7 @@ VDoubleProperty::VDoubleProperty(const QString& name, const QMap<QString, QVaria
}
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.convert(QVariant::Double);

View file

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

View file

@ -113,7 +113,7 @@ QWidget* VProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& o
factory->registerEditor(QVariant::String, lineCreator);
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;
}
@ -174,7 +174,7 @@ Qt::ItemFlags VProperty::flags(int column) const
void VProperty::setValue(const QVariant &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)
{
setEditorData(d_ptr->editor);

View file

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

View file

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

View file

@ -63,7 +63,8 @@ public:
//! \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.
//! 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);
//! Checks whether a property belongs to this set and returns the result

View file

@ -40,7 +40,7 @@ public:
explicit VPropertyTreeView(QWidget *parent = 0);
//! 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);
//! 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)
{
if (property && set)

View file

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

View file

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