mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-29 06:15:24 +00:00
Convenience functions
This commit is contained in:
parent
9002e64e1a
commit
7918fa30cf
@ -11,9 +11,30 @@
|
||||
Written by Moritz Bunkus <moritz@bunkus.org>.
|
||||
*/
|
||||
|
||||
#ifndef __MTX_COMMON_QTCOMMON_H
|
||||
#define __MTX_COMMON_QTCOMMON_H
|
||||
#ifndef MTX_COMMON_QT_H
|
||||
#define MTX_COMMON_QT_H
|
||||
|
||||
#define Q(s) QString::fromUtf8(s)
|
||||
#define Q(s) to_qs(s)
|
||||
#define QY(s) to_qs(Y(s))
|
||||
|
||||
#endif // __MTX_COMMON_QTCOMMON_H
|
||||
inline QString
|
||||
to_qs(std::string const &source) {
|
||||
return QString::fromUtf8(source.c_str());
|
||||
}
|
||||
|
||||
inline QString
|
||||
to_qs(std::wstring const &source) {
|
||||
return QString::fromStdWString(source);
|
||||
}
|
||||
|
||||
inline std::string
|
||||
to_utf8(QString const &source) {
|
||||
return std::string{ source.toUtf8() };
|
||||
}
|
||||
|
||||
inline std::wstring
|
||||
to_wide(QString const &source) {
|
||||
return source.toStdWString();
|
||||
}
|
||||
|
||||
#endif // MTX_COMMON_QT_H
|
||||
|
Loading…
Reference in New Issue
Block a user