22 this->setMinimumSize( 1, 1 );
27 bool sizeChanged = ( p.size() != mPixmap.size() );
35 QLabel::setPixmap( mPixmap.scaled( this->size(),
36 Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
41 if ( mPixmap.isNull() )
44 return ( ( qreal )mPixmap.height() * width ) / mPixmap.width();
49 if ( mPixmap.isNull() )
52 int w = this->width();
58 QLabel::resizeEvent( e );
59 QLabel::setPixmap( mPixmap.scaled( this->size(),
60 Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
QSize sizeHint() const override
An optimal size for the widget.
void setPixmap(const QPixmap &)
int heightForWidth(int width) const override
Calculates the height for the given width.
void resizeEvent(QResizeEvent *) override
QgsPixmapLabel(QWidget *parent=nullptr)
Constructor for QgsPixmapLabel.