From 45bf8ed91ed1bd65d7c5750685f8c435c9b092cf Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 5 Mar 2017 10:08:17 +0100 Subject: [PATCH] fix -Wunused-private-field, -Woverloaded-virtual --- src/Gui/Quarter/EventFilter.cpp | 3 --- src/Gui/propertyeditor/PropertyItem.cpp | 14 ++++++++++++++ src/Gui/propertyeditor/PropertyItem.h | 9 +++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/Gui/Quarter/EventFilter.cpp b/src/Gui/Quarter/EventFilter.cpp index f0bb794c20..060882e2a7 100644 --- a/src/Gui/Quarter/EventFilter.cpp +++ b/src/Gui/Quarter/EventFilter.cpp @@ -85,9 +85,6 @@ public: device->setMousePosition(mousepos); } } - -private: - qreal device_pixel_ratio = 1.0; }; #define PRIVATE(obj) obj->pimpl diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index aa627ac512..516fdf9739 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -3511,6 +3511,19 @@ PropertyItemEditorFactory::~PropertyItemEditorFactory() { } +#if (QT_VERSION >= 0x050300) +QWidget * PropertyItemEditorFactory::createEditor (int /*type*/, QWidget * /*parent*/) const +{ + // do not allow to create any editor widgets because we do that in subclasses of PropertyItem + return 0; +} + +QByteArray PropertyItemEditorFactory::valuePropertyName (int /*type*/) const +{ + // do not allow to set properties because we do that in subclasses of PropertyItem + return ""; +} +#else QWidget * PropertyItemEditorFactory::createEditor (QVariant::Type /*type*/, QWidget * /*parent*/) const { // do not allow to create any editor widgets because we do that in subclasses of PropertyItem @@ -3522,6 +3535,7 @@ QByteArray PropertyItemEditorFactory::valuePropertyName (QVariant::Type /*type*/ // do not allow to set properties because we do that in subclasses of PropertyItem return ""; } +#endif #include "moc_PropertyItem.cpp" diff --git a/src/Gui/propertyeditor/PropertyItem.h b/src/Gui/propertyeditor/PropertyItem.h index b55f717f33..7967591fbc 100644 --- a/src/Gui/propertyeditor/PropertyItem.h +++ b/src/Gui/propertyeditor/PropertyItem.h @@ -945,8 +945,13 @@ public: PropertyItemEditorFactory(); virtual ~PropertyItemEditorFactory(); - virtual QWidget * createEditor ( QVariant::Type type, QWidget * parent ) const; - virtual QByteArray valuePropertyName ( QVariant::Type type ) const; +#if (QT_VERSION >= 0x050300) + virtual QWidget *createEditor(int userType, QWidget *parent) const; + virtual QByteArray valuePropertyName(int userType) const; +#else + virtual QWidget * createEditor(QVariant::Type type, QWidget * parent) const; + virtual QByteArray valuePropertyName (QVariant::Type type) const; +#endif }; } // namespace PropertyEditor