Moved some parts to a static lib so both the executable and the tests can link to it.

Written additional tests.
This commit is contained in:
eelke 2017-02-26 19:29:50 +01:00
parent 0a809a7288
commit d0ea9dfa0c
39 changed files with 1767 additions and 493 deletions

View file

@ -1,6 +1,7 @@
#ifndef UTIL_H
#define UTIL_H
#include <string>
#include <QString>
#include <QTableView>
@ -9,6 +10,23 @@ 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 <>