21 setObjectName(
"MyScrollArea");
22 setContentsMargins(0, 0, 0, 0);
23 setWidgetResizable(
true);
24 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
25 setStyleSheet(
"QScrollArea#MyScrollArea {border: 0px; background-color:transparent;}");
30 QScrollArea::setWidget(w);
31 w->installEventFilter(
this);
36 QScrollBar* horizontal = horizontalScrollBar();
37 QSize result(viewport()->width(), widget()->height() + horizontal->height() * 2);
43 if (obj == widget() && ev->type() != QEvent::Resize) {
44 widget()->setMaximumWidth(viewport()->width());
45 setMaximumHeight(height() - viewport()->height() + widget()->height());
48 return QScrollArea::eventFilter(obj, ev);