Skip to content

Studio/src/Utils/ImageLabel.h

Namespaces

Name
shapeworks

Classes

Name
class shapeworks::ImageLabel
An extention of QLabel especially for scaled images.

Source code

#pragma once

#include <QLabel>
#include <QResizeEvent>

namespace shapeworks {

class ImageLabel : public QLabel {
 public:
  ImageLabel(QWidget *parent) : QLabel(parent) {}
  void setPixmap(const QPixmap &pixmap) { setPixmap(pixmap, size()); }

 protected:
  void resizeEvent(QResizeEvent *reisze_event) override;

 private:
  void setPixmap(const QPixmap &pixmap, const QSize &size);

 private:
  QPixmap pixmap_;
};

}  // namespace shapeworks

Updated on 2022-07-23 at 16:40:07 -0600