dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
scaledpixmaplabel.h
Go to the documentation of this file.
1 
11 /*
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20  * for more details.
21  *
22  * You should have received a copy of the GNU General Public License along
23  * with this program; if not, see <http://www.gnu.org/licenses/>
24  *
25  * Additional note on redistribution: The copyright and license notices above
26  * must be maintained in each individual source file that is a derivative work
27  * of this source file; otherwise redistribution is prohibited.
28  */
29 
30 
31 #ifndef SCALEDPIXMAPLABEL_H
32 #define SCALEDPIXMAPLABEL_H
33 
34 #include <QPixmap>
35 #include <QLabel>
36 
37 #include "utils_global.h"
38 
39 class QTCREATOR_UTILS_EXPORT ScaledPixmapLabel : public QLabel
40 {
41  Q_OBJECT
42 public:
48  explicit ScaledPixmapLabel(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
49 
55  virtual int heightForWidth(int width) const;
60  QPixmap scaledPixmap() const;
65  virtual QSize sizeHint() const;
66 
67 protected:
68  virtual void resizeEvent(QResizeEvent *event);
69 
70 public Q_SLOTS:
75  void setPixmap(const QPixmap &pixmap);
76 
77 private:
78  QPixmap fullPixmap;
79 };
80 
81 #endif
82