telsale-management/代码/telsale_aux_kit/source/main.cpp

66 lines
1.3 KiB
C++
Raw Normal View History

2018-06-01 10:21:26 +00:00
//#include <QTextCodec>
2018-06-02 09:47:28 +00:00
2018-06-01 10:21:26 +00:00
#include <QtWidgets/QtWidgets>
#include <QtWidgets/QApplication>
#include <exception>
#include "QMainFrame.h"
#include "QLoginWidget.h"
2018-06-01 10:21:26 +00:00
int main( int argc, char * argv[] )
{
2018-06-01 10:21:26 +00:00
//用于编码转换
//QTextCodec * pCodecLocal = QTextCodec::codecForLocale();
2018-06-01 10:21:26 +00:00
QApplication a( argc, argv );
QLoginWidget login;
int iReturnCode = 0;
/*try
{
2018-06-01 10:21:26 +00:00
initConnectionPool();
queryParameters();
2018-06-01 10:21:26 +00:00
if ( checkVersion() == false )
{
QMessageBox::warning( NULL,
pCodecLocal->toUnicode( "版本错误" ),
pCodecLocal->toUnicode( "程序版本过低!\n请联系信息技术部更新程序!" ) );
2018-06-01 10:21:26 +00:00
return 0;
}
}
catch ( std::runtime_error & error )
{
2018-06-01 10:21:26 +00:00
releaseConnectionPool();
QMessageBox::critical( NULL,
"错误",
pCodecLocal->toUnicode( error.what() ) );
2018-06-01 10:21:26 +00:00
return iReturnCode;
}
2018-06-01 10:21:26 +00:00
catch ( std::exception & error )
{
2018-06-01 10:21:26 +00:00
releaseConnectionPool();
QMessageBox::critical( NULL,
"未知错误",
pCodecLocal->toUnicode( error.what() ) );
2018-06-01 10:21:26 +00:00
return iReturnCode;
}*/
login.exec();
if ( login.isLogin() == true )
{
QMainFrame w;
w.showMaximized();
iReturnCode = a.exec();
}
//releaseConnectionPool();
return iReturnCode;
}