Fix bug if document owns several views

This commit is contained in:
wmayer 2012-04-04 13:02:44 +02:00
parent eb55a5a5d5
commit 238750d3e4
2 changed files with 6 additions and 0 deletions

View File

@ -860,8 +860,13 @@ void Application::tryClose(QCloseEvent * e)
// ask all documents if closable // ask all documents if closable
std::map<const App::Document*, Gui::Document*>::iterator It; std::map<const App::Document*, Gui::Document*>::iterator It;
for (It = d->documents.begin();It!=d->documents.end();It++) { for (It = d->documents.begin();It!=d->documents.end();It++) {
// a document may have several views attached, so ask it directly
#if 0
MDIView* active = It->second->getActiveView(); MDIView* active = It->second->getActiveView();
e->setAccepted(active->canClose()); e->setAccepted(active->canClose());
#else
e->setAccepted(It->second->canClose());
#endif
if (!e->isAccepted()) if (!e->isAccepted())
return; return;
} }

View File

@ -826,6 +826,7 @@ void Document::createView(const char* sType)
.arg(QString::fromUtf8(name)).arg(d->_iWinCount++); .arg(QString::fromUtf8(name)).arg(d->_iWinCount++);
view3D->setWindowTitle(title); view3D->setWindowTitle(title);
view3D->setWindowModified(this->isModified());
view3D->setWindowIcon(QApplication::windowIcon()); view3D->setWindowIcon(QApplication::windowIcon());
view3D->resize(400, 300); view3D->resize(400, 300);
getMainWindow()->addWindow(view3D); getMainWindow()->addWindow(view3D);