#include <QEvent>
#include <QDialog>
+#include <QMenuBar>
#include "ViewBase.h"
#include "PopUpMessageBox.h"
#include <QtDebug>
WindowManager::WindowManager( QWidget *aParent ) :
- QWidget( aParent ),
+ QMainWindow( aParent ),
iApplicationName( tr( "Qt Meetings" ) ),
iCurrentView( 0 )
{
this->setWindowTitle( iApplicationName );
+ settingsAction = new QAction(tr("&Settings"), this);
+ closeAction = new QAction(tr("&Close"), this);
+ connect(settingsAction, SIGNAL(triggered()), this, SIGNAL(showSettingsClicked()));
+ connect(closeAction, SIGNAL(triggered()), this, SIGNAL(closeClicked()));
+ editMenu = menuBar()->addMenu(tr("&Edit"));
+ editMenu->addAction(settingsAction);
+ menuBar()->addMenu(editMenu);
+ menuBar()->addAction(closeAction);
}
WindowManager::~WindowManager()
iCurrentView = view;
connect( iCurrentView, SIGNAL( eventDetected() ), this, SLOT( viewEventDetected() ) );
connect( this, SIGNAL( viewResized(const QSize &, const QSize &) ), iCurrentView, SLOT( viewResized( const QSize &, const QSize & ) ) );
- view->resize( this->size() );
-
+ if (((QWidget*)view) != this)
+ {
+ this->adjustSize();
+ }
+ view->resize(this->size());
+ //view->adjustSize();
view->show();
// Disconnect old connections and hide the view