2015-07-26 21:39:49 +00:00
|
|
|
#ifndef UICOMMON
|
|
|
|
#define UICOMMON
|
|
|
|
|
2015-07-27 20:17:22 +00:00
|
|
|
#include <QMap>
|
2015-07-26 21:39:49 +00:00
|
|
|
#include <QString>
|
2015-11-24 06:08:31 +00:00
|
|
|
#include <Common/TString.h>
|
|
|
|
|
|
|
|
#define TO_QSTRING(str) UICommon::ToQString(str)
|
|
|
|
#define TO_TSTRING(str) UICommon::ToTString(str)
|
|
|
|
#define TO_TWIDESTRING(str) UICommon::ToTWideSTring(str)
|
2015-07-26 21:39:49 +00:00
|
|
|
|
2015-07-27 20:17:22 +00:00
|
|
|
namespace UICommon
|
|
|
|
{
|
|
|
|
extern QMap<QString,QString> FilterMap;
|
|
|
|
QString ExtensionFilterString(const QString& extension);
|
2015-11-24 06:08:31 +00:00
|
|
|
|
|
|
|
// TString/TWideString <-> QString
|
|
|
|
inline QString ToQString(const TString& str)
|
|
|
|
{
|
|
|
|
return QString::fromStdString(str.ToStdString());
|
|
|
|
}
|
|
|
|
|
|
|
|
inline QString ToQString(const TWideString& str)
|
|
|
|
{
|
|
|
|
return QString::fromStdWString(str.ToStdString());
|
|
|
|
}
|
|
|
|
|
|
|
|
inline TString ToTString(const QString& str)
|
|
|
|
{
|
|
|
|
return TString(str.toStdString());
|
|
|
|
}
|
|
|
|
|
|
|
|
inline TWideString ToTWideString(const QString& str)
|
|
|
|
{
|
|
|
|
return TWideString(str.toStdWString());
|
|
|
|
}
|
2015-07-27 20:17:22 +00:00
|
|
|
}
|
2015-07-26 21:39:49 +00:00
|
|
|
|
|
|
|
#endif // UICOMMON
|
|
|
|
|