#pragma once #include #include class QEvent; class QLabel; class QShowEvent; class QResizeEvent; class InpaintPreviewDialog final : public QDialog { Q_OBJECT public: explicit InpaintPreviewDialog(const QString& title, QWidget* parent = nullptr); void setImages(const QImage& before, const QImage& after); protected: void resizeEvent(QResizeEvent* e) override; void showEvent(QShowEvent* e) override; bool eventFilter(QObject* watched, QEvent* event) override; private: void updateScaledPreviews(); QLabel* m_beforeLabel = nullptr; QLabel* m_afterLabel = nullptr; QImage m_beforeImg; QImage m_afterImg; bool m_inUpdateScaledPreviews = false; };