BPS C++ API  2.24.4
bpspixmapwidget.h
Go to the documentation of this file.
1 
4 #ifndef BPSPIXMAPWIDGET_H
5 #define BPSPIXMAPWIDGET_H
6 
7 #include "bpsgui_global.h"
8 #include <QScrollArea>
9 
10 class QPixmap;
11 
18 {
19  Q_OBJECT
21 
22 public:
27  BpsPixmapWidget(QWidget* aParent = nullptr);
28 
30  virtual ~BpsPixmapWidget();
31  virtual QSize sizeHint() const;
33 
39  void setMargin(int aMargin);
40 
44  int margin() const;
45 
50  void setPixmap(const QPixmap& aPixmap);
51 
55  QPixmap pixmap() const;
56 
60  bool isFitBoth() const;
61 
65  bool isFitWidth() const;
66 
72  qreal zoom() const;
73 
79  void setMaxZoom(qreal aZoom);
80 
84  qreal maxZoom() const;
85 
89  void scalePixmap();
90 
91 public slots:
92 
98  void setFitBoth(bool aEnable);
99 
105  void setFitWidth(bool aEnable);
106 
112  void setZoom(qreal aZoom);
113 
117  void emitStatus();
118 
119 signals:
120 
125  void fitBothEnabled(bool aEnabled);
126 
131  void fitWidthEnabled(bool aEnabled);
132 
137  void zoomChanged(qreal aZoom);
138 };
139 
140 #endif // BPSPIXMAPWIDGET_H
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
Public include file for BPS GUI library macros.
#define BPSGUI_EXPORT
Declare class an import from the shared library.
Definition: bpsgui_global.h:22
View widget for pixmaps.
Definition: bpspixmapwidget.h:18
bool isFitWidth() const
void fitBothEnabled(bool aEnabled)
This signal is emitted when page fitting is enabled or disabled.
int margin() const
void setMargin(int aMargin)
Set the margin (pixels) to keep around the pixmap within the widget.
void fitWidthEnabled(bool aEnabled)
This signal is emitted when width fitting is enabled or disabled.
void setFitBoth(bool aEnable)
Enable/disable fitting the pixmap in both directions.
qreal maxZoom() const
void setFitWidth(bool aEnable)
Enable/disable fitting the pixmap width into the widget.
bool isFitBoth() const
void setPixmap(const QPixmap &aPixmap)
Set the pixmap to be displayed.
void setZoom(qreal aZoom)
Set the zoom factor, where 1.0 equals 100%.
void setMaxZoom(qreal aZoom)
Set the maximum zoom factor.
qreal zoom() const
Get the current zoom factor.
void scalePixmap()
Rescale the pixmap, for example after resizing, maximizing and restoring.
QPixmap pixmap() const
void zoomChanged(qreal aZoom)
This signal is emitted when the zoom factor changes.
BpsPixmapWidget(QWidget *aParent=nullptr)
Default constructor.
void emitStatus()
Emit all status signals.
virtual QSize sizeHint() const const override