#include"mainwindow.h"
MainWindow::MainWindow(QWidget* parent, const char* name)
:QWidget(parent, name){
_filemenu = new QPopupMenu(this, "filemenu");
_filemenu->insertItem("&Open");
_filemenu->insertItem("&Save");
_filemenu->insertSeparator();
_filemenu->insertItem("&Quit", qApp, SLOT(quit()), ALT+Key_F4);
_helpmenu = new QPopupMenu(this, "helpmenu");
_helpmenu->insertItem("&About", this, SLOT(about()));
_helpmenu->insertItem("About Qt", this, SLOT(aboutQt()));
_menu = new QMenuBar(this, "menubar");
_menu->insertItem("&File", _filemenu);
_menu->insertItem("&Help", _helpmenu);
}
void MainWindow::about(){
QMessageBox::about( this, "About this program",
"This is a program for tutorial.\n"
"Copyright Dai Kaibazawa" );
}
void MainWindow::aboutQt(){
QMessageBox::aboutQt(this, "About Qt");
}