2

I am a bit puzzled here. In Qt Designer QWebEngineView is available but not in Qt Creator. The version of Qt is 5.10.1. in Windows 10.

I want to create a Dialog box that loads a webpage inside. But I can't do it in Creator. And if I make it in Designer then in Creator the QWebEngineView do not show up. I didn't find anything in the Doc :/

Is there a workaround this? Thank you for your help.

Qt Creator and Qt Designer

Mohammad Kanan
  • 4,452
  • 10
  • 23
  • 47
azenkwed
  • 21
  • 2
  • 1
    Possible duplicate of [QtCreator 4.1.0 dosn't show webengineview(QT 5.7) for MainWindow form editor](https://stackoverflow.com/questions/40673412/qtcreator-4-1-0-dosnt-show-webengineviewqt-5-7-for-mainwindow-form-editor) – Mohammad Kanan Apr 06 '18 at 16:07

1 Answers1

2

QWebEngineView is not available in Qt Creator as a drag and drop widget, but you can promote QWebEngineView to another widget through the Qt Creator. Just drop a QWidget for example in your Qt Creator and right-click and select Promote.

You also allocate QWebEngineView in the parent of any widget.

  1. Drag and drop a QWidget in your Qt Creator

Allocate QWebEngineView as parent of QWidget.

QWebEngineView *view = new QWebEngineView(ui->widget);
view->load(QUrl("http://qt-project.org/"));
view->show();
user3606329
  • 2,405
  • 1
  • 16
  • 28