maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   QT and back button (https://talk.maemo.org/showthread.php?t=34323)

hopbeat 2009-11-12 11:17

QT and back button
 
Hello,


I'm using Qt with C++ for Maemo 5.

I would like to make similar effect as in, for example, contacts app: after clicking a button (contact), new pane appears (slides in) and the close button (right corner) changes to back button.

Is it possible to do with Qt? If yes, what is the architecture of the panes?

Any references or examples would be appreciated.

pelago 2009-11-12 11:57

Re: QT and back button
 
I believe in Maemo these are called "stacked windows". I don't know how to do this, but I've seen a video a couple of weeks ago demonstrating stacked windows in a Maemo 5 Qt app, so it must be possible.

conny 2009-11-12 12:24

Re: QT and back button
 
I think you should use the new "technology preview" Qt packages:
http://qt.nokia.com/developer/qt-for-maemo-developers
http://maemo.org/packages/view/libqt4-maemo5-dev

attila77 2009-11-12 12:25

Re: QT and back button
 
I believe it is done automatically if you set the original QMainWindow as the parent to a new window, but I have not yet used it so take this with a grain of salt.

conny 2009-11-12 12:30

Re: QT and back button
 
Also have a look here:
http://wiki.maemo.org/Qt4_Hildon/Qt_Hildon_Widgets

Those panes are originally called "HildonStackableWindows", not sure how to exactly use that with Qt. But from the wiki pages it looks like itīs possible...

hopbeat 2009-11-12 13:00

Re: QT and back button
 
Thanks for all those answers.

I have found this:
http://qt.gitorious.org/+qt-maemo-de...7137ce63afe602

so I will give it a try.

timoph 2009-11-12 13:10

Re: QT and back button
 
there's QStackedLayout in Qt but i'm not sure if it shows the transition animations. I haven't tried it with Fremantle.

hopbeat 2009-11-12 13:16

Re: QT and back button
 
This works:

Code:

QApplication app(argc, argv);
QMainWindow* window=new QMainWindow();
window->setCentralWidget(someWidget);
             
 window->show();

QMainWindow* window2=new QMainWindow(window);
window2->show();

To create a stack window, we just need to pass another QMainWindow in constructor.
When we call window2->show() we will see transition effect.
window2 will be destroyed after pressing back button.


Thanks for your help :)

danielwilms 2009-11-13 12:49

Re: QT and back button
 
Hi,

I've added some information to the Developer FAQ about Qt. Some Maemo-specific links where to find documentation.

Cheers Daniel

krk969 2010-01-13 08:46

Re: QT and back button
 
Quote:

Originally Posted by hopbeat (Post 373525)
This works:

Code:

QApplication app(argc, argv);
QMainWindow* window=new QMainWindow();
window->setCentralWidget(someWidget);
             
 window->show();

QMainWindow* window2=new QMainWindow(window);
window2->show();

To create a stack window, we just need to pass another QMainWindow in constructor.
When we call window2->show() we will see transition effect.
window2 will be destroyed after pressing back button.


Thanks for your help :)

need to do this as well to get the back button on the top right hand corner instead of the cross to make it truly stacked :D
wiki updated.

Code:

secondStackableWindow->setAttribute(Qt::WA_Maemo5StackedWindow);
cheers


All times are GMT. The time now is 16:52.

vBulletin® Version 3.8.8