sparentprocess 클래스 추가
git-svn-id: svn://192.168.0.12/source@300 8346c931-da38-4b9b-9d4c-e48b93cbd075
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
#include <QSettings>
|
||||
#include <QSqlDatabase>
|
||||
#include <QMessageBox>
|
||||
#include <QRegExp>
|
||||
|
||||
extern QString ERROR_MESSAGE[];
|
||||
|
||||
void databaseSetting(const QString &str)
|
||||
{
|
||||
QSettings settings("effect.ini");
|
||||
@@ -28,3 +32,29 @@ void messageBoxError(const QString &title, const QString &body)
|
||||
QMessageBox messagebox(QMessageBox::Critical, title, body);
|
||||
messagebox.exec();
|
||||
}
|
||||
|
||||
QString errorCodeToString(E_ERROR_CODE _error_code)
|
||||
{
|
||||
if (0 <= static_cast<int>(_error_code) &&
|
||||
static_cast<int>(_error_code) < static_cast<int>(E_ERROR_CODE::MAX))
|
||||
return ERROR_MESSAGE[static_cast<int>(_error_code)];
|
||||
else
|
||||
return ERROR_MESSAGE[static_cast<int>(E_ERROR_CODE::UNKNOWN_ERROR)];
|
||||
}
|
||||
|
||||
E_ERROR_CODE strErrorCodeToEnumErrorCode(const QString& _str)
|
||||
{
|
||||
static QRegExp re("^[\\D]");
|
||||
QString str = _str.trimmed().replace(re, "");
|
||||
bool ok = false;
|
||||
int n = str.toInt(&ok);
|
||||
|
||||
if (ok && (0 <= n && n < static_cast<int>(E_ERROR_CODE::MAX)))
|
||||
{
|
||||
return static_cast<E_ERROR_CODE>(n);
|
||||
}
|
||||
else
|
||||
{
|
||||
return E_ERROR_CODE::UNKNOWN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user