pgLab/pglab/util.h
Eelke Klein 04723a289b Switching to linux for development of pglab.
Switched from qmake to cmake. Code changes to make it compile.
2017-08-23 08:10:01 +02:00

43 lines
742 B
C++

#ifndef UTIL_H
#define UTIL_H
#include <string>
#include <QString>
#include <QTableView>
QString msfloatToHumanReadableString(float ms);
void copySelectionToClipboard(const QTableView *view);
QString ConvertToMultiLineCString(const QString &in);
void exportTable(const QTableView *view, QTextStream &out);
inline QString stdStrToQ(const std::string &s)
{
return QString::fromUtf8(s.c_str());
}
inline std::string qStrToStd(const QString &s)
{
return std::string(s.toUtf8().data());
}
inline std::string qvarToStdStr(const QVariant &c)
{
return qStrToStd(c.toString());
}
namespace std {
template <>
struct hash<QString>
{
std::size_t operator()(const QString& s) const
{
return qHash(s);
}
};
}
#endif // UTIL_H