MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags)
:QMainWindow(parent, flags)
{
textEdit = new QTextEdit;
mywidge = new QWidget;
setCentralWidget(mywidge);
setMinimumSize(200, 200);
resize(700,400);
setWindowTitle("Main Window");
//setBackgroundRole(QPalette::Base);
QString message = "Welcome";
statusBar()->showMessage(message);
startAct = new QAction("&Start",this);
startAct->setShortcut(tr("Ctrl+S"));
startAct->setStatusTip(tr("Start the game"));
connect(startAct, SIGNAL(triggered()), this, SLOT(addLettersConsole(this)));
exitAct = new QAction("&Exit", this);
exitAct->setShortcut(tr("Ctrl+E"));
exitAct->setStatusTip(tr("exit the main window"));
connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
filemenu = menuBar()->addMenu(tr("&File"));
filemenu->addAction(startAct);
filemenu->addAction(exitAct);
//toolFile = addToolBar("File");
//toolFile->addAction(startAct);
//toolFile->addAction(exitAct);
}
void MainWindow::addLettersConsole(QMainWindow *mywidget)
{
LettersWindow *low = new LettersWindow();
mywidget->setCentralWidget(low);
}
Partager