AddWidgetTool.h
Go to the documentation of this file.
/***************************************************************************
File : AddWidgetTool.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2008 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Tool for adding enrichements to a plot.
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef ADD_WIDGET_TOOL_H
#define ADD_WIDGET_TOOL_H
#include "PlotToolInterface.h"
#include <QObject>
class QAction;
class QPoint;
class FrameWidget;
class AddWidgetTool : public QObject, public PlotToolInterface
{
Q_OBJECT
public:
enum WidgetType{
Text = 0,
TexEquation,
Rectangle,
Ellipse,
UserWidget = 1000
};
AddWidgetTool(WidgetType type, Graph *graph, QAction *d_action, const QObject *status_target = NULL, const char *status_slot = "");
virtual ~AddWidgetTool();
virtual int rtti() const {return PlotToolInterface::Rtti_AddWidgetTool;};
WidgetType widgetType(){return d_widget_type;};
signals:
void statusText(const QString&);
protected:
void addEllipse(const QPoint& point);
void addRectangle(const QPoint& point);
void addEquation(const QPoint& point);
void addText(const QPoint& point);
void addWidget(const QPoint& point);
virtual bool eventFilter(QObject *obj, QEvent *event);
QAction *d_action;
WidgetType d_widget_type;
FrameWidget *d_fw;
};
#endif // ifndef ADD_WIDGET_TOOL_H
AddWidgetTool::addEquation
void addEquation(const QPoint &point)
Definition: AddWidgetTool.cpp:107
AddWidgetTool
Definition: AddWidgetTool.h:43
AddWidgetTool::~AddWidgetTool
virtual ~AddWidgetTool()
Definition: AddWidgetTool.cpp:81
AddWidgetTool::d_action
QAction * d_action
Definition: AddWidgetTool.h:77
Graph
A 2D-plotting widget.
Definition: Graph.h:123
AddWidgetTool::Rectangle
Definition: AddWidgetTool.h:50
AddWidgetTool::d_fw
FrameWidget * d_fw
Definition: AddWidgetTool.h:79
PlotToolInterface::Rtti_AddWidgetTool
Definition: PlotToolInterface.h:73
AddWidgetTool::addText
void addText(const QPoint &point)
Definition: AddWidgetTool.cpp:126
AddWidgetTool::Text
Definition: AddWidgetTool.h:48
AddWidgetTool::d_widget_type
WidgetType d_widget_type
Definition: AddWidgetTool.h:78
AddWidgetTool::Ellipse
Definition: AddWidgetTool.h:51
FrameWidget
Definition: FrameWidget.h:38
AddWidgetTool::eventFilter
virtual bool eventFilter(QObject *obj, QEvent *event)
Definition: AddWidgetTool.cpp:202
AddWidgetTool::UserWidget
Definition: AddWidgetTool.h:52
AddWidgetTool::statusText
void statusText(const QString &)
AddWidgetTool::addRectangle
void addRectangle(const QPoint &point)
Definition: AddWidgetTool.cpp:150
AddWidgetTool::TexEquation
Definition: AddWidgetTool.h:49
AddWidgetTool::rtti
virtual int rtti() const
Definition: AddWidgetTool.h:58
AddWidgetTool::AddWidgetTool
AddWidgetTool(WidgetType type, Graph *graph, QAction *d_action, const QObject *status_target=NULL, const char *status_slot="")
Definition: AddWidgetTool.cpp:45
PlotToolInterface.h
PlotToolInterface
Definition: PlotToolInterface.h:60
AddWidgetTool::WidgetType
WidgetType
Definition: AddWidgetTool.h:47
AddWidgetTool::addWidget
void addWidget(const QPoint &point)
Definition: AddWidgetTool.cpp:182
AddWidgetTool::addEllipse
void addEllipse(const QPoint &point)
Definition: AddWidgetTool.cpp:166
AddWidgetTool::widgetType
WidgetType widgetType()
Returns the type of widget to be added.
Definition: AddWidgetTool.h:60