31 #include <QDeclarativeView>
32 #include <QResizeEvent>
46 View_->installEventFilter (
this);
48 Refit (View_->size ());
56 auto re =
static_cast<QResizeEvent*
> (event);
61 void AutoResizeMixin::Refit (
const QSize& size)
UTIL_GUI_API AutoResizeMixin(const QPoint &point, RectGetter_f rect, QWidget *widget)
Constructs the resize mixin.
bool eventFilter(QObject *, QEvent *)
Listens for resize events and refits the widget.
QPoint FitRect(QPoint pos, const QSize &size, const QRect &geometry, FitFlags flags, const QPoint &shiftAdd)
Tries to fit a rectangle (like a dialog or popup) into geometry.
std::function< QRect()> RectGetter_f
A function type used to get the rect to fit widget in.