35 lines
601 B
C++
35 lines
601 B
C++
#pragma once
|
|
|
|
#include <QDialog>
|
|
#include <QImage>
|
|
#include <QRect>
|
|
|
|
class QLabel;
|
|
class QPushButton;
|
|
|
|
class ImageCropDialog final : public QDialog {
|
|
Q_OBJECT
|
|
public:
|
|
explicit ImageCropDialog(const QString& imagePath, QWidget* parent = nullptr);
|
|
|
|
bool hasValidSelection() const;
|
|
QRect selectedRectInImagePixels() const;
|
|
|
|
private slots:
|
|
void onReset();
|
|
void onOk();
|
|
|
|
private:
|
|
void loadImageOrClose();
|
|
void rebuildUi();
|
|
|
|
private:
|
|
class CropView;
|
|
CropView* m_view = nullptr;
|
|
QPushButton* m_okButton = nullptr;
|
|
|
|
QString m_imagePath;
|
|
QImage m_image;
|
|
};
|
|
|