rock_widget_collection  0.1
PaintWidget.h
Go to the documentation of this file.
1 #ifndef PAINT_WIDGET_H
2 #define PAINT_WIDGET_H
3 
4 #include <QWidget>
5 #include <DrawItem.h>
6 
7 class PaintWidget : public QWidget{
8  Q_OBJECT
9 
10 public:
11  PaintWidget(QWidget *parent);
12  ~PaintWidget();
13 
14 
15 public slots:
16 
21  QObject* addItem(QObject* object);
22  QObject* addPoints(const QList<int> &points_x,const QList<int> &points_y,int groupNr, const QColor &color);
31  QObject* addText(int xPos, int yPos, int groupNr, const QString &text);
32 
43  QObject* addLine(int xPos, int yPos, int groupNr, const QColor &color, int endX, int endY);
44 
57  QObject* addEllipse(int xPos, int yPos, int groupNr, const QColor &color, int width, int height);
58 
80  QObject* addRectangle(int xPos, int yPos, int groupNr, const QColor &color, int width, int height);
81 
90  QObject* addPolyline(int groupNr, const QColor &color, const QList<QPoint> &points);
91 
101  QObject* addPolygon(int groupNr, const QColor &color, const QList<QPoint> &points);
102 
107  QObject* removeItem(QObject* drawItem,bool delete_object);
108 
112  void removeAllItems(bool delete_objects);
113 
114 
115 protected:
120  void drawDrawItemsToImage(QImage &image,bool all=false);
121  void drawDrawItemsToPainter(QPainter &painter,bool all=false);
122  void paintEvent(QPaintEvent *event);
123 
124 
127  QList<DrawItem*> items;
129  QList<int> disabledGroups;
130  bool isOpenGL;
131 
132 };
133 
134 #endif
QObject * addItem(QObject *object)
Definition: PaintWidget.cc:85
QList< DrawItem * > items
Definition: PaintWidget.h:127
QObject * addPolyline(int groupNr, const QColor &color, const QList< QPoint > &points)
Definition: PaintWidget.cc:65
void paintEvent(QPaintEvent *event)
Definition: PaintWidget.cc:128
QObject * addLine(int xPos, int yPos, int groupNr, const QColor &color, int endX, int endY)
Definition: PaintWidget.cc:36
QObject * addPoints(const QList< int > &points_x, const QList< int > &points_y, int groupNr, const QColor &color)
Definition: PaintWidget.cc:95
void drawDrawItemsToImage(QImage &image, bool all=false)
PaintWidget(QWidget *parent)
Definition: PaintWidget.cc:16
QObject * addText(int xPos, int yPos, int groupNr, const QString &text)
Definition: PaintWidget.cc:27
QObject * removeItem(QObject *drawItem, bool delete_object)
Definition: PaintWidget.cc:104
QObject * addPolygon(int groupNr, const QColor &color, const QList< QPoint > &points)
Definition: PaintWidget.cc:75
QList< int > disabledGroups
Definition: PaintWidget.h:129
void drawDrawItemsToPainter(QPainter &painter, bool all=false)
Definition: PaintWidget.cc:134
QObject * addRectangle(int xPos, int yPos, int groupNr, const QColor &color, int width, int height)
Definition: PaintWidget.cc:56
QObject * addEllipse(int xPos, int yPos, int groupNr, const QColor &color, int width, int height)
Definition: PaintWidget.cc:46
void removeAllItems(bool delete_objects)
Definition: PaintWidget.cc:116