2

I'm having a really hard time creating a UWebBrowser and adding it to a UCanvas in C++. I got an equivalent blueprint working perfectly by just dropping the UWebBrowser widget into the UCanvas widget.

The UTextBlock in my example renders perfectly, but the UWebBrowser doesn't render anything at all. I've tried setting visibility & anchors, but it doesn't help.

How can I debug what's going on here?

void UWalletWidget::NativeConstruct()
{
    Super::NativeConstruct();
    auto Canvas = WidgetTree->ConstructWidget<UCanvasPanel>(UCanvasPanel::StaticClass());
    WidgetTree->RootWidget = canvas;

    auto WebWidget = WidgetTree->ConstructWidget<UWebBrowser>(UWebBrowser::StaticClass());
    canvas->AddChildToCanvas(WebWidget);
    WebWidget->LoadUrl("https://google.ca/")

    auto TextWidget = WidgetTree->ConstructWidget<UTextBlock>(UTextBlock::StaticClass());
    canvas->AddChildToCanvas(TextWidget);
    TextWidget->Text = FText::FromString(TEXT("Testing text!"));
}
Ari Lotter
  • 605
  • 8
  • 23

0 Answers0