Results 1 to 3 of 3

Thread: Window appears as a popup window and not as main window..

  1. #1
    Join Date
    Dec 2010
    Posts
    71
    Thanks
    26
    Platforms
    Windows

    Default Window appears as a popup window and not as main window..

    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 

  2. #2
    Join Date
    Dec 2010
    Posts
    71
    Thanks
    26
    Platforms
    Windows

    Default Re: Window appears as a popup window and not as main window..

    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...

  3. #3
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Window appears as a popup window and not as main window..

    hi,
    try with windowflags

    Bala

  4. The following user says thank you to BalaQT for this useful post:

    rickrvo (11th March 2011)

Similar Threads

  1. Replies: 3
    Last Post: 23rd December 2010, 06:55
  2. Replies: 2
    Last Post: 4th August 2010, 19:10
  3. Replies: 9
    Last Post: 16th May 2010, 16:21
  4. Replies: 2
    Last Post: 10th December 2009, 07:01
  5. Replies: 11
    Last Post: 11th August 2008, 09:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.