22 this->setMinimumSize( 1, 1 );
27 bool sizeChanged = ( p.size() != mPixmap.size() );
35 QLabel::setPixmap( mPixmap.scaled( this->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
40 if ( mPixmap.isNull() )
43 return ( ( qreal )mPixmap.height() * width ) / mPixmap.width();
48 if ( mPixmap.isNull() )
51 int w = this->width();
57 QLabel::resizeEvent( e );
58 if ( !mPixmap.isNull() )
61 QLabel::setPixmap( mPixmap.scaled( this->size() -= QSize( 1, 1 ), Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
void clear()
Clears any label contents.
int heightForWidth(int width) const override
Calculates the height for the given width.
QSize sizeHint() const override
An optimal size for the widget.
void resizeEvent(QResizeEvent *) override
void setPixmap(const QPixmap &)
QgsPixmapLabel(QWidget *parent=nullptr)
Constructor for QgsPixmapLabel.