开发者

Get a QWidget to take up the entire QMainWindow

I have a class that inherits QMainWindow and I just want it to have a webview widget and nothing else,

so here's what I tried doing for constructor:

MyWindow::MyWindow(QWidget *parent) : QMainWindow(parent)
{
    thi开发者_开发百科s->_webView = new QWebView(this);
    this->setCentralWidget(this->_webView);
}

This didnt work do I have to use some kind of layout to make this fill?


Just get rid of the QMainWindow and use QWebView as the top level widget. If you're not going to use any of the features of QMainWindow then there's no reason to use it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜