- UID
- 1029342
- 性别
- 男
|
void MyMainWidget::newFile()
{
statuslabel->setText(MyMainWidget::tr("File has been created!") );
statusBar()->clear();
statusBar()->message(MyMainWidget::tr("created") );
}
void MyMainWidget:penFile()
{
statuslabel->setText(MyMainWidget::tr("File has been opened!") );
statusBar()->clear();
statusBar()->message(MyMainWidget::tr("Opened") );
}
void MyMainWidget::saveFile()
{
statuslabel->setText(MyMainWidget::tr("File has been saved!") );
statusBar()->clear();
statusBar()->message( MyMainWidget::tr("Saved") );
}
void MyMainWidget::exitMain()
{
QApplication::exit();
}
void MyMainWidget::copyFile()
{
statuslabel->setText(MyMainWidget::tr("File has been copyed!") );
statusBar()->clear();
statusBar()->message(MyMainWidget::tr("copyed") );
}
main.cpp
#include <qapplication.h>
#include "mainwidget.h"
int main(int argc, char **argv)
{
QApplication app(argc,argv);
app.setFont(QFont("unifont",16,50));
QTranslator translator( 0 );
translator.load(QString("hello_CN.qm"),".");
app.installTranslator( &translator);
MyMainWidget *mymainwidget = new MyMainWidget(0);
mymainwidget->setGeometry(10,30,280,200);
app.setMainWidget(mymainwidget);
mymainwidget->show();
return app.exec();
} |
|