PDA

View Full Version : Window appears as a popup window and not as main window..



rickrvo
14th February 2011, 11:25
Hi,

I've created an application and on Qt simulator it opens as a main window, but on the n900 it opens as popup window... How do I make it appear as a fixed window with the X (close) option?

MainDialog is the class with the form that I've created, here is my code:


main.cpp

int main(int argc, char *argv[]) {
QApplication *app = new QApplication(argc, argv);

MainWindow * mw = new MainWindow(NULL);

return app->exec();
}

mainwindow.h


class mainDialog;
class MainWindow : public MainWindowInterface
{
Q_OBJECT
public:
MainWindow(QWidget *_parent);
...
private:
mainDialog *m_dialog;
...
};

mainwindow.cpp

MainWindow::MainWindow(QWidget *_parent) :
_studentName(""),
_studentHostname(""),
_teacherName(""),
_className(""),
_lastStudentName(""),
_lastStudentHostname(""),
_lastTeacherName(""),
_lastClassName(""),
_teacherHostname("")
{
iNetworkInfoLoaded = false;
iBasicStudentLoaded = false;
iSFTLoaded = false;
iSQLoaded = false;
iSCLoaded = false;

mainDialog maindlg ( _parent, this );
maindlg.setWindowTitle( tr( "My app" ) );
maindlg.setWindowIcon(QPixmap( ":/resources/logo.png" ));
m_dialog = &maindlg;


loadPlugins();
maindlg.exec();
}

maindialog.h

namespace Ui {
class mainDialog;
}

class MainWindow;

class mainDialog : public QDialog
{
Q_OBJECT
public:
explicit mainDialog( QWidget * _parent, MainWindow * _parentMW );
virtual ~mainDialog();

public slots:
void aboutPlugins( void );
void setEnableButton( QString button, bool option );
void setSessionInfo(QString studentName,QString teacherName, QString classroomName);

private:
MainWindow * mw;

Ui::mainDialog *ui;
};

maindialog.cpp

mainDialog::mainDialog(QWidget * _parent, MainWindow * _parentMW) :
QDialog( _parent ),
mw(_parentMW),
ui(new Ui::mainDialog)
{
ui->setupUi(this);
...
}

rickrvo
17th February 2011, 11:59
anyone? please this is urgent... I can't get it to work... tried making the mainwindow a main window and got errors with some plugins classes... :confused:

BalaQT
17th February 2011, 12:30
hi,
try with windowflags

Bala