#include "htmlwindow.h"
#include "ui_htmlwindow.h"
#include "list.h";
#include "writer.h";
#include "sstream";
using namespace std;
HtmlWindow::HtmlWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::HtmlWindow)
{
ui->setupUi(this);
ui->tabWidget->setTabText(0, "Text");
ui->tabWidget->setTabText(1, "Web");
}
HtmlWindow::~HtmlWindow()
{
delete ui;
}
void HtmlWindow::displayList (List & v)
{
stringstream s;
Writer w (s);
w.writeHtml(v);
QString txt = QString::fromStdString (s.str());
// ui->textEdit->setHtml (txt);
ui->textEdit->setPlainText (txt);
ui->webView->setHtml (txt);
}