diff options
Diffstat (limited to 'src/Qt/qlistconverter.cpp')
-rw-r--r-- | src/Qt/qlistconverter.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/Qt/qlistconverter.cpp b/src/Qt/qlistconverter.cpp new file mode 100644 index 0000000..4f3855c --- /dev/null +++ b/src/Qt/qlistconverter.cpp @@ -0,0 +1,45 @@ +#include "qlistconverter.h" + +#include <QStringList> +#include <QString> + +namespace CppPortage{ + +QListConverter::QListConverter(StringList *stringList, QObject *parent) + :QObject(parent) +{ + m_stringlist = stringList; +} + +QListConverter::QListConverter(QStringList *stringList, QObject* parent) + : QObject(parent) +{ + m_qstringlist = stringList; +} + + + +QListConverter::~QListConverter() +{ +} + +StringList* QListConverter::QStringListToStringList() +{ + for (int i = 0; i <= m_qstringlist->size(); i++) { + char c = m_qstringlist->at(i).data()->toAscii(); + stringListInsertAt(m_stringlist, i, &c); + } + + return m_stringlist; +} + +QStringList QListConverter::StringListToQStringList() +{ + for (int i = 0; i <= m_stringlist->count(); i++) { + m_qstringlist->insert(i, stringListGetAt(m_stringlist, i)); + } + + return *m_qstringlist; +} + +}
\ No newline at end of file |