Engauge Digitizer 2
Loading...
Searching...
No Matches
DlgImportCroppingNonPdf.h
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef DLG_IMPORT_CROPPING_NON_PDF_H
8#define DLG_IMPORT_CROPPING_NON_PDF_H
9
10#include <QDialog>
11#include <QImage>
12#include <QObject>
13
14class NonPdfCropping;
15class QGraphicsPixmapItem;
16class QGridLayout;
17class QGraphicsScene;
18class QRectF;
19class QSpinBox;
20class QString;
21class ViewPreview;
22
24class DlgImportCroppingNonPdf : public QDialog
25{
26 Q_OBJECT;
27
28public:
30 DlgImportCroppingNonPdf (const QString &fileName);
31 virtual ~DlgImportCroppingNonPdf ();
32
34 QImage image () const;
35
37 virtual void showEvent (QShowEvent *event);
38
39private slots:
40
42 void slotCancel();
43
45 void slotOk ();
46
47private:
49
50 void createNonPdfCropping();
51 void createPreview (QGridLayout *layout,
52 int &row);
53 void finishPanel (QWidget *subPanel);
54 void initializeFrameGeometryAndPixmap ();
55 QImage loadImage () const;
56
58 static int MINIMUM_DIALOG_WIDTH;
59
61 static int MINIMUM_PREVIEW_HEIGHT;
62
63 void saveGeometryToSettings ();
64 void updatePreview ();
65
66 QPushButton *m_btnCancel;
67 QPushButton *m_btnOk;
68
69 const QString &m_fileName;
70 QImage m_image; // Needed so it can be passed to external code when this dialog has finished successfully
71 QGraphicsPixmapItem *m_pixmap; // Needed so old image can be removed just before new one gets added
72
73 QGraphicsScene *m_scenePreview;
74 ViewPreview *m_viewPreview;
75
76 NonPdfCropping *m_nonPdfCropping;
77};
78
79#endif // DLG_IMPORT_CROPPING_NON_PDF_H
virtual void showEvent(QShowEvent *event)
Do preparation before dialog is displayed.
QImage image() const
Image that was selected. Value is null if loading failed.
DlgImportCroppingNonPdf(const QString &fileName)
Single constructor.
This class shows a frame around the selected portion of the import preview window.
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window,...
Definition ViewPreview.h:15