33 #include <QResizeEvent> 43 , Mover_ ([view] (const QPoint& pos) { view->move (pos); })
46 view->installEventFilter (
this);
47 Refit (view->size ());
53 , Mover_ ([window] (const QPoint& pos) { window->setPosition (pos); })
56 window->installEventFilter (
this);
57 Refit (window->size ());
65 auto re =
static_cast<QResizeEvent*
> (event);
70 void AutoResizeMixin::Refit (
const QSize& size)
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.
UTIL_GUI_API AutoResizeMixin(const QPoint &point, RectGetter_f rect, QWidget *widget)
Constructs the resize mixin.
std::function< QRect()> RectGetter_f
A function type used to get the rect to fit widget in.
bool eventFilter(QObject *, QEvent *)
Listens for resize events and refits the widget.