diff options
author | Javier <dev.git@javispedro.com> | 2015-06-14 01:35:25 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2015-06-14 01:35:25 +0200 |
commit | 59feffc5a253fec33b310f7a0105c8ef42b9019b (patch) | |
tree | 855c7c86b4413d813d2a6c40d167eb78ee3250d3 /pageitem.cc | |
parent | 72a71a2003028fc97d74cebecebb1541d66ded86 (diff) | |
download | scribiu-59feffc5a253fec33b310f7a0105c8ef42b9019b.tar.gz scribiu-59feffc5a253fec33b310f7a0105c8ef42b9019b.zip |
paperreplay working
Diffstat (limited to 'pageitem.cc')
-rw-r--r-- | pageitem.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pageitem.cc b/pageitem.cc index f938eeb..3bd5b7f 100644 --- a/pageitem.cc +++ b/pageitem.cc @@ -3,8 +3,8 @@ #include "pageitem.h" #include "stfgraphicsitem.h" -PageItem::PageItem(AfdNotebook *nb, int pageNum, QGraphicsItem *parent) : - QGraphicsItem(parent), _nb(nb), _pageNum(pageNum), _strokesLoaded(false) +PageItem::PageItem(AfdNotebook *nb, PaperReplay *replay, int pageNum, QGraphicsItem *parent) : + QGraphicsItem(parent), _nb(nb), _replay(replay), _pageNum(pageNum), _strokesLoaded(false) { _pageSize = _nb->getPageSize(pageNum); _pageTrim = _nb->getPageTrim(pageNum); @@ -51,6 +51,13 @@ void PageItem::createStrokes() { QStringList pens = _nb->penSerials(); if (pens.isEmpty()) return; + + // Load paper replay data if available + AfdPageAddress pageAddr = _nb->getPageAddress(_pageNum); + PaperReplay::SessionList replays = _replay ? _replay->sessions(pageAddr.toUInt64()) : PaperReplay::SessionList(); + + // Now create a new StfGraphicsItem for every stroke file + // Which will in turn create a stroke item for every stroke QStringList strokeFiles = _nb->strokeFiles(pens.first(), _pageNum); foreach (const QString &strokeFile, strokeFiles) { QFile f(strokeFile); @@ -58,7 +65,8 @@ void PageItem::createStrokes() qWarning() << "Could not open stroke file:" << strokeFile; continue; } - new StfGraphicsItem(&f, this); + new StfGraphicsItem(&f, replays, this); } + qDebug() << "strokes loaded for page" << _pageNum; } |