2015-07-26 21:39:49 +00:00
|
|
|
#ifndef UICOMMON
|
|
|
|
#define UICOMMON
|
|
|
|
|
2015-12-15 02:07:22 +00:00
|
|
|
#include <Common/TString.h>
|
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
|
|
|
|
2016-03-28 02:26:33 +00:00
|
|
|
#define TO_QSTRING(Str) UICommon::ToQString(Str)
|
|
|
|
#define TO_TSTRING(Str) UICommon::ToTString(Str)
|
|
|
|
#define TO_TWIDESTRING(Str) UICommon::ToTWideString(Str)
|
|
|
|
#define TO_CCOLOR(Clr) CColor::Integral(Clr.red(), Clr.green(), Clr.blue(), Clr.alpha())
|
|
|
|
#define TO_QCOLOR(Clr) QColor(Clr.R * 255, Clr.G * 255, Clr.B * 255, Clr.A * 255)
|
2015-07-26 21:39:49 +00:00
|
|
|
|
2015-07-27 20:17:22 +00:00
|
|
|
namespace UICommon
|
|
|
|
{
|
|
|
|
extern QMap<QString,QString> FilterMap;
|
2016-03-27 19:09:38 +00:00
|
|
|
QString ExtensionFilterString(const QString& rkExtension);
|
2015-11-24 06:08:31 +00:00
|
|
|
|
|
|
|
// TString/TWideString <-> QString
|
2016-03-27 19:09:38 +00:00
|
|
|
inline QString ToQString(const TString& rkStr)
|
2015-11-24 06:08:31 +00:00
|
|
|
{
|
2016-03-27 19:09:38 +00:00
|
|
|
return QString::fromStdString(rkStr.ToStdString());
|
2015-11-24 06:08:31 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 19:09:38 +00:00
|
|
|
inline QString ToQString(const TWideString& rkStr)
|
2015-11-24 06:08:31 +00:00
|
|
|
{
|
2016-03-27 19:09:38 +00:00
|
|
|
return QString::fromStdWString(rkStr.ToStdString());
|
2015-11-24 06:08:31 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 19:09:38 +00:00
|
|
|
inline TString ToTString(const QString& rkStr)
|
2015-11-24 06:08:31 +00:00
|
|
|
{
|
2016-03-27 19:09:38 +00:00
|
|
|
return TString(rkStr.toStdString());
|
2015-11-24 06:08:31 +00:00
|
|
|
}
|
|
|
|
|
2016-03-27 19:09:38 +00:00
|
|
|
inline TWideString ToTWideString(const QString& rkStr)
|
2015-11-24 06:08:31 +00:00
|
|
|
{
|
2016-03-27 19:09:38 +00:00
|
|
|
return TWideString(rkStr.toStdWString());
|
2015-11-24 06:08:31 +00:00
|
|
|
}
|
2015-07-27 20:17:22 +00:00
|
|
|
}
|
2015-07-26 21:39:49 +00:00
|
|
|
|
|
|
|
#endif // UICOMMON
|
|
|
|
|