开发者

how to navigate one page to another page in nokia qt C++;

hi i want to make an application for nokia in nokia qt sdk. so please help me how to navigate one page to another page in qt C++ when user开发者_如何学C press the button in one page.


There's no page concept in Qt, but you can simulate it with other widgets or components. A couple of examples:

  • Using Qt Desktop Widgets: http://wiki.forum.nokia.com/index.php/Create_a_page_based_UI_with_QStackedWidget_and_QToolbar

  • Using Qt Quick: http://doc.qt.nokia.com/4.7/declarative-modelviews-visualitemmodel.html

In Qt Quick you can also do it by changing properties like visibility or position of elements like rectangles. And there are other ways to do this, search for examples in Forum Nokia Wiki or in Qt DevNet.


Just write in click event of button:

manwindow *mainwindow2 = new mainwindow();
mainwindow2->showExpanded();


There is also the concept of a wizard in QT:
http://doc.qt.io/archives/qt-4.7/qwizard.html

I'm not sure if that is what you are looking for as far as look n feel, but it is pretty convenient. You simply add pages to the widget itself and it will create the "Next" and "Finish" buttons for you as well as the page navigation.

Beyond that, do as Mkfnx suggested and use a stack widget or just have a dynamic dialog where you subscribe to your button events (using the connect() ) function and hide/show your widgets as you wish.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜