Example #1
0
void InnerDropdown::setOwnedWidget(TWidget *widget) {
	connect(widget, SIGNAL(heightUpdated()), this, SLOT(onWidgetHeightUpdated()));
	auto container = _scroll->setOwnedWidget(object_ptr<Container>(_scroll, widget, _st));
	container->resizeToWidth(_scroll->width());
	container->moveToLeft(0, 0);
	container->show();
	widget->show();
}
Example #2
0
void InnerDropdown::setOwnedWidget(ScrolledWidget *widget) {
	auto container = new internal::Container(_scroll, widget, _st);
	connect(container, SIGNAL(heightUpdated()), this, SLOT(onWidgetHeightUpdated()));
	_scroll->setOwnedWidget(container);
	container->resizeToWidth(_scroll->width());
	container->moveToLeft(0, 0);
	container->show();
	widget->show();
}
QPointer<TWidget> InnerDropdown::doSetOwnedWidget(object_ptr<TWidget> widget) {
	auto result = QPointer<TWidget>(widget);
	connect(widget, SIGNAL(heightUpdated()), this, SLOT(onWidgetHeightUpdated()));
	auto container = _scroll->setOwnedWidget(object_ptr<Container>(_scroll, std::move(widget), _st));
	container->resizeToWidth(_scroll->width());
	container->moveToLeft(0, 0);
	container->show();
	result->show();
	return result;
}