12#include <QResizeEvent>
21 , Rect_ (std::move (size))
23 view->installEventFilter (
this);
24 Refit (
view->size ());
31 , Rect_ (std::move (size))
33 window->installEventFilter (
this);
39 if (
event->type () != QEvent::Resize)
47 void AutoResizeMixin::Refit (
const QSize& size)
std::function< QRect()> RectGetter_f
A function type used to get the rect to fit widget in.
UTIL_GUI_API AutoResizeMixin(const QPoint &point, RectGetter_f rect, QWidget *widget)
Constructs the resize mixin.
bool eventFilter(QObject *, QEvent *) override
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.
Container< T > Filter(const Container< T > &c, F f)