#include <PaintWidget.h>
Inherits QWidget.
Inherited by MultiWidget.
|
| QObject * | addItem (QObject *object) |
| |
| QObject * | addPoints (const QList< int > &points_x, const QList< int > &points_y, int groupNr, const QColor &color) |
| |
| QObject * | addText (int xPos, int yPos, int groupNr, const QString &text) |
| |
| QObject * | addLine (int xPos, int yPos, int groupNr, const QColor &color, int endX, int endY) |
| |
| QObject * | addEllipse (int xPos, int yPos, int groupNr, const QColor &color, int width, int height) |
| |
| QObject * | addRectangle (int xPos, int yPos, int groupNr, const QColor &color, int width, int height) |
| |
| QObject * | addPolyline (int groupNr, const QColor &color, const QList< QPoint > &points) |
| |
| QObject * | addPolygon (int groupNr, const QColor &color, const QList< QPoint > &points) |
| |
| QObject * | removeItem (QObject *drawItem, bool delete_object) |
| |
| void | removeAllItems (bool delete_objects) |
| |
Definition at line 7 of file PaintWidget.h.
| PaintWidget::PaintWidget |
( |
QWidget * |
parent | ) |
|
| PaintWidget::~PaintWidget |
( |
| ) |
|
| QObject * PaintWidget::addEllipse |
( |
int |
xPos, |
|
|
int |
yPos, |
|
|
int |
groupNr, |
|
|
const QColor & |
color, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
slot |
Adds an ellipse to the image and all successive images. the elipse will be drawn within an outlying rectangle specified.
The ellipse will not be filles and the border will have the minimum width.
- Parameters
-
| xPos | the top left x position of the rectangle |
| yPos | the top left y position of the rectangle |
| groupNr | teh group number |
| color | the color of the ellipses border |
| width | the width of the rectangle |
| height | the height of the rectangle |
- Returns
- pointer to a #seeDrawItem to remove the ellipse afterwards
Definition at line 46 of file PaintWidget.cc.
52 items.push_back(item);
| QObject * PaintWidget::addItem |
( |
QObject * |
object | ) |
|
|
slot |
Adds a shape to the image
- Parameters
-
| drawItem | teh itrem which to draw. keep the item given to remove it afterwards |
Definition at line 85 of file PaintWidget.cc.
91 items.push_back(drawItem);
| QObject * PaintWidget::addLine |
( |
int |
xPos, |
|
|
int |
yPos, |
|
|
int |
groupNr, |
|
|
const QColor & |
color, |
|
|
int |
endX, |
|
|
int |
endY |
|
) |
| |
|
slot |
Adds a line to the images and all successive images
- Parameters
-
| xPos | the starting x position |
| yPos | the starting y position |
| groupNr | the group number |
| color | the color of the line |
| endX | the ending x position |
| endY | the ending y position |
- Returns
- pointer to a #seeDrawItem to remove the line afterwards
Definition at line 36 of file PaintWidget.cc.
42 items.push_back(item);
| QObject * PaintWidget::addPoints |
( |
const QList< int > & |
points_x, |
|
|
const QList< int > & |
points_y, |
|
|
int |
groupNr, |
|
|
const QColor & |
color |
|
) |
| |
|
slot |
| QObject * PaintWidget::addPolygon |
( |
int |
groupNr, |
|
|
const QColor & |
color, |
|
|
const QList< QPoint > & |
points |
|
) |
| |
|
slot |
Adds a Polygon with the given points. An additional line will be drawn between the last and the first poin t given. Polygons can be filles unlike Polylines
- Parameters
-
| groupNr | the group number |
| color | the color of the lines |
| points | the points of the polygon |
| numberOfPoints | the number of points in the points array |
- Returns
- a DrawItem containing the Polygon
Definition at line 75 of file PaintWidget.cc.
81 items.push_back(item);
| QObject * PaintWidget::addPolyline |
( |
int |
groupNr, |
|
|
const QColor & |
color, |
|
|
const QList< QPoint > & |
points |
|
) |
| |
|
slot |
Adds multiple lines
- Parameters
-
| groupNr | the number of the group |
| color | the color of the lines |
| points | the points weher a line starts/ends |
| numberOfPoints | the number of points in the points array |
- Returns
- pointer to a DrawItem
Definition at line 65 of file PaintWidget.cc.
71 items.push_back(item);
| QObject * PaintWidget::addRectangle |
( |
int |
xPos, |
|
|
int |
yPos, |
|
|
int |
groupNr, |
|
|
const QColor & |
color, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
slot |
Adds a rectangle to the image and all successive images. The rectangle will not be filles and the border will have the minimum width.
- Parameters
-
| xPos | the top left x position of the rectangle |
| yPos | the top left y position of the rectangle |
| groupNr | the group number |
| color | the color of the rectangles border |
| width | the width of the rectangle Adds a rectangle to the image and all successive images. The rectangle will not be filles and the border will have the minimum width. |
| xPos | the top left x position of the rectangle |
| yPos | the top left y position of the rectangle |
| groupNr | the group number |
| color | the color of the rectangles border |
| width | the width of the rectangle |
| height | the height of the rectangle |
- Returns
- pointer to a #seeDrawItem to remove the ellipse afterwards
Definition at line 56 of file PaintWidget.cc.
62 items.push_back(item);
| QObject * PaintWidget::addText |
( |
int |
xPos, |
|
|
int |
yPos, |
|
|
int |
groupNr, |
|
|
const QString & |
text |
|
) |
| |
|
slot |
Adds a Text to the image and all successive images
- Parameters
-
| xPos | the starting x position |
| yPos | the starting y position |
| groupNr | the group number |
| text | the text to be displayed |
- Returns
- pointer to a #seeDrawItem to remove the text afterwards.
Definition at line 27 of file PaintWidget.cc.
32 items.push_back(textItem);
| void PaintWidget::drawDrawItemsToImage |
( |
QImage & |
image, |
|
|
bool |
all = false |
|
) |
| |
|
protected |
Adds all shapes to the image
- Parameters
-
| shownImage | teh iamge to add the shapes to |
| void PaintWidget::drawDrawItemsToPainter |
( |
QPainter & |
painter, |
|
|
bool |
all = false |
|
) |
| |
|
protected |
Definition at line 134 of file PaintWidget.cc.
139 QRectF target = painter.viewport();
143 painter.setRenderHint(QPainter::TextAntialiasing,
true);
144 QList<DrawItem*>::iterator iter =
items.begin();
145 for(;iter !=
items.end();++iter)
148 if(!(*iter)->onOpenGL() || all ==
true)
149 (*iter)->draw(&painter,target,target);
| void PaintWidget::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
protected |
| void PaintWidget::removeAllItems |
( |
bool |
delete_objects | ) |
|
|
slot |
Removes all shapes from the iamges
Definition at line 116 of file PaintWidget.cc.
120 QList<DrawItem*>::iterator iter =
items.begin();
121 for(;iter !=
items.end();++iter)
| QObject * PaintWidget::removeItem |
( |
QObject * |
drawItem, |
|
|
bool |
delete_object |
|
) |
| |
|
slot |
Remobves a shape from the image
- Parameters
-
| drawItem | the shape to remove |
Definition at line 104 of file PaintWidget.cc.
107 items.removeAll(draw_item);
| QList<int> PaintWidget::disabledGroups |
|
protected |
List of group numbers currently disabled
Definition at line 129 of file PaintWidget.h.
| bool PaintWidget::isOpenGL |
|
protected |
The format used in the widget List of all Draw Items
Definition at line 127 of file PaintWidget.h.
The documentation for this class was generated from the following files:
- /build/rock-master-18.09-gui-rock-widget-collection-0.20180124/src/generic_widgets/PaintWidget.h
- /build/rock-master-18.09-gui-rock-widget-collection-0.20180124/src/generic_widgets/PaintWidget.cc