33 #if QT_VERSION >= 0x050000 37 #include <QResizeEvent> 48 , Mover_ ([view] (const QPoint&
pos) { view->move (
pos); })
51 view->installEventFilter (
this);
52 Refit (view->size ());
55 #if QT_VERSION >= 0x050000 59 , Mover_ ([window] (
const QPoint&
pos) { window->setPosition (pos); })
62 window->installEventFilter (
this);
63 Refit (window->size ());
72 auto re =
static_cast<QResizeEvent*
> (event);
77 void AutoResizeMixin::Refit (
const QSize& size)
UTIL_GUI_API AutoResizeMixin(const QPoint &point, RectGetter_f rect, QWidget *widget)
Constructs the resize mixin.
detail::ExprTree< detail::ExprType::LeafStaticPlaceholder, boost::mpl::int_< Idx >> pos
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.
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.