equal
deleted
inserted
replaced
48 { |
48 { |
49 mdiArea = new QMdiArea; |
49 mdiArea = new QMdiArea; |
50 mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
50 mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
51 mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
51 mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
52 setCentralWidget(mdiArea); |
52 setCentralWidget(mdiArea); |
53 connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow *)), |
53 connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), |
54 this, SLOT(updateMenus())); |
54 this, SLOT(updateMenus())); |
55 windowMapper = new QSignalMapper(this); |
55 windowMapper = new QSignalMapper(this); |
56 connect(windowMapper, SIGNAL(mapped(QWidget *)), |
56 connect(windowMapper, SIGNAL(mapped(QWidget*)), |
57 this, SLOT(setActiveSubWindow(QWidget *))); |
57 this, SLOT(setActiveSubWindow(QWidget*))); |
58 |
58 |
59 createActions(); |
59 createActions(); |
60 createMenus(); |
60 createMenus(); |
61 createToolBars(); |
61 createToolBars(); |
62 createStatusBar(); |
62 createStatusBar(); |
69 } |
69 } |
70 |
70 |
71 void MainWindow::closeEvent(QCloseEvent *event) |
71 void MainWindow::closeEvent(QCloseEvent *event) |
72 { |
72 { |
73 mdiArea->closeAllSubWindows(); |
73 mdiArea->closeAllSubWindows(); |
74 if (activeMdiChild()) { |
74 if (mdiArea->currentSubWindow()) { |
75 event->ignore(); |
75 event->ignore(); |
76 } else { |
76 } else { |
77 writeSettings(); |
77 writeSettings(); |
78 event->accept(); |
78 event->accept(); |
79 } |
79 } |