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:

Qt Code:
  1. main.cpp
  2.  
  3. int main(int argc, char *argv[]) {
  4. QApplication *app = new QApplication(argc, argv);
  5.  
  6. MainWindow * mw = new MainWindow(NULL);
  7.  
  8. return app->exec();
  9. }
  10.  
  11. mainwindow.h
  12.  
  13.  
  14. class mainDialog;
  15. class MainWindow : public MainWindowInterface
  16. {
  17. Q_OBJECT
  18. public:
  19. MainWindow(QWidget *_parent);
  20. ...
  21. private:
  22. mainDialog *m_dialog;
  23. ...
  24. };
  25.  
  26. mainwindow.cpp
  27.  
  28. MainWindow::MainWindow(QWidget *_parent) :
  29. _studentName(""),
  30. _studentHostname(""),
  31. _teacherName(""),
  32. _className(""),
  33. _lastStudentName(""),
  34. _lastStudentHostname(""),
  35. _lastTeacherName(""),
  36. _lastClassName(""),
  37. _teacherHostname("")
  38. {
  39. iNetworkInfoLoaded = false;
  40. iBasicStudentLoaded = false;
  41. iSFTLoaded = false;
  42. iSQLoaded = false;
  43. iSCLoaded = false;
  44.  
  45. mainDialog maindlg ( _parent, this );
  46. maindlg.setWindowTitle( tr( "My app" ) );
  47. maindlg.setWindowIcon(QPixmap( ":/resources/logo.png" ));
  48. m_dialog = &maindlg;
  49.  
  50.  
  51. loadPlugins();
  52. maindlg.exec();
  53. }
  54.  
  55. maindialog.h
  56.  
  57. namespace Ui {
  58. class mainDialog;
  59. }
  60.  
  61. class MainWindow;
  62.  
  63. class mainDialog : public QDialog
  64. {
  65. Q_OBJECT
  66. public:
  67. explicit mainDialog( QWidget * _parent, MainWindow * _parentMW );
  68. virtual ~mainDialog();
  69.  
  70. public slots:
  71. void aboutPlugins( void );
  72. void setEnableButton( QString button, bool option );
  73. void setSessionInfo(QString studentName,QString teacherName, QString classroomName);
  74.  
  75. private:
  76. MainWindow * mw;
  77.  
  78. Ui::mainDialog *ui;
  79. };
  80.  
  81. maindialog.cpp
  82.  
  83. mainDialog::mainDialog(QWidget * _parent, MainWindow * _parentMW) :
  84. QDialog( _parent ),
  85. mw(_parentMW),
  86. ui(new Ui::mainDialog)
  87. {
  88. ui->setupUi(this);
  89. ...
  90. }
To copy to clipboard, switch view to plain text mode