QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Slots | Public Member Functions | List of all members
QgsPixmapLabel Class Reference

The QgsPixmapLabel class shows a pixmap and adjusts its size to the space given to the widget by the layout and keeping its aspect ratio. More...

#include <qgspixmaplabel.h>

Inheritance diagram for QgsPixmapLabel:
Inheritance graph
[legend]

Public Slots

void clear ()
 Clears any label contents.
 
void resizeEvent (QResizeEvent *) override
 
void setPixmap (const QPixmap &)
 

Public Member Functions

 QgsPixmapLabel (QWidget *parent=nullptr)
 Constructor for QgsPixmapLabel.
 
int heightForWidth (int width) const override
 Calculates the height for the given width.
 
QSize sizeHint () const override
 An optimal size for the widget.
 

Detailed Description

The QgsPixmapLabel class shows a pixmap and adjusts its size to the space given to the widget by the layout and keeping its aspect ratio.

Definition at line 28 of file qgspixmaplabel.h.

Constructor & Destructor Documentation

◆ QgsPixmapLabel()

QgsPixmapLabel::QgsPixmapLabel ( QWidget *  parent = nullptr)
explicit

Constructor for QgsPixmapLabel.

Definition at line 20 of file qgspixmaplabel.cpp.

Member Function Documentation

◆ clear

void QgsPixmapLabel::clear ( )
slot

Clears any label contents.

Definition at line 70 of file qgspixmaplabel.cpp.

◆ heightForWidth()

int QgsPixmapLabel::heightForWidth ( int  width) const
override

Calculates the height for the given width.

Parameters
widthThe width for the widget
Returns
An appropriate height

Definition at line 43 of file qgspixmaplabel.cpp.

◆ resizeEvent

void QgsPixmapLabel::resizeEvent ( QResizeEvent *  e)
overrideslot

Definition at line 60 of file qgspixmaplabel.cpp.

◆ setPixmap

void QgsPixmapLabel::setPixmap ( const QPixmap &  p)
slot

Definition at line 25 of file qgspixmaplabel.cpp.

◆ sizeHint()

QSize QgsPixmapLabel::sizeHint ( ) const
override

An optimal size for the widget.

Effectively using the height determined from the width with the given aspect ratio.

Returns
A size hint

Definition at line 51 of file qgspixmaplabel.cpp.


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