开发者

Qt - new widget display not apparent?

I'm coming from Android d开发者_运维百科evelopment, and their approach to opening a new "activity" from a current one seems logical, and documented. Qt's does not.

Let's say I have the exact "QTabsExample", and inside one of these tabs is a button. On button click, I want to get rid of all the tabs and open a different view...let's say an image view. Why does there not seem to be one example out there for this? Please help!


I believe you would want to use a QStackedWidget in this case. A QStackedWidget manages a number of same sized "screens" that you can switch between, each having its own set of display widgets and buttons. Here is an S60 example, hopefully it will apply to your situation but you should be able to find more info on using QStackedWidgets.


If you want to remove the container of the widget a better solution is to send a signal to the window and the window will then swap the main containers, otherwise things can get nasty if you try to delete / remove the parent object from the child action method.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜