17 void updateWidgetPosition();
24 : QAbstractScrollArea()
36 verticalScrollBar()->setValue(0);
37 verticalScrollBar()->setValue(0);
42void MyScrollArea::updateWidgetPosition()
45 int hvalue = horizontalScrollBar()->value();
46 int vvalue = verticalScrollBar()->value();
49 widget->
move(topLeft.
x() - hvalue, topLeft.
y() - vvalue);
57 updateWidgetPosition();
60void MyScrollArea::updateArea()
66 verticalScrollBar()->setPageStep(areaSize.
height());
67 horizontalScrollBar()->setPageStep(areaSize.
width());
68 verticalScrollBar()->setRange(0, widgetSize.
height() - areaSize.
height());
69 horizontalScrollBar()->setRange(0, widgetSize.
width() - areaSize.
width());
70 updateWidgetPosition();
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
The QResizeEvent class contains event parameters for resize events.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
GLfloat GLfloat GLfloat w
[0]
view viewport() -> scroll(dx, dy, deviceRect)