Project

General

Profile

Bug #7669 » 0001-Fix-WPopupWidget-use-in-examples-with-addWidget.patch

Bruce Toll, 07/28/2020 10:29 PM

View differences:

examples/composer/Composer.C
/*
* Addressbook suggestions popup
*/
contactSuggestions_ = layout_->addWidget(cpp14::make_unique<ContactSuggestions>());
contactSuggestions_ = layout_->addChild(cpp14::make_unique<ContactSuggestions>());
contactSuggestions_->forEdit(toEdit_);
contactSuggestions_->forEdit(ccEdit_);
examples/planner/EntryDialog.C
auto descriptionPtr = cpp14::make_unique<WTextArea>();
description_ = t->bindWidget("description", std::move(descriptionPtr));
TimeSuggestions* suggestions = contents()->addWidget(cpp14::make_unique<TimeSuggestions>());
TimeSuggestions* suggestions = contents()->addChild(cpp14::make_unique<TimeSuggestions>());
suggestions->forEdit(start_);
suggestions->forEdit(stop_);
src/Wt/WContainerWidget.h
class WApplication;
class StdLayoutImpl;
class WPopupWidget;
/*! \class WContainerWidget Wt/WContainerWidget.h Wt/WContainerWidget.h
* \brief A widget that holds and manages child widgets.
......
Widget *addWidget(std::unique_ptr<Widget> widget)
#ifndef WT_TARGET_JAVA
{
static_assert(!std::is_convertible<Widget*, WPopupWidget*>::value,
"Cannot use addWidget() for types derived from WPopupWidget. "
"Did you mean to use addChild()?");
Widget *result = widget.get();
addWidget(std::unique_ptr<WWidget>(std::move(widget)));
return result;
......
Widget *insertBefore(std::unique_ptr<Widget> widget, WWidget *before)
#ifndef WT_TARGET_JAVA
{
static_assert(!std::is_convertible<Widget*, WPopupWidget*>::value,
"Cannot use insertBefore() for types derived from WPopupWidget. "
"Did you mean to use addChild()?");
Widget *result = widget.get();
insertBefore(std::unique_ptr<WWidget>(std::move(widget)), before);
return result;
......
Widget *insertWidget(int index, std::unique_ptr<Widget> widget)
#ifndef WT_TARGET_JAVA
{
static_assert(!std::is_convertible<Widget*, WPopupWidget*>::value,
"Cannot use insertWidget() for types derived from WPopupWidget. "
"Did you mean to use addChild()?");
Widget *result = widget.get();
insertWidget(index, std::unique_ptr<WWidget>(std::move(widget)));
return result;
(1-1/3)