Sizing QWebView with expanding window

2019-08-15 05:22发布

How would i go about sizing the QWebView window with the size of the window? Right now i see i can only give it certain dimensions, but how can i make it 100% width and 100% height, and change as i make a window bigger or smaller?

Basically if i was to resize, it would resize the QWebview as well. How do i go about this?

I see there is size dimensions but i dont see how to have it resize based on the window app.

look here

标签: qt qwebview
1条回答
姐就是有狂的资本
2楼-- · 2019-08-15 05:32

Add your QWebView inside a layout.

QWebView *webView = new QWebView;
QVBoxLayout *layout = new QVBoxLayout;
this->centralWidget()->setLayout(layout);
layout->addWidget(webView);

You can read more about layout management here.

查看更多
登录 后发表回答