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 ?


All times are GMT. The time now is 06:43.

vBulletin® Version 3.8.8