Mantid
Loading...
Searching...
No Matches
QStringUtils.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include <QString>
10#include <string>
11
12namespace MantidQt {
13namespace API {
21inline QString toQStringInternal(const wchar_t *str) {
22 return sizeof(wchar_t) == sizeof(QChar)
23 ? QString::fromUtf16(reinterpret_cast<const ushort *>(str), static_cast<int>(wcslen(str)))
24 : QString::fromUcs4(reinterpret_cast<const uint *>(str), static_cast<int>(wcslen(str)));
25}
26
34inline QString toQStringInternal(const std::wstring &str) {
35 return sizeof(wchar_t) == sizeof(QChar)
36 ? QString::fromUtf16(reinterpret_cast<const ushort *>(str.data()), static_cast<int>(str.size()))
37 : QString::fromUcs4(reinterpret_cast<const uint *>(str.data()), static_cast<int>(str.size()));
38}
39} // namespace API
40} // namespace MantidQt
QString toQStringInternal(const wchar_t *str)
Internal version of QString::fromStdWString.
Definition: QStringUtils.h:21
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...