Fix clang compiler warnings:
+ fix -Winconsistent-missing-override + fix -Wunused-variable + fix -Wbraced-scalar-init + fix -Wparentheses (View3DInventorViewer::checkGroupOnTop: operator '?:' has lower precedence than '+'; '+' will be evaluated first) + fix -Wundefined-bool-conversion (MainWindow::updateActions) + suppress -Woverloaded-virtual but fix later
This commit is contained in:
@@ -259,7 +259,6 @@ public:
|
||||
}
|
||||
|
||||
int rowCount(const QModelIndex & parent = QModelIndex()) const {
|
||||
const auto &docs = App::GetApplication().getDocuments();
|
||||
Info info;
|
||||
int row = 0;
|
||||
if(!parent.isValid()) {
|
||||
|
||||
@@ -1279,9 +1279,10 @@ void MainWindow::appendRecentFile(const QString& filename)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateActions(bool delay) {
|
||||
void MainWindow::updateActions(bool delay)
|
||||
{
|
||||
//make it safe to call before the main window is actually created
|
||||
if(!this)
|
||||
if (!instance)
|
||||
return;
|
||||
if(!d->activityTimer->isActive())
|
||||
d->activityTimer->start(150);
|
||||
|
||||
@@ -100,10 +100,10 @@ public:
|
||||
* to indicate that the user can click on the dialog. Every pause() must eventually be followed
|
||||
* by a corresponding @ref resume().
|
||||
*/
|
||||
void pause();
|
||||
void pause() override;
|
||||
/** This sets the wait cursor again and grabs the keyboard. @see pause() */
|
||||
void resume();
|
||||
bool isBlocking() const;
|
||||
void resume() override;
|
||||
bool isBlocking() const override;
|
||||
/** Returns an instance of the progress bar. It creates one if needed. */
|
||||
QProgressBar* getProgressBar(QWidget* parent=0);
|
||||
|
||||
@@ -116,15 +116,15 @@ protected:
|
||||
~Sequencer ();
|
||||
|
||||
/** Puts text to the status bar */
|
||||
void setText (const char* pszTxt);
|
||||
void setText (const char* pszTxt) override;
|
||||
/** Starts the progress bar */
|
||||
void startStep();
|
||||
void startStep() override;
|
||||
/** Increase the progress bar. */
|
||||
void nextStep(bool canAbort);
|
||||
void nextStep(bool canAbort) override;
|
||||
/** Sets the progress indicator to a certain position. */
|
||||
void setProgress(size_t);
|
||||
void setProgress(size_t) override;
|
||||
/** Resets the sequencer */
|
||||
void resetData();
|
||||
void resetData() override;
|
||||
void showRemainingTime();
|
||||
|
||||
private:
|
||||
|
||||
@@ -75,12 +75,12 @@ public Q_SLOTS:
|
||||
void onTimer();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
void changeEvent(QEvent *e) override;
|
||||
void showEvent(QShowEvent *) override;
|
||||
void hideEvent(QHideEvent *) override;
|
||||
|
||||
private:
|
||||
void onSelectionChanged(const SelectionChanges& msg);
|
||||
void onSelectionChanged(const SelectionChanges& msg) override;
|
||||
void slotChangePropertyData(const App::DocumentObject&, const App::Property&);
|
||||
void slotChangePropertyView(const Gui::ViewProvider&, const App::Property&);
|
||||
void slotAppendDynamicProperty(const App::Property&);
|
||||
|
||||
@@ -62,16 +62,16 @@ public:
|
||||
virtual ~SelectionView();
|
||||
|
||||
/// Observer message from the Selection
|
||||
virtual void onSelectionChanged(const SelectionChanges& msg);
|
||||
virtual void onSelectionChanged(const SelectionChanges& msg) override;
|
||||
|
||||
virtual void leaveEvent(QEvent*) override;
|
||||
|
||||
bool onMsg(const char* pMsg,const char** ppReturn);
|
||||
bool onMsg(const char* pMsg,const char** ppReturn) override;
|
||||
|
||||
virtual const char *getName(void) const {return "SelectionView";}
|
||||
virtual const char *getName(void) const override {return "SelectionView";}
|
||||
|
||||
/// get called when the document is changed or updated
|
||||
virtual void onUpdate(void);
|
||||
virtual void onUpdate(void) override;
|
||||
|
||||
QListWidget* selectionView;
|
||||
QLabel* countLabel;
|
||||
|
||||
@@ -198,7 +198,7 @@ struct Stats {
|
||||
DEFINE_STATS
|
||||
};
|
||||
|
||||
static Stats _Stats;
|
||||
//static Stats _Stats;
|
||||
|
||||
struct TimingInfo {
|
||||
bool timed = false;
|
||||
@@ -2054,7 +2054,7 @@ void TreeWidget::dropEvent(QDropEvent *event)
|
||||
if(copied.size())
|
||||
res = copied.back();
|
||||
}else
|
||||
res = thisDoc->moveObject({obj},true);
|
||||
res = thisDoc->moveObject(obj,true);
|
||||
if(res) {
|
||||
propPlacement = dynamic_cast<App::PropertyPlacement*>(
|
||||
res->getPropertyByName("Placement"));
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
void selectAllLinks(App::DocumentObject *obj);
|
||||
void expandSelectedItems(TreeItemMode mode);
|
||||
|
||||
bool eventFilter(QObject *, QEvent *ev);
|
||||
bool eventFilter(QObject *, QEvent *ev) override;
|
||||
|
||||
struct SelInfo {
|
||||
App::DocumentObject *topParent;
|
||||
@@ -127,24 +127,24 @@ public:
|
||||
|
||||
protected:
|
||||
/// Observer message from the Selection
|
||||
void onSelectionChanged(const SelectionChanges& msg);
|
||||
void contextMenuEvent (QContextMenuEvent * e);
|
||||
void drawRow(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const;
|
||||
void onSelectionChanged(const SelectionChanges& msg) override;
|
||||
void contextMenuEvent (QContextMenuEvent * e) override;
|
||||
void drawRow(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override;
|
||||
/** @name Drag and drop */
|
||||
//@{
|
||||
void startDrag(Qt::DropActions supportedActions);
|
||||
void startDrag(Qt::DropActions supportedActions) override;
|
||||
bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data,
|
||||
Qt::DropAction action);
|
||||
Qt::DropActions supportedDropActions () const;
|
||||
QMimeData * mimeData (const QList<QTreeWidgetItem *> items) const;
|
||||
void dragEnterEvent(QDragEnterEvent * event);
|
||||
void dragLeaveEvent(QDragLeaveEvent * event);
|
||||
void dragMoveEvent(QDragMoveEvent *event);
|
||||
void dropEvent(QDropEvent *event);
|
||||
Qt::DropAction action) override;
|
||||
Qt::DropActions supportedDropActions () const override;
|
||||
QMimeData * mimeData (const QList<QTreeWidgetItem *> items) const override;
|
||||
void dragEnterEvent(QDragEnterEvent * event) override;
|
||||
void dragLeaveEvent(QDragLeaveEvent * event) override;
|
||||
void dragMoveEvent(QDragMoveEvent *event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
//@}
|
||||
bool event(QEvent *e);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void mouseDoubleClickEvent(QMouseEvent * event);
|
||||
bool event(QEvent *e) override;
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent * event) override;
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *) override;
|
||||
@@ -195,7 +195,7 @@ private:
|
||||
void slotChangeObject(const Gui::ViewProviderDocumentObject&, const App::Property &prop);
|
||||
void slotTouchedObject(const App::DocumentObject&);
|
||||
|
||||
void changeEvent(QEvent *e);
|
||||
void changeEvent(QEvent *e) override;
|
||||
void setupText();
|
||||
|
||||
void updateChildren(App::DocumentObject *obj,
|
||||
@@ -274,7 +274,7 @@ public:
|
||||
void updateItemSelection(DocumentObjectItem *);
|
||||
void selectItems(bool sync);
|
||||
void testStatus(void);
|
||||
void setData(int column, int role, const QVariant & value);
|
||||
void setData(int column, int role, const QVariant & value) override;
|
||||
void populateItem(DocumentObjectItem *item, bool refresh=false, bool delayUpdate=true);
|
||||
bool populateObject(App::DocumentObject *obj);
|
||||
void selectAllInstances(const ViewProviderDocumentObject &vpd);
|
||||
|
||||
@@ -756,7 +756,7 @@ void View3DInventorViewer::checkGroupOnTop(const SelectionChanges &Reason) {
|
||||
SoSelectionElementAction action(node->getDetail()?
|
||||
SoSelectionElementAction::Remove:SoSelectionElementAction::None,true);
|
||||
auto path = node->getPath();
|
||||
SoTempPath tmpPath(2+path?path->getLength():0);
|
||||
SoTempPath tmpPath(2 + (path ? path->getLength() : 0));
|
||||
tmpPath.ref();
|
||||
tmpPath.append(pcGroup);
|
||||
tmpPath.append(node);
|
||||
|
||||
@@ -48,7 +48,7 @@ class Document;
|
||||
|
||||
class GuiExport ViewProviderDocumentObject : public ViewProvider
|
||||
{
|
||||
PROPERTY_HEADER(Gui::ViewProviderDocumentObject);
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Gui::ViewProviderDocumentObject);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
@@ -69,30 +69,30 @@ public:
|
||||
/// Set the active mode, i.e. the first item of the 'Display' property.
|
||||
void setActiveMode();
|
||||
/// Hide the object in the view
|
||||
virtual void hide(void);
|
||||
virtual void hide(void) override;
|
||||
/// Show the object in the view
|
||||
virtual void show(void);
|
||||
virtual void show(void) override;
|
||||
|
||||
virtual bool canDropObjectEx(App::DocumentObject *, App::DocumentObject *,
|
||||
const char *, const std::vector<std::string> &) const override;
|
||||
|
||||
virtual int replaceObject(App::DocumentObject*, App::DocumentObject*) override;
|
||||
|
||||
virtual bool showInTree() const;
|
||||
virtual bool showInTree() const override;
|
||||
|
||||
/// Get a list of TaskBoxes associated with this object
|
||||
virtual void getTaskViewContent(std::vector<Gui::TaskView::TaskContent*>&) const;
|
||||
virtual void getTaskViewContent(std::vector<Gui::TaskView::TaskContent*>&) const override;
|
||||
|
||||
/// Run a redraw
|
||||
void updateView();
|
||||
/// Get the object of this ViewProvider object
|
||||
App::DocumentObject *getObject(void) const {return pcObject;}
|
||||
/// Asks the view provider if the given object can be deleted.
|
||||
virtual bool canDelete(App::DocumentObject* obj) const;
|
||||
virtual bool canDelete(App::DocumentObject* obj) const override;
|
||||
/// Get the GUI document to this ViewProvider object
|
||||
Gui::Document* getDocument() const;
|
||||
/// Get the python wrapper for that ViewProvider
|
||||
PyObject* getPyObject();
|
||||
PyObject* getPyObject() override;
|
||||
|
||||
/// return a hit element given the picked point which contains the full node path
|
||||
virtual bool getElementPicked(const SoPickedPoint *, std::string &subname) const override;
|
||||
@@ -162,9 +162,9 @@ protected:
|
||||
*/
|
||||
Gui::MDIView* getViewOfNode(SoNode* node) const;
|
||||
/// get called before the value is changed
|
||||
virtual void onBeforeChange(const App::Property* prop);
|
||||
virtual void onBeforeChange(const App::Property* prop) override;
|
||||
/// Gets called by the container whenever a property has been changed
|
||||
virtual void onChanged(const App::Property* prop);
|
||||
virtual void onChanged(const App::Property* prop) override;
|
||||
/** Searches in all view providers that are attached to an object that
|
||||
* is part of the same document as the object this view provider is
|
||||
* attached to for an front root of \a type.
|
||||
@@ -177,8 +177,8 @@ protected:
|
||||
/** @name Transaction handling
|
||||
*/
|
||||
//@{
|
||||
virtual bool isAttachedToDocument() const;
|
||||
virtual const char* detachFromDocument();
|
||||
virtual bool isAttachedToDocument() const override;
|
||||
virtual const char* detachFromDocument() override;
|
||||
|
||||
/// get called when a property status has changed
|
||||
virtual void onPropertyStatusChanged(const App::Property &prop, unsigned long oldStatus) override;
|
||||
|
||||
@@ -43,8 +43,8 @@ public:
|
||||
virtual ~ViewProviderDocumentObjectGroup();
|
||||
|
||||
/// returns a list of all possible modes
|
||||
std::vector<std::string> getDisplayModes(void) const;
|
||||
bool isShow(void) const;
|
||||
std::vector<std::string> getDisplayModes(void) const override;
|
||||
bool isShow(void) const override;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@@ -43,7 +43,7 @@ class SoFCCSysDragger;
|
||||
*/
|
||||
class GuiExport ViewProviderDragger : public ViewProviderDocumentObject
|
||||
{
|
||||
PROPERTY_HEADER(Gui::ViewProviderDragger);
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Gui::ViewProviderDragger);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
@@ -54,9 +54,9 @@ public:
|
||||
|
||||
/** @name Edit methods */
|
||||
//@{
|
||||
bool doubleClicked(void);
|
||||
void setupContextMenu(QMenu*, QObject*, const char*);
|
||||
void updateData(const App::Property*);
|
||||
bool doubleClicked(void) override;
|
||||
void setupContextMenu(QMenu*, QObject*, const char*) override;
|
||||
void updateData(const App::Property*) override;
|
||||
|
||||
virtual ViewProvider *startEditing(int ModNum=0) override;
|
||||
|
||||
@@ -64,10 +64,10 @@ public:
|
||||
static void updateTransform(const Base::Placement &from, SoTransform *to);
|
||||
|
||||
protected:
|
||||
bool setEdit(int ModNum);
|
||||
void unsetEdit(int ModNum);
|
||||
void setEditViewer(View3DInventorViewer*, int ModNum);
|
||||
void unsetEditViewer(View3DInventorViewer*);
|
||||
bool setEdit(int ModNum) override;
|
||||
void unsetEdit(int ModNum) override;
|
||||
void setEditViewer(View3DInventorViewer*, int ModNum) override;
|
||||
void unsetEditViewer(View3DInventorViewer*) override;
|
||||
//@}
|
||||
SoFCCSysDragger *csysDragger = nullptr;
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ protected:
|
||||
};
|
||||
|
||||
class GuiExport LinkView : public Base::BaseClass, public LinkOwner {
|
||||
TYPESYSTEM_HEADER();
|
||||
TYPESYSTEM_HEADER_WITH_OVERRIDE();
|
||||
public:
|
||||
|
||||
LinkView();
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
LinkView &operator=(const LinkView&) = delete;
|
||||
LinkView(const LinkView&) = delete;
|
||||
|
||||
virtual PyObject *getPyObject(void);
|
||||
virtual PyObject *getPyObject(void) override;
|
||||
|
||||
virtual void unlink(LinkInfoPtr) override;
|
||||
virtual void onLinkedIconChange(LinkInfoPtr) override;
|
||||
@@ -181,7 +181,7 @@ protected:
|
||||
|
||||
class GuiExport ViewProviderLink : public ViewProviderDocumentObject
|
||||
{
|
||||
PROPERTY_HEADER(Gui::ViewProviderLink);
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Gui::ViewProviderLink);
|
||||
typedef ViewProviderDocumentObject inherited;
|
||||
|
||||
public:
|
||||
|
||||
@@ -43,12 +43,12 @@ public:
|
||||
/// destructor.
|
||||
virtual ~ViewProviderPart();
|
||||
|
||||
virtual bool doubleClicked(void);
|
||||
virtual void setupContextMenu(QMenu* menu, QObject* receiver, const char* member);
|
||||
virtual bool doubleClicked(void) override;
|
||||
virtual void setupContextMenu(QMenu* menu, QObject* receiver, const char* member) override;
|
||||
|
||||
protected:
|
||||
/// get called by the container whenever a property has been changed
|
||||
virtual void onChanged(const App::Property* prop);
|
||||
virtual void onChanged(const App::Property* prop) override;
|
||||
};
|
||||
|
||||
typedef ViewProviderPythonFeatureT<ViewProviderPart> ViewProviderPartPython;
|
||||
|
||||
@@ -43,28 +43,28 @@ namespace Gui
|
||||
|
||||
class GuiExport ViewProviderPlacement : public ViewProviderGeometryObject
|
||||
{
|
||||
PROPERTY_HEADER(Gui::ViewProviderPlacement);
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Gui::ViewProviderPlacement);
|
||||
|
||||
public:
|
||||
/// Constructor
|
||||
ViewProviderPlacement(void);
|
||||
virtual ~ViewProviderPlacement();
|
||||
|
||||
void attach(App::DocumentObject *);
|
||||
void updateData(const App::Property*);
|
||||
std::vector<std::string> getDisplayModes(void) const;
|
||||
void setDisplayMode(const char* ModeName);
|
||||
void attach(App::DocumentObject *) override;
|
||||
void updateData(const App::Property*) override;
|
||||
std::vector<std::string> getDisplayModes(void) const override;
|
||||
void setDisplayMode(const char* ModeName) override;
|
||||
|
||||
/// indicates if the ViewProvider use the new Selection model
|
||||
virtual bool useNewSelectionModel(void) const {return true;}
|
||||
virtual bool useNewSelectionModel(void) const override {return true;}
|
||||
/// indicates if the ViewProvider can be selected
|
||||
virtual bool isSelectable(void) const ;
|
||||
virtual bool isSelectable(void) const override;
|
||||
|
||||
virtual bool getElementPicked(const SoPickedPoint *pp, std::string &subname) const override;
|
||||
virtual bool getDetailPath(const char *, SoFullPath *, bool, SoDetail *&) const override;
|
||||
|
||||
protected:
|
||||
void onChanged(const App::Property* prop);
|
||||
void onChanged(const App::Property* prop) override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
template <class ViewProviderT>
|
||||
class ViewProviderPythonFeatureT : public ViewProviderT
|
||||
{
|
||||
PROPERTY_HEADER(Gui::ViewProviderPythonFeatureT<ViewProviderT>);
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Gui::ViewProviderPythonFeatureT<ViewProviderT>);
|
||||
|
||||
public:
|
||||
/// constructor.
|
||||
@@ -205,37 +205,37 @@ public:
|
||||
}
|
||||
|
||||
// Returns the icon
|
||||
QIcon getIcon() const {
|
||||
QIcon getIcon() const override {
|
||||
QIcon icon = imp->getIcon();
|
||||
if (icon.isNull())
|
||||
icon = ViewProviderT::getIcon();
|
||||
return icon;
|
||||
}
|
||||
|
||||
std::vector<App::DocumentObject*> claimChildren() const {
|
||||
std::vector<App::DocumentObject*> claimChildren() const override {
|
||||
return imp->claimChildren(ViewProviderT::claimChildren());
|
||||
}
|
||||
|
||||
/** @name Nodes */
|
||||
//@{
|
||||
virtual SoSeparator* getRoot() {
|
||||
virtual SoSeparator* getRoot() override {
|
||||
return ViewProviderT::getRoot();
|
||||
}
|
||||
virtual SoSeparator* getFrontRoot() const {
|
||||
virtual SoSeparator* getFrontRoot() const override {
|
||||
return ViewProviderT::getFrontRoot();
|
||||
}
|
||||
// returns the root node of the Provider (3D)
|
||||
virtual SoSeparator* getBackRoot() const {
|
||||
virtual SoSeparator* getBackRoot() const override {
|
||||
return ViewProviderT::getBackRoot();
|
||||
}
|
||||
//@}
|
||||
|
||||
/** @name Selection handling */
|
||||
//@{
|
||||
virtual bool useNewSelectionModel() const {
|
||||
virtual bool useNewSelectionModel() const override {
|
||||
return imp->useNewSelectionModel();
|
||||
}
|
||||
virtual bool getElementPicked(const SoPickedPoint *pp, std::string &subname) const {
|
||||
virtual bool getElementPicked(const SoPickedPoint *pp, std::string &subname) const override {
|
||||
auto ret = imp->getElementPicked(pp,subname);
|
||||
if(ret == ViewProviderPythonFeatureImp::NotImplemented)
|
||||
return ViewProviderT::getElementPicked(pp,subname);
|
||||
@@ -243,42 +243,42 @@ public:
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
virtual std::string getElement(const SoDetail *det) const {
|
||||
virtual std::string getElement(const SoDetail *det) const override {
|
||||
std::string name = imp->getElement(det);
|
||||
if (!name.empty()) return name;
|
||||
return ViewProviderT::getElement(det);
|
||||
}
|
||||
virtual SoDetail* getDetail(const char* name) const {
|
||||
virtual SoDetail* getDetail(const char* name) const override {
|
||||
SoDetail* det = imp->getDetail(name);
|
||||
if (det) return det;
|
||||
return ViewProviderT::getDetail(name);
|
||||
}
|
||||
virtual bool getDetailPath(const char *name, SoFullPath *path, bool append,SoDetail *&det) const {
|
||||
virtual bool getDetailPath(const char *name, SoFullPath *path, bool append,SoDetail *&det) const override {
|
||||
auto ret = imp->getDetailPath(name,path,append,det);
|
||||
if(ret == ViewProviderPythonFeatureImp::NotImplemented)
|
||||
return ViewProviderT::getDetailPath(name,path,append,det);
|
||||
return ret == ViewProviderPythonFeatureImp::Accepted;
|
||||
}
|
||||
virtual std::vector<Base::Vector3d> getSelectionShape(const char* Element) const {
|
||||
virtual std::vector<Base::Vector3d> getSelectionShape(const char* Element) const override {
|
||||
return ViewProviderT::getSelectionShape(Element);
|
||||
};
|
||||
//@}
|
||||
|
||||
/** @name Update data methods*/
|
||||
//@{
|
||||
virtual void attach(App::DocumentObject *obj) {
|
||||
virtual void attach(App::DocumentObject *obj) override {
|
||||
// delay loading of the actual attach() method because the Python
|
||||
// view provider class is not attached yet
|
||||
ViewProviderT::pcObject = obj;
|
||||
}
|
||||
virtual void updateData(const App::Property* prop) {
|
||||
virtual void updateData(const App::Property* prop) override {
|
||||
imp->updateData(prop);
|
||||
ViewProviderT::updateData(prop);
|
||||
}
|
||||
virtual void getTaskViewContent(std::vector<Gui::TaskView::TaskContent*>& c) const {
|
||||
virtual void getTaskViewContent(std::vector<Gui::TaskView::TaskContent*>& c) const override {
|
||||
ViewProviderT::getTaskViewContent(c);
|
||||
}
|
||||
virtual bool onDelete(const std::vector<std::string> & sub) {
|
||||
virtual bool onDelete(const std::vector<std::string> & sub) override {
|
||||
bool ok = imp->onDelete(sub);
|
||||
if (!ok) return ok;
|
||||
return ViewProviderT::onDelete(sub);
|
||||
@@ -297,11 +297,11 @@ public:
|
||||
|
||||
/** @name Restoring view provider from document load */
|
||||
//@{
|
||||
virtual void startRestoring() {
|
||||
virtual void startRestoring() override {
|
||||
ViewProviderT::startRestoring();
|
||||
imp->startRestoring();
|
||||
}
|
||||
virtual void finishRestoring() {
|
||||
virtual void finishRestoring() override {
|
||||
imp->finishRestoring();
|
||||
ViewProviderT::finishRestoring();
|
||||
}
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
/** @name Drag and drop */
|
||||
//@{
|
||||
/// Returns true if the view provider generally supports dragging objects
|
||||
virtual bool canDragObjects() const {
|
||||
virtual bool canDragObjects() const override {
|
||||
switch (imp->canDragObjects()) {
|
||||
case ViewProviderPythonFeatureImp::Accepted:
|
||||
return true;
|
||||
@@ -321,7 +321,7 @@ public:
|
||||
}
|
||||
}
|
||||
/// Check whether the object can be removed from the view provider by drag and drop
|
||||
virtual bool canDragObject(App::DocumentObject* obj) const {
|
||||
virtual bool canDragObject(App::DocumentObject* obj) const override {
|
||||
switch (imp->canDragObject(obj)) {
|
||||
case ViewProviderPythonFeatureImp::Accepted:
|
||||
return true;
|
||||
@@ -332,7 +332,7 @@ public:
|
||||
}
|
||||
}
|
||||
/// Starts to drag the object
|
||||
virtual void dragObject(App::DocumentObject* obj) {
|
||||
virtual void dragObject(App::DocumentObject* obj) override {
|
||||
App::AutoTransaction committer;
|
||||
switch (imp->dragObject(obj)) {
|
||||
case ViewProviderPythonFeatureImp::Accepted:
|
||||
@@ -343,7 +343,7 @@ public:
|
||||
}
|
||||
}
|
||||
/// Returns true if the view provider generally accepts dropping of objects
|
||||
virtual bool canDropObjects() const {
|
||||
virtual bool canDropObjects() const override {
|
||||
switch (imp->canDropObjects()) {
|
||||
case ViewProviderPythonFeatureImp::Accepted:
|
||||
return true;
|
||||
@@ -354,7 +354,7 @@ public:
|
||||
}
|
||||
}
|
||||
/// Check whether the object can be dropped to the view provider by drag and drop
|
||||
virtual bool canDropObject(App::DocumentObject* obj) const {
|
||||
virtual bool canDropObject(App::DocumentObject* obj) const override {
|
||||
switch (imp->canDropObject(obj)) {
|
||||
case ViewProviderPythonFeatureImp::Accepted:
|
||||
return true;
|
||||
@@ -365,7 +365,7 @@ public:
|
||||
}
|
||||
}
|
||||
/// If the dropped object type is accepted the object will be added as child
|
||||
virtual void dropObject(App::DocumentObject* obj) {
|
||||
virtual void dropObject(App::DocumentObject* obj) override {
|
||||
App::AutoTransaction committer;
|
||||
switch (imp->dropObject(obj)) {
|
||||
case ViewProviderPythonFeatureImp::Accepted:
|
||||
@@ -400,7 +400,7 @@ public:
|
||||
}
|
||||
/** Add an object with full quanlified name to the view provider by drag and drop */
|
||||
virtual std::string dropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner,
|
||||
const char *subname, const std::vector<std::string> &elements)
|
||||
const char *subname, const std::vector<std::string> &elements) override
|
||||
{
|
||||
App::AutoTransaction committer;
|
||||
std::string ret;
|
||||
@@ -418,24 +418,24 @@ public:
|
||||
/** @name Display methods */
|
||||
//@{
|
||||
/// Returns true if the icon must always appear enabled in the tree view
|
||||
virtual bool isShow() const {
|
||||
virtual bool isShow() const override {
|
||||
bool ok = imp->isShow();
|
||||
if (ok) return ok;
|
||||
return ViewProviderT::isShow();
|
||||
}
|
||||
/// get the default display mode
|
||||
virtual const char* getDefaultDisplayMode() const {
|
||||
virtual const char* getDefaultDisplayMode() const override {
|
||||
return imp->getDefaultDisplayMode();
|
||||
}
|
||||
/// returns a list of all possible modes
|
||||
virtual std::vector<std::string> getDisplayModes(void) const {
|
||||
virtual std::vector<std::string> getDisplayModes(void) const override {
|
||||
std::vector<std::string> modes = ViewProviderT::getDisplayModes();
|
||||
std::vector<std::string> more_modes = imp->getDisplayModes();
|
||||
modes.insert(modes.end(), more_modes.begin(), more_modes.end());
|
||||
return modes;
|
||||
}
|
||||
/// set the display mode
|
||||
virtual void setDisplayMode(const char* ModeName) {
|
||||
virtual void setDisplayMode(const char* ModeName) override {
|
||||
std::string mask = imp->setDisplayMode(ModeName);
|
||||
ViewProviderT::setDisplayMaskMode(mask.c_str());
|
||||
ViewProviderT::setDisplayMode(ModeName);
|
||||
@@ -453,7 +453,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
PyObject* getPyObject() {
|
||||
PyObject* getPyObject() override {
|
||||
return ViewProviderT::getPyObject();
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void onChanged(const App::Property* prop) {
|
||||
virtual void onChanged(const App::Property* prop) override {
|
||||
if (prop == &Proxy) {
|
||||
imp->init(Proxy.getValue().ptr());
|
||||
if (ViewProviderT::pcObject && !Proxy.getValue().is(Py::_None())) {
|
||||
@@ -489,7 +489,7 @@ protected:
|
||||
}
|
||||
}
|
||||
/// is called by the document when the provider goes in edit mode
|
||||
virtual bool setEdit(int ModNum)
|
||||
virtual bool setEdit(int ModNum) override
|
||||
{
|
||||
switch (imp->setEdit(ModNum)) {
|
||||
case ViewProviderPythonFeatureImp::Accepted:
|
||||
@@ -501,7 +501,7 @@ protected:
|
||||
}
|
||||
}
|
||||
/// is called when you lose the edit mode
|
||||
virtual void unsetEdit(int ModNum)
|
||||
virtual void unsetEdit(int ModNum) override
|
||||
{
|
||||
switch (imp->unsetEdit(ModNum)) {
|
||||
case ViewProviderPythonFeatureImp::Accepted:
|
||||
@@ -511,23 +511,23 @@ protected:
|
||||
return ViewProviderT::unsetEdit(ModNum);
|
||||
}
|
||||
}
|
||||
virtual void setEditViewer(View3DInventorViewer *viewer, int ModNum) {
|
||||
virtual void setEditViewer(View3DInventorViewer *viewer, int ModNum) override {
|
||||
if(!imp->setEditViewer(viewer,ModNum))
|
||||
ViewProviderT::setEditViewer(viewer,ModNum);
|
||||
}
|
||||
virtual void unsetEditViewer(View3DInventorViewer *viewer) {
|
||||
virtual void unsetEditViewer(View3DInventorViewer *viewer) override {
|
||||
if(!imp->unsetEditViewer(viewer))
|
||||
ViewProviderT::unsetEditViewer(viewer);
|
||||
}
|
||||
|
||||
virtual std::string getDropPrefix() const {
|
||||
virtual std::string getDropPrefix() const override {
|
||||
std::string prefix;
|
||||
if(!imp->getDropPrefix(prefix))
|
||||
return ViewProviderT::getDropPrefix();
|
||||
return prefix;
|
||||
}
|
||||
|
||||
virtual int replaceObject(App::DocumentObject *oldObj, App::DocumentObject *newObj) {
|
||||
virtual int replaceObject(App::DocumentObject *oldObj, App::DocumentObject *newObj) override {
|
||||
App::AutoTransaction committer;
|
||||
switch (imp->replaceObject(oldObj,newObj)) {
|
||||
case ViewProviderPythonFeatureImp::Accepted:
|
||||
@@ -539,6 +539,12 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
//FIXME: ViewProviderPythonFeatureT hides overloaded virtual functions
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Woverloaded-virtual"
|
||||
#endif
|
||||
|
||||
virtual ViewProviderDocumentObject *getLinkedViewProvider(bool recursive=false) const {
|
||||
auto res = imp->getLinkedViewProvider(recursive);
|
||||
if(!res)
|
||||
@@ -546,15 +552,19 @@ protected:
|
||||
return res;
|
||||
}
|
||||
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
public:
|
||||
virtual void setupContextMenu(QMenu* menu, QObject* recipient, const char* member)
|
||||
virtual void setupContextMenu(QMenu* menu, QObject* recipient, const char* member) override
|
||||
{
|
||||
ViewProviderT::setupContextMenu(menu, recipient, member);
|
||||
imp->setupContextMenu(menu);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual bool doubleClicked(void)
|
||||
virtual bool doubleClicked(void) override
|
||||
{
|
||||
App::AutoTransaction committer;
|
||||
switch (imp->doubleClicked()) {
|
||||
@@ -566,7 +576,7 @@ protected:
|
||||
return ViewProviderT::doubleClicked();
|
||||
}
|
||||
}
|
||||
virtual void setOverrideMode(const std::string &mode)
|
||||
virtual void setOverrideMode(const std::string &mode) override
|
||||
{
|
||||
ViewProviderT::setOverrideMode(mode);
|
||||
viewerMode = mode;
|
||||
|
||||
@@ -986,14 +986,14 @@ class GuiExport PropertyLinkItem: public PropertyItem
|
||||
Q_OBJECT
|
||||
PROPERTYITEM_HEADER
|
||||
|
||||
virtual QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const;
|
||||
virtual void setEditorData(QWidget *editor, const QVariant& data) const;
|
||||
virtual QVariant editorData(QWidget *editor) const;
|
||||
virtual QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override;
|
||||
virtual void setEditorData(QWidget *editor, const QVariant& data) const override;
|
||||
virtual QVariant editorData(QWidget *editor) const override;
|
||||
|
||||
protected:
|
||||
virtual QVariant toString(const QVariant&) const;
|
||||
virtual QVariant value(const App::Property*) const;
|
||||
virtual void setValue(const QVariant&);
|
||||
virtual QVariant toString(const QVariant&) const override;
|
||||
virtual QVariant value(const App::Property*) const override;
|
||||
virtual void setValue(const QVariant&) override;
|
||||
virtual QVariant data(int column, int role) const override;
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user