Walls And Holes  1
MapView Class Reference

The MapView class Handles display of TileMap. More...

#include <mapview.h>

Inheritance diagram for MapView:
Collaboration diagram for MapView:

Signals

void cellActivated (int x, int y, QMouseEvent *event)
 Emitted when the left mouse button is down over a new cell. More...
 
void cellClicked (int x, int y, QMouseEvent *event)
 Emitted the first time the left mouse button is pressed over a cell. More...
 
void cellReleased (int x, int y, QMouseEvent *event)
 Emitted when the left mouse button is released over a cell. More...
 
void cellHovered (int x, int y, QMouseEvent *event)
 Emitted when the mouse hovers over a new cell. More...
 
void mouseExitedMap (QMouseEvent *event)
 Emitted when the mouse exits the map. More...
 
void mapViewChanged (QRectF rect)
 mapViewChanged More...
 

Public Member Functions

 MapView (QWidget *parent)
 
 ~MapView ()
 
void clear ()
 
void setMap (TileMap *tileMap)
 
void setViewMode (int viewMode)
 
TileMapPreviewGraphicsItempreviewItem ()
 
QRectF tilesInFrame () const
 tilesInFrame More...
 

Protected Member Functions

void wheelEvent (QWheelEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void resizeEvent (QResizeEvent *) override
 

Detailed Description

The MapView class Handles display of TileMap.

Constructor & Destructor Documentation

◆ MapView()

MapView::MapView ( QWidget *  parent)

◆ ~MapView()

MapView::~MapView ( )

Member Function Documentation

◆ cellActivated

void MapView::cellActivated ( int  x,
int  y,
QMouseEvent *  event 
)
signal

Emitted when the left mouse button is down over a new cell.

This signal is sent out when the mouse button is pressed down or when the mouse moves over a new cell while pressed down.

x and y are NOT required to be contained within the map!

Parameters
xThe cell's x position.
yThe cell's y position.
Here is the caller graph for this function:

◆ cellClicked

void MapView::cellClicked ( int  x,
int  y,
QMouseEvent *  event 
)
signal

Emitted the first time the left mouse button is pressed over a cell.

Unlike cellActivated(), this signal is sent out when the mouse button is first pressed and not sent out for other cells if the mouse is dragged afterward.

x and y are NOT required to be contained within the map!

Parameters
xThe cell's x position.
yThe cell's y position.
Here is the caller graph for this function:

◆ cellHovered

void MapView::cellHovered ( int  x,
int  y,
QMouseEvent *  event 
)
signal

Emitted when the mouse hovers over a new cell.

x and y ARE required to be contained within the map!

Parameters
xThe cell's x position.
yThe cell's y position.
Here is the caller graph for this function:

◆ cellReleased

void MapView::cellReleased ( int  x,
int  y,
QMouseEvent *  event 
)
signal

Emitted when the left mouse button is released over a cell.

x and y are NOT required to be contained within the map!

Parameters
xThe cell's x position.
yThe cell's y position.
Here is the caller graph for this function:

◆ clear()

void MapView::clear ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mapViewChanged

void MapView::mapViewChanged ( QRectF  rect)
signal

mapViewChanged

emitted whenever the map changes position relative the the frame of this widget.

Parameters
rectThe corners of this rect are the tile cords under the corners of the widget Wont necessarily be in the bounds of the map.
Here is the caller graph for this function:

◆ mouseExitedMap

void MapView::mouseExitedMap ( QMouseEvent *  event)
signal

Emitted when the mouse exits the map.

Here is the caller graph for this function:

◆ mouseMoveEvent()

void MapView::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ mousePressEvent()

void MapView::mousePressEvent ( QMouseEvent *  event)
overrideprotected

◆ mouseReleaseEvent()

void MapView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

◆ previewItem()

TileMapPreviewGraphicsItem* MapView::previewItem ( )
inline
Here is the caller graph for this function:

◆ resizeEvent()

void MapView::resizeEvent ( QResizeEvent *  )
overrideprotected
Here is the call graph for this function:

◆ setMap()

void MapView::setMap ( TileMap tileMap)
Here is the call graph for this function:

◆ setViewMode()

void MapView::setViewMode ( int  viewMode)

◆ tilesInFrame()

QRectF MapView::tilesInFrame ( ) const

tilesInFrame

The corners of the returned rect are the tile cords under the corners of the frame of this widget.

Returns
Here is the caller graph for this function:

◆ wheelEvent()

void MapView::wheelEvent ( QWheelEvent *  event)
overrideprotected
Here is the call graph for this function:

The documentation for this class was generated from the following files: