Removed unused QObject inheritances.

This commit is contained in:
Ian Rees 2016-06-06 21:06:30 +12:00 committed by wmayer
parent b883434318
commit cd96b40983
21 changed files with 20 additions and 121 deletions

View File

@ -31,16 +31,7 @@ set(TechDrawGui_MOC_HDRS
QGITemplate.h
QGISVGTemplate.h
QGIDrawingTemplate.h
QGIView.h
QGIViewCollection.h
QGIViewDimension.h
QGIProjGroup.h
QGIViewPart.h
QGIViewSection.h
QGIViewAnnotation.h
QGIViewSymbol.h
QGIViewSpreadsheet.h
QGIViewClip.h
TaskProjGroup.h
DlgPrefsTechDrawImp.h
TaskLinkDim.h

View File

@ -183,8 +183,13 @@ MDIViewPage::MDIViewPage(ViewProviderPage *pageVp, Gui::Document* doc, QWidget*
MDIViewPage::~MDIViewPage()
{
// Safely remove graphicview items that have built up TEMP SOLUTION
for(QList<QGIView*>::iterator it = deleteItems.begin(); it != deleteItems.end(); ++it) {
(*it)->deleteLater();
for(auto it : deleteItems) {
auto qObjPtr( dynamic_cast<QObject *>(it) );
if (qObjPtr) {
qObjPtr->deleteLater();
} else {
delete it;
}
}
deleteItems.clear();
@ -400,7 +405,7 @@ void MDIViewPage::preSelectionChanged(const QPoint &pos)
,pos.y()
,0));
} else {
QGIView *view = qobject_cast<QGIView *>(obj);
auto view( dynamic_cast<QGIView *>(obj) );
if(!view)
return;

View File

@ -222,4 +222,3 @@ void QGIProjGroup::drawBorder()
// Base::Console().Message("TRACE - QGIProjGroup::drawBorder - doing nothing!!\n");
}
#include "moc_QGIProjGroup.cpp"

View File

@ -44,8 +44,6 @@ namespace TechDrawGui
class TechDrawGuiExport QGIProjGroup : public QGIViewCollection
{
Q_OBJECT
public:
QGIProjGroup();
@ -60,9 +58,6 @@ public:
virtual void updateView(bool update = false);
virtual void drawBorder(void);
Q_SIGNALS:
void dirty();
protected:
virtual bool sceneEventFilter(QGraphicsItem* watched, QEvent *event);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);

View File

@ -279,13 +279,11 @@ void QGIView::setViewFeature(TechDraw::DrawView *obj)
float x = obj->X.getValue();
float y = obj->Y.getValue();
setPosition(x, y);
Q_EMIT dirty();
}
void QGIView::toggleCache(bool state)
{
// TODO: huh? IR //temp for devl. chaching was hiding problems WF
// temp for devl. chaching was hiding problems WF
setCacheMode((state)? NoCache : NoCache);
}
@ -385,4 +383,3 @@ void _debugRect(char* text, QRectF r) {
r.left(),r.top(),r.right(),r.bottom());
}
#include "moc_QGIView.cpp"

View File

@ -41,10 +41,8 @@ namespace TechDrawGui
class QGCustomBorder;
class QGCustomLabel;
class TechDrawGuiExport QGIView : public QObject, public QGraphicsItemGroup
class TechDrawGuiExport QGIView : public QGraphicsItemGroup
{
Q_OBJECT
public:
QGIView();
virtual ~QGIView() = default;
@ -79,9 +77,6 @@ public:
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * event);
Q_SIGNALS:
void dirty();
protected:
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);

View File

@ -168,4 +168,3 @@ QRectF QGIViewAnnotation::boundingRect() const
return childrenBoundingRect();
}
#include "moc_QGIViewAnnotation.cpp"

View File

@ -24,9 +24,6 @@
#ifndef DRAWINGGUI_QGRAPHICSITEMVIEWANNOTATION_H
#define DRAWINGGUI_QGRAPHICSITEMVIEWANNOTATION_H
#include <QObject>
#include <QPainter>
#include "QGIView.h"
#include "QGCustomText.h"
@ -39,8 +36,6 @@ namespace TechDrawGui
class TechDrawGuiExport QGIViewAnnotation : public QGIView
{
Q_OBJECT
public:
explicit QGIViewAnnotation();
@ -57,21 +52,16 @@ public:
virtual void draw() override;
virtual QRectF boundingRect() const override;
Q_SIGNALS:
void hover(bool state);
void selected(bool state);
protected:
void drawAnnotation();
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
protected:
QGCustomText *m_textItem;
QColor m_colNormal;
QColor m_colSel;
QColor m_colPre;
};
} // namespace MDIViewPageGui
} // end namespace TechDrawGui
#endif // DRAWINGGUI_QGRAPHICSITEMVIEWANNOTATION_H

View File

@ -190,4 +190,3 @@ QRectF QGIViewClip::boundingRect() const
return childrenBoundingRect();
}
#include "moc_QGIViewClip.cpp"

View File

@ -39,8 +39,6 @@ namespace TechDrawGui
class TechDrawGuiExport QGIViewClip : public QGIView
{
Q_OBJECT
public:
QGIViewClip();
@ -54,10 +52,6 @@ public:
virtual void draw() override;
virtual QRectF boundingRect() const override;
Q_SIGNALS:
void selected(bool state);
void dirty();
protected:
void drawClip();
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;

View File

@ -80,4 +80,3 @@ void QGIViewCollection::updateView(bool update)
return QGIView::updateView(update);
}
#include "moc_QGIViewCollection.cpp"

View File

@ -44,8 +44,6 @@ namespace TechDrawGui
class TechDrawGuiExport QGIViewCollection : public QGIView
{
Q_OBJECT
public:
QGIViewCollection();
~QGIViewCollection() = default;
@ -56,9 +54,6 @@ public:
virtual void updateView(bool update = false);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * event);
Q_SIGNALS:
void dirty();
protected:
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);

View File

@ -81,7 +81,7 @@ private:
QColor m_colSel;
};
class TechDrawGuiExport QGIViewDimension : public QGIView
class TechDrawGuiExport QGIViewDimension : public QObject, public QGIView
{
Q_OBJECT

View File

@ -636,5 +636,3 @@ void _dumpPath(const char* text,QPainterPath path)
}
}
#include "moc_QGIViewPart.cpp"

View File

@ -44,8 +44,6 @@ namespace TechDrawGui
class TechDrawGuiExport QGIViewPart : public QGIView
{
Q_OBJECT
public:
explicit QGIViewPart();
@ -65,10 +63,6 @@ public:
virtual void draw() override;
virtual QRectF boundingRect() const override;
Q_SIGNALS:
void selected(bool state);
void dirty();
protected:
/// Helper for pathArc()
/*!

View File

@ -105,4 +105,3 @@ void QGIViewSection::updateView(bool update)
}
}
#include "moc_QGIViewSection.cpp"

View File

@ -25,21 +25,11 @@
#include "QGIViewPart.h"
namespace TechDraw {
class DrawViewSection;
}
namespace TechDrawGeometry {
class BaseGeom;
}
namespace TechDrawGui
{
class TechDrawGuiExport QGIViewSection : public QGIViewPart
{
Q_OBJECT
public:
QGIViewSection() = default;
@ -57,6 +47,6 @@ protected:
void drawSectionFace();
};
} // namespace MDIViewPageGui
} // end namespace TechDrawGui
#endif // DRAWINGGUI_QGRAPHICSITEMVIEWPART_H
#endif // #ifndef DRAWINGGUI_QGRAPHICSITEMVIEWSECTION_H

View File

@ -22,24 +22,8 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QGraphicsSceneHoverEvent>
#include <QMenu>
#include <QMouseEvent>
#include <QString>
#include <sstream>
#endif
#include <qmath.h>
#include <App/Application.h>
#include <App/Material.h>
#include <Base/Console.h>
#include <Base/Parameter.h>
#include "../App/DrawView.h"
#include "../App/DrawViewSpreadsheet.h"
#include "QGIViewSpreadsheet.h"
@ -60,5 +44,3 @@ void QGIViewSpreadsheet::setViewFeature(TechDraw::DrawViewSpreadsheet *obj)
QGIView::setViewFeature(static_cast<TechDraw::DrawView *>(obj));
}
#include "moc_QGIViewSpreadsheet.cpp"

View File

@ -23,15 +23,7 @@
#ifndef DRAWINGGUI_QGRAPHICSITEMVIEWSPREADSHEET_H
#define DRAWINGGUI_QGRAPHICSITEMVIEWSPREADSHEET_H
#include <QObject>
#include <QPainter>
#include <QString>
#include <QByteArray>
#include <QSvgRenderer>
#include <QGraphicsSvgItem>
#include "QGIViewSymbol.h"
#include "QGIView.h"
namespace TechDraw {
class DrawViewSpreadsheet;
@ -42,24 +34,17 @@ namespace TechDrawGui
class TechDrawGuiExport QGIViewSpreadsheet : public QGIViewSymbol
{
Q_OBJECT
public:
QGIViewSpreadsheet();
~QGIViewSpreadsheet() = default;
enum {Type = QGraphicsItem::UserType + 124};
int type() const { return Type;}
int type() const override { return Type;}
//void updateView(bool update = false);
void setViewFeature(TechDraw::DrawViewSpreadsheet *obj);
protected:
//void drawSvg();
protected:
};
} // namespace MDIViewPageGui
} // end namespace TechDrawGui
#endif // DRAWINGGUI_QGRAPHICSITEMVIEWSPREADSHEET_H

View File

@ -148,4 +148,3 @@ bool QGIViewSymbol::load(QByteArray *svgBytes)
return(success);
}
#include "moc_QGIViewSymbol.cpp"

View File

@ -43,8 +43,6 @@ namespace TechDrawGui
class TechDrawGuiExport QGIViewSymbol : public QGIView
{
Q_OBJECT
public:
QGIViewSymbol();
~QGIViewSymbol();
@ -58,10 +56,6 @@ public:
virtual void draw() override;
virtual QRectF boundingRect() const override;
Q_SIGNALS:
void hover(bool state);
void selected(bool state);
protected:
bool load(QByteArray *svgString);
virtual void drawSvg();