Search code examples
c++qtsymbian

Handling Multiple windows in Symbian using Qt


I am new to Symbian development(also in c++). i want to create a multiple window application in Symbian. for that I want to push a another screen from current screen. I try like this

In MainWindow.cpp

void MainWindow::on_pushButton_clicked()
{
    // HERE I WANT TO PUSH SECOND WINDOW
    secondwindow sec;

    sec.showFullScreen();
}

The secondwindow.cpp is

secondwindow::secondwindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::secondwindow)
{
    ui->setupUi(this);
}

secondwindow::~secondwindow()
{
   delete ui;
}

But on clicking on pushbutton in mainwindow It not showing the secondscreen. please guide me how to handle multiple screens in symbian.

Thanks


Solution

  • The scope of your variable is limited to the function, and your object is created on the stack. Which means it is going to be invalid when the function return.Additionally, in Qt you must create all subclasses of QObject dynamically when they are not top level. If you are new in Qt, I recommend you to follow advices listed in this Qt forum thread

    A good starting point for learning is on the Qt website