PDA

View Full Version : Switching Calculator Exhibition Mode (Classic to Advanced)



lgb3
29th September 2011, 19:16
Hello everybody,

I'm pretty new to Qt programming and I'm trying to create a more robust calculator based on the one from Qt's Tutorial. Right now, I'm trying to figure out how to implement different exhibition modes in the same application (e.g open the default basic calculator with just arithmetic operations but having an option in the menu to switch to advanced, which shows some other operations like cos,sin,sqrt,etc) . I guess I could do that with dynamic Widgets creation, but is there any other simpler way for doing that ?

Thanks in advance,

Luiz.

Added after 8 minutes:

Well, just after posting this I found the solution : that would be using QStackedWidgets (http://doc.qt.nokia.com/latest/qstackedwidget.html#details) which create different "pages" of widgets in a single application, in a way similar to "Tabs". In that way you can organize the "titles" for each of those pages in a class like QListWidget. I'll try to implement that on my project.

Luiz.

Zlatomir
29th September 2011, 19:20
Other option (i think better) is to create a dialog that can change it's "shape" into an advanced dialog, see this example (http://doc.trolltech.com/4.7/dialogs-extension.html).