MapLibre Native for Qt
Loading...
Searching...
No Matches
QMapLibre::GLWidget Class Reference

A simple OpenGL widget that displays a QMapLibre::Map. More...

#include <QMapLibreWidgets/GLWidget>

Inheritance diagram for QMapLibre::GLWidget:

Signals

void onMouseDoubleClickEvent (QMapLibre::Coordinate coordinate)
 Emitted when the user double-clicks the mouse.
 
void onMousePressEvent (QMapLibre::Coordinate coordinate)
 Emitted when the user presses the mouse.
 
void onMouseReleaseEvent (QMapLibre::Coordinate coordinate)
 Emitted when the user releases the mouse.
 
void onMouseMoveEvent (QMapLibre::Coordinate coordinate)
 Emitted when the user moves the mouse.
 

Public Member Functions

 GLWidget (const Settings &)
 
Mapmap ()
 Get the QMapLibre::Map instance.
 

Protected Member Functions

void mousePressEvent (QMouseEvent *event) override
 Mouse press event handler.
 
void mouseReleaseEvent (QMouseEvent *event) override
 Mouse release event handler.
 
void mouseMoveEvent (QMouseEvent *event) override
 Mouse move event handler.
 
void wheelEvent (QWheelEvent *event) override
 Mouse wheel event handler.
 
void initializeGL () override
 Initializes the map and sets up default settings.
 
void paintGL () override
 Renders the map.
 

Detailed Description

A simple OpenGL widget that displays a QMapLibre::Map.

The widget is intended as a standalone map viewer in a Qt Widgets application. It owns its own instance of QMapLibre::Map that is rendered to the widget.

Constructor & Destructor Documentation

◆ GLWidget()

QMapLibre::GLWidget::GLWidget ( const Settings & settings)
explicit

Default constructor

Member Function Documentation

◆ initializeGL()

void QMapLibre::GLWidget::initializeGL ( )
overrideprotected

Initializes the map and sets up default settings.

This function is called internally by Qt when the widget is initialized.

◆ paintGL()

void QMapLibre::GLWidget::paintGL ( )
overrideprotected

Renders the map.

This function is called internally by Qt when the widget needs to be redrawn.