namespace { class Tooltip : public Wt::WText { public: Tooltip() : Wt::WText( "widget" ) { setDeferredToolTip( true, Wt::TextFormat::XHTML); } virtual Wt::WString toolTip() const override { return "this is it"; } }; class TestDiaDeferredToolTip : public Wt::WApplication { public: TestDiaDeferredToolTip( const Wt::WEnvironment& env ) : Wt::WApplication( env ) { setCssTheme( "polished" ); auto x = root()->addNew< Tooltip >(); auto b = root()->addNew< Wt::WPushButton >( "open dia" ); b->clicked().connect( [=] { Wt::WDialog dia; dia.setWindowTitle( "dia" ); dia.setClosable( true ); dia.contents()->addNew< Tooltip >(); dia.exec(); }); } }; }