aboutsummaryrefslogtreecommitdiff
path: root/libs/installer_omod/src/interop/QtDotNetConverters.cpp
blob: 430e8e516b9f54147c0c088cc390be63ca743520 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "QtDotNetConverters.h"

#include <string>

#include <msclr\marshal_cppstd.h>

QString toQString(System::String^ string)
{
  if (string)
    return QString::fromStdWString(msclr::interop::marshal_as<std::wstring>(string));
  return QString();
}

System::String^ toDotNetString(const QString& qString)
{
  return qString.isNull() ? nullptr : msclr::interop::marshal_as<System::String^>(qString.toStdWString());
}