Commit a850ff9a authored by Alexander A. Maly's avatar Alexander A. Maly

Clearing warnings in IsometricRobot

parent e3a37c9c
......@@ -13,20 +13,13 @@ CellGraphicsItem::CellGraphicsItem(
const QPolygonF &polyEast,
const QPolygonF &polyNorth,
const QPolygonF &polyWest,
bool editable,
int cellX,
int cellY,
RobotView *view,
QGraphicsItem *parent
) :
QGraphicsPolygonItem(poly, parent),
p_south(polySouth),
p_east(polyEast),
p_north(polyNorth),
p_west(polyWest),
i_cellX(cellX),
i_cellY(cellY),
m_view(view)
p_west(polyWest)
{
}
......
......@@ -17,27 +17,21 @@ public:
const QPolygonF &polyEast,
const QPolygonF &polyNorth,
const QPolygonF &polyWest,
bool editable,
int cellX,
int cellY,
RobotView *view,
QGraphicsItem *parent = 0
);
protected:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void paint(
QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget
);
private:
//int whichWall(const QPointF &p) const;
QPolygonF p_south;
QPolygonF p_east;
QPolygonF p_north;
QPolygonF p_west;
bool b_editable;
int i_cellX;
int i_cellY;
RobotView *m_view;
};
} // namespace Robot25D
......
......@@ -466,11 +466,12 @@ QBrush RobotView::wallBrush()
return QBrush(QColor("sandybrown"), Qt::Dense4Pattern);
}
QRectF RobotView::createEmptyCell(int x, int y,
bool painted, bool pointed,
bool isBorder)
{
QRectF RobotView::createEmptyCell(
int x, int y,
bool painted,
bool pointed,
bool isBorder
) {
qreal x1_isometric = CellSize * x;
qreal y1_isometric = CellSize * y;
qreal z1_isometric = 0.0;
......@@ -555,28 +556,16 @@ QRectF RobotView::createEmptyCell(int x, int y,
east << mapToIsometricCoordinates(x2_isometric + CellSize / 4, y3_isometric, z3_isometric);
east << mapToIsometricCoordinates(x2_isometric - CellSize / 4, y4_isometric, z4_isometric);
QPolygonF polygon(points);
QPolygonF ps(south);
QPolygonF pe(east);
QPolygonF pn(north);
QPolygonF pw(west);
int cellX = -1, cellY = -1;
if (x != -1 && y != -1) {
cellX = x;
cellY = y;
}
if (y >= _model->field().size() || x >= _model->field()[0].size()) {
cellX = -1;
cellY = -1;
}
CellGraphicsItem *result = new CellGraphicsItem(polygon, ps, pe, pn, pw,
false,
cellX, cellY,
this);
CellGraphicsItem *result = new CellGraphicsItem(
polygon,
ps, pe, pn, pw
);
_allItems << result;
result->setParentItem(this);
......@@ -611,8 +600,6 @@ QRectF RobotView::createEmptyCell(int x, int y,
points[2] = mapToIsometricCoordinates(CellSize * (x + 1) - OFFSET, CellSize * (y + 1) - OFFSET, 0);
points[3] = mapToIsometricCoordinates(CellSize * x + OFFSET, CellSize * (y + 1) - OFFSET, 0);
QAbstractGraphicsShapeItem *item = new QGraphicsPolygonItem(QPolygonF(points));
item->setBrush(QColor(255, 255, 255, 100));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment