开发者

cant exchange widget in QSplitter (Qt)

I have a QSplitter with two widgets. One of them is static, the other one is supposed to change on the press of a button. But the problem is the widget does not change?

I have a pointer for the widget that is changing - this->content

The widget to switch to is in the pointer named widget.

Here's a code snippet where I switch the widget:

qDebug() << "before: " << this->content;
this->content = widget;
qDebug() << "after: " << this->content;
this->content->update();
this->content->repaint();

My debug output there ve开发者_JAVA技巧rifies that the pointer points to the other widget:

before:  QLineEdit(0x363850)
after:   SCTableView(0x3644c0)

Trying to make it show by calling update() and repaint(), without any success.

Any ideas?


Problem solved. Got help from some people in #qt on freenode. Thanks. I forgot to call setVisible(true) on this->content after switching to the new widget.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜