maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Why it isn't stackable window? (https://talk.maemo.org/showthread.php?t=43563)

Figa 2010-02-06 11:25

Why it isn't stackable window?
 
Hi I have following code:
Code:

class Window : public QWidget
{
    Q_OBJECT

public:
        Window();
};

class Main : public QWidget {
        Q_OBJECT

public:
        Main(QWidget* parent = 0);
};

Window::Window()
    : QWidget()
{

}

Main::Main(QWidget* parent) : QWidget(parent) {

}

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QApplication ::setOverrideCursor(QCursor(Qt::BlankCursor));
    Window window;
    window.show();
    Main main(&window);
    main.show();

    return app.exec();
}

Why main isn't stacked window? THX for your replies.

VDVsx 2010-02-06 12:16

Re: Why it isn't stackable window?
 
You need to use this attribute in your parent window: "setAttribute(Qt::WA_Maemo5StackedWindow);"

Here is a simple example: http://qt.nokia.com/doc/qt-maemo-4.6...edwindows.html

Figa 2010-02-06 12:44

Re: Why it isn't stackable window?
 
I donīt. When I use.
QMainWindow * window = new QMainWindow();
window->show();
QMainWindow * main = new QMainWindow(window);
main->show();

after main is stacked. Unfortunatelly I havenīt this parameter available.

VDVsx 2010-02-06 12:47

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 513078)
I donīt. When I use.
QMainWindow * window = new QMainWindow();
window->show();
QMainWindow * main = new QMainWindow(window);
main->show();

after main is stacked. Unfortunatelly I havenīt this parameter available.

Qt 4.5 or 4.6 ?

Figa 2010-02-06 13:05

Re: Why it isn't stackable window?
 
I have QT 4.5

VDVsx 2010-02-06 13:57

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 513094)
I have QT 4.5

Ok, so: http://wiki.maemo.org/Qt4_Hildon#Stackable_windows

Figa 2010-02-06 14:03

Re: Why it isn't stackable window?
 
THX , but i know it. I don't know why it doesn't work. Please look on my code.
QMainWindow * window = new QMainWindow();
window->show();
QMainWindow * main = new QMainWindow(window);
main->show();

is the same as

Window window;
window.show();
Main main(&window);
main.show();

VDVsx 2010-02-06 14:15

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 513138)
THX , but i know it. I don't know why it doesn't work. Please look on my code.
QMainWindow * window = new QMainWindow();
window->show();
QMainWindow * main = new QMainWindow(window);
main->show();

is the same as

Window window;
window.show();
Main main(&window);
main.show();

Well, without the proper attribute is normal that this doesn't work, please read the link that I posted above everything is explained there.

Try this:

QMainWindow * window = new QMainWindow();
window->show();
QMainWindow * main = new QMainWindow(window);
main->setAttribute(Qt::WA_Maemo5StackedWindow);
main->show();

Figa 2010-02-06 14:32

Re: Why it isn't stackable window?
 
I can't use this atribut because he is unavailable. This works.
QMainWindow * window = new QMainWindow();
window->show();
QMainWindow * main = new QMainWindow(window);
main->show();

VDVsx 2010-02-06 14:41

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 513168)
I can't use this atribut because he is unavailable. This works.
QMainWindow * window = new QMainWindow();
window->show();
QMainWindow * main = new QMainWindow(window);
main->show();

Are you compiling your app for Maemo ? inside scratchbox ?

Figa 2010-02-06 15:00

Re: Why it isn't stackable window?
 
Yes, I am.

VDVsx 2010-02-06 15:04

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 513189)
Yes, I am.

Paste the error here, I never used Qt 4.5 in maemo only 4.6, but that works for sure.

Figa 2010-02-06 15:20

Re: Why it isn't stackable window?
 
I am not sure if i use qt4.6 How Can i check this? This is the error.
'WA_Maemo5StackedWindow' is not a member of 'Qt'

VDVsx 2010-02-06 15:23

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 513203)
I am not sure if i use qt4.6 How Can i check this? This is the error.
'WA_Maemo5StackedWindow' is not a member of 'Qt'

Try with:

#include <QtMaemo5>

Figa 2010-02-06 15:46

Re: Why it isn't stackable window?
 
I can't include it.

VDVsx 2010-02-06 16:10

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 513227)
I can't include it.

Well, without the exact error is a bit hard to guess, but probably you don't have all the packages needed. Please read the links that I've posted here and perhaps is better install Qt 4.6, since is more compatible with Maemo5.

Figa 2010-02-06 17:42

Re: Why it isn't stackable window?
 
Thank you. I have a eclipse. What upgrade to qt 4.6?

VDVsx 2010-02-06 18:20

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 513315)
Thank you. I have a eclipse. What upgrade to qt 4.6?

http://wiki.maemo.org/Qt4_Hildon#Ins..._in_Scratchbox

Figa 2010-02-06 20:26

Re: Why it isn't stackable window?
 
I installed qtlib4-maemo5-dev and I get this error 'WA_Maemo5StackedWindow' is not a member of 'Qt' in eclipse. What is wrong?

VDVsx 2010-02-06 23:47

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 513486)
I installed qtlib4-maemo5-dev and I get this error 'WA_Maemo5StackedWindow' is not a member of 'Qt' in eclipse. What is wrong?

Probably your setup is not correctly configured or some packages are missing. Did you followed the instructions in the page that I posted here ?
You also need, at least, 'qtlib4-maemo5-maemo5', try also to compile your app directly under scratchbox to see if the problem is in your esbox setup, don't forget to use qmake under '/opt/qt4-maemo5/bin/qmake' since you're running Qt 4.6.

nilsbenson 2010-02-07 06:58

Re: Why it isn't stackable window?
 
QWidget is not typically meant to be a "full window". In 4.5 you will have to use a QMainWindow to get proper stacking. Make sure you either inherit from it, or use your QWidget derived class with one (via setCentralWidget()).

Figa 2010-02-07 09:37

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by VDVsx (Post 513775)
Probably your setup is not correctly configured or some packages are missing. Did you followed the instructions in the page that I posted here ?
You also need, at least, 'qtlib4-maemo5-maemo5', try also to compile your app directly under scratchbox to see if the problem is in your esbox setup, don't forget to use qmake under '/opt/qt4-maemo5/bin/qmake' since you're running Qt 4.6.

I have installed 'qtlib4-maemo5-maemo5' . Probably I have a problem in esbox and eclipse, because after install qt 4.6 in scratcbox, eclipse installed qt 4.5.3 . Can you help me with setting esbox and eclipse? Excuse for my stupid question. Thank you very much.

Figa 2010-02-10 22:03

Re: Why it isn't stackable window?
 
Can you help me with settings Qt 4.6 in esbox and eclipse,please?

VDVsx 2010-02-10 22:48

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 520230)
Can you help me with settings Qt 4.6 in esbox and eclipse,please?

Sorry I don't use esbox, can't help you, try to read the esbox documentation, if you still can't configure it, start a new thread on this topic.

Figa 2010-02-11 21:32

Re: Why it isn't stackable window?
 
Thank you for everything. Can I ask for you? What are you using for development?

VDVsx 2010-02-11 21:43

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 521951)
Thank you for everything. Can I ask for you? What are you using for development?

Qt Creator as IDE(best Qt IDE IMHO) and the Maemo SDK(scratchbox) as a compiler, but there's also MADDE[1].

[1] - http://wiki.maemo.org/MADDE

Figa 2010-02-12 10:08

Re: Why it isn't stackable window?
 
THX i have qt creator how set a scratchbox for build?

VDVsx 2010-02-12 12:11

Re: Why it isn't stackable window?
 
Quote:

Originally Posted by Figa (Post 522714)
THX i have qt creator how set a scratchbox for build?

At least the version that I've doesn't support direct built inside scratchbox(should be supported in the future).
What I do is, I use Qt Creator as a IDE only, and keep a scratchbox console open all the time where I compile the program(make) and run it. Usually I test the programs directly in the device that is connected using ssh.
Is not a simple setup, but everyone have personal preferences ;)

Sasler 2010-02-12 18:42

Re: Why it isn't stackable window?
 
This worked for me. But I didn't need this line:
Code:

win2->setAttribute(Qt::WA_Maemo5StackedWindow);
I'm using Qt 4.5.


All times are GMT. The time now is 00:21.

vBulletin® Version 3.8.8