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

66 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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