qmlfrontend/preview_image_provider.h
author Wuzzy <Wuzzy2@mail.ru>
Thu, 10 Jan 2019 19:09:06 +0100
changeset 14564 78363dbfd5dc
parent 14175 8354b390f1a2
permissions -rw-r--r--
Prevent wind bar from overflowing with high wind values Wind flow overflow does not happen normally, but might be triggered when calling SetWind with extreme values (>100 or <-100). Allows for silly wind experiments in scripts.

#ifndef PREVIEWIMAGEPROVIDER_H
#define PREVIEWIMAGEPROVIDER_H

#include <QPixmap>
#include <QQuickImageProvider>
#include <QSize>

class PreviewImageProvider : public QQuickImageProvider {
 public:
  PreviewImageProvider();

  QPixmap requestPixmap(const QString &id, QSize *size,
                        const QSize &requestedSize);

  void setImage(const QImage &preview);

 private:
  QPixmap m_px;
};

#endif  // PREVIEWIMAGEPROVIDER_H