|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
#include <QCloseEvent>
|
|
|
|
|
#include <QMenuBar>
|
|
|
|
|
|
|
|
|
|
#include "viewmanager.hpp"
|
|
|
|
|
|
|
|
|
@ -13,11 +14,25 @@ void CSVDoc::View::closeEvent (QCloseEvent *event)
|
|
|
|
|
event->ignore();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVDoc::View::setupUi()
|
|
|
|
|
{
|
|
|
|
|
// window menu
|
|
|
|
|
QMenu *view = menuBar()->addMenu (tr ("&View"));
|
|
|
|
|
|
|
|
|
|
QAction *newWindow = new QAction (tr ("&New View"), this);
|
|
|
|
|
connect (newWindow, SIGNAL (triggered()), this, SLOT (newView()));
|
|
|
|
|
|
|
|
|
|
view->addAction (newWindow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document)
|
|
|
|
|
: mViewManager (viewManager), mDocument (document)
|
|
|
|
|
{
|
|
|
|
|
setCentralWidget (new QWidget);
|
|
|
|
|
resize (200, 200);
|
|
|
|
|
setWindowTitle ("New Document");
|
|
|
|
|
|
|
|
|
|
setupUi();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const CSMDoc::Document *CSVDoc::View::getDocument() const
|
|
|
|
@ -28,4 +43,9 @@ const CSMDoc::Document *CSVDoc::View::getDocument() const
|
|
|
|
|
CSMDoc::Document *CSVDoc::View::getDocument()
|
|
|
|
|
{
|
|
|
|
|
return mDocument;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVDoc::View::newView()
|
|
|
|
|
{
|
|
|
|
|
mViewManager.addView (mDocument);
|
|
|
|
|
}
|