QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgspixmaplabel.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  ----------------------------------------------------
4  date : 7.9.2015
5  copyright : (C) 2015 by Matthias Kuhn
6  email : matthias (at) opengis.ch
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSPIXMAPLABEL_H
17 #define QGSPIXMAPLABEL_H
18 
19 #include <QLabel>
20 
25 class GUI_EXPORT QgsPixmapLabel : public QLabel
26 {
27  Q_OBJECT
28 
29  public:
30  explicit QgsPixmapLabel( QWidget *parent = nullptr );
37  virtual int heightForWidth( int width ) const override;
38 
44  virtual QSize sizeHint() const override;
45 
46  public slots:
47  void setPixmap( const QPixmap & );
48  void resizeEvent( QResizeEvent * ) override;
49  private:
50  QPixmap mPixmap;
51 };
52 
53 #endif // QGSPIXMAPLABEL_H
virtual int heightForWidth(int w) const
void setPixmap(const QPixmap &)
virtual QSize sizeHint() const
virtual void resizeEvent(QResizeEvent *event)
The QgsPixmapLabel class shows a pixmap and adjusts its size to the space given to the widget by the ...