mainWindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <qmenu.h>
#include <qaction.h>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
QMenu *m_menuEdit;
QAction *m_actionNew;
QAction *m_actionFullScreen;
void CreateMenuBar(); //创建菜单
void ShowStatusTitle(); //状态信息显示
};
#endif // MAINWINDOW_H
mainWindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <qkeysequence.h>
#include <qlabel.h>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
CreateMenuBar();
}
MainWindow::~MainWindow()
{
delete ui;
}
//创建菜单栏
void MainWindow::CreateMenuBar()
{
m_actionNew = new QAction(QString::fromUtf8