![]() |
Please help about stacked windows
Hi,
I'm trying to build my first complete multi-windows qt n900 application (I've already built a simple application and I was able to run it on my n900). I've installed latest version of nokia qt creator (LGPL install) downloaded from here on ubuntu lucid-64. Now I'm stuck with stacked windows: I really don't understand how to do it. I tried to code the example presented in qt creator help but I was not able to run it (WA_Maemo5StakedWindows is not a member of qt) and any other test was a failure. I have the start window with many pushbutton and I'd like each button to open a different child (stacked) window. 1) First of all, I don't know how to draw different windows (different .ui files) inside the same project 2) Second I don't know how to stack one window on another I really don't understand how to do it INSIDE QT Creator (I mean without coding everything from scratch). Should I try a different SDK? Can please someone help me? Any general indication as far as complete code example are really appreciated. Thanks in advance Michele |
Re: Please help about stacked windows
1 Attachment(s)
For adding new UI files you just need to go to Add New... and select Qt/Qt Designer Form Class (see pic). It adds a new .ui file and skeletons for header and source.
What comes to stacked windows I think you need to verify that also each widget inside the new window has the Qt::WA_Maemo5StackedWindow property set. Otherwise the window will open as a normal window. |
Re: Please help about stacked windows
Thanks a lot.
But I'm still having some problem. 1) Now I have two windows - one called Finestra01 and the other Finestra02 ("finestra" in italian means window...) 2) I've manually included Finestra02 header in Finestra01.cpp to make Finestra01 aware that Finestra02 exists: Code:
#include "finestra02.h" Code:
void Finestra01::on_pushButton_clicked() 4) If I add this line to Finestra01::on_pushButton_clicked() I obtain a compiler error: Code:
void Finestra01::on_pushButton_clicked() Can you tell me what's wrong? Thanks again |
Re: Please help about stacked windows
Quote:
Code:
#ifdef Q_WS_MAEMO_5 Code:
maemo5 { It won't do anything on the "simulator", which in it's current state is pretty useless IMO, but should work when compiled for the real device. In addition, you have to set the attribute on ALL of your windows, and thanks to a bug or a feature in Qt, also reset the window flag after setting it: Code:
#ifdef Q_WS_MAEMO_5 |
Re: Please help about stacked windows
Thanks.
I'm unsure on where to add the last block of code, so I've added in the costructor (if it is called so...): Code:
Finestra01::Finestra01(QWidget *parent) : However nothing happens in the simulator (only a glitch...), you mean that if I run the application on my N900 I should see something working better? Thanks again Michele |
Re: Please help about stacked windows
Quote:
Yes, you'll have to run it on the N900 to see it working. |
Re: Please help about stacked windows
Quote:
Thank you very much. However, I ask myself why all this small pieces of code are not included by default in the templates by QT Creator when I create a Maemo 5 application... I'll let you know how my tests evolve. |
Re: Please help about stacked windows
A very good link and explanation about stacked windows:
http://doc.qt.nokia.com/qt-maemo-4.6...edwindows.html |
Re: Please help about stacked windows
Quote:
|
All times are GMT. The time now is 12:14. |
vBulletin® Version 3.8.8