--- /dev/null
+#include "trainer.h"
+
+#include <QApplication>
+#include <QtDebug>
+#include <QTableWidget>
+#include <QHBoxLayout>
+#include <QList>
+
+Trainer::Trainer(QWidget *parent)
+ : QWidget(parent)
+{
+ QTableWidget *tableWidget = new QTableWidget(this);
+
+
+ QStringList args = QApplication::arguments();
+ args.removeFirst();
+
+ KEduVocDocument docRead;
+ docRead.open(args.at(0));
+
+ QList<KEduVocContainer *> lessons = docRead.lesson()->childContainers();
+
+ KEduVocLesson *m_lesson;
+
+ foreach(KEduVocContainer * c, lessons) {
+ if (c->containerType() == KEduVocLesson::Lesson) {
+ m_lesson = static_cast<KEduVocLesson *>(c);
+ qDebug () << "Lesson: " << m_lesson->name();
+ for(int i = 0; i < m_lesson->entries().size(); ++i)
+ {
+ tableWidget->insertRow(i);
+ for( int j = 0; j < m_lesson->entry(i)->translationIndices().size(); ++j )
+ {
+ qDebug() << "columnCount: " << tableWidget->columnCount() << "j: " << j;
+ if (tableWidget->columnCount() <= j)
+ {
+ tableWidget->insertColumn(j);
+ }
+ qDebug() << "Entry: " << m_lesson->entry(i)->translation(j)->text() << "Identifier: " << docRead.identifier(j).name();
+ QTableWidgetItem *newItem = new QTableWidgetItem(m_lesson->entry(i)->translation(j)->text());
+ tableWidget->setItem(i, j, newItem);
+ }
+ }
+ }
+ }
+
+ QList<QString> labels;
+ for( int i = 0; i < docRead.identifierCount(); ++i )
+ {
+ qDebug() << "Identifier: " << docRead.identifier(i).name() << " i: " << i;
+ labels.insert(i, docRead.identifier(i).name());
+ }
+
+ tableWidget->setHorizontalHeaderLabels(labels);
+
+ QHBoxLayout *layout = new QHBoxLayout;
+ layout->addWidget(tableWidget);
+ setLayout(layout);
+}
+
+Trainer::~Trainer()
+{
+
+}
--- /dev/null
+#ifndef TRAINER_H
+#define TRAINER_H
+
+#include <QtGui/QWidget>
+
+#include "keduvocdocument.h"
+#include "keduvoclesson.h"
+#include "keduvocexpression.h"
+#include "keduvocleitnerbox.h"
+
+class Trainer : public QWidget
+{
+ Q_OBJECT
+
+public:
+ Trainer(QWidget *parent = 0);
+ ~Trainer();
+};
+
+#endif // TRAINER_H
--- /dev/null
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-03-16T20:41:35
+#
+#-------------------------------------------------
+
+TARGET = trainer
+TEMPLATE = app
+LIBS += -L/home/rzingg/kedu/git/lib -lkeduvocdocument
+DEPENDPATH += . /home/rzingg/kedu/git/lib
+INCLUDEPATH += . /home/rzingg/kedu/git/lib
+
+SOURCES += main.cpp\
+ trainer.cpp
+
+HEADERS += trainer.h