Originally Posted by
aamer4yu
You can have a array of graphics item in the scene. But show only one graphicsitem at a time.
On key press, hide the current and show the desired.
Hope I got ur requirement right
I have only a QMap and item is sort by Pos Y.. and on save as page each Layer go record
by this order .... to compose HTML code....
QTextDocument dont can render <div> tag on this case each layer is a <div>
If i use this only as html export i not having problem, but export as other format like xsl-fo or only print line is cut on midle of a block or image ...
I suppose the better way is to expand a QGraphicsItem as page and fill child layer div just having place .... and after emit to scene to init a new page.. to next layer...
Or how you plan your this?
Not display all page is not a clean solution..
void GraphicsView::RecordItem()
{
/*
header
QMap<int,DivDiagram*> auto_li; auto float layer order by Y
QMap<int,DivDiagram*> abso_li; absolute layer order by zindex
*/
auto_li.clear();
abso_li.clear();
int ordersorting = 10; /* start */
int absolutecount = 5000; /* start from fixed */
QList<QGraphicsItem *> listing = scene->items(); /* scene all root item */
for (int e=0;e<listing.size();e++) {
DivDiagram *it = qgraphicsitem_cast<DivDiagram *>(listing[e]);
if (it) {
it->LayerHightChecks(); /* recalc document boundingrect */
/* auto float div elements */
if (it->Formats() != DivDiagram::DIV_ABSOLUTE ) {
const int fromtop = it->pos().y() + 1;
if (!auto_li[fromtop]) {
auto_li.insert(fromtop,it);
} else {
auto_li.insert(fromtop + 1,it);
}
} else {
/* absolute fixed elements */
absolutecount++;
abso_li.insert(absolutecount,it);
}
}
}
}
void GraphicsView::RecordItem()
{
/*
header
QMap<int,DivDiagram*> auto_li; auto float layer order by Y
QMap<int,DivDiagram*> abso_li; absolute layer order by zindex
*/
auto_li.clear();
abso_li.clear();
int ordersorting = 10; /* start */
int absolutecount = 5000; /* start from fixed */
QList<QGraphicsItem *> listing = scene->items(); /* scene all root item */
for (int e=0;e<listing.size();e++) {
DivDiagram *it = qgraphicsitem_cast<DivDiagram *>(listing[e]);
if (it) {
it->LayerHightChecks(); /* recalc document boundingrect */
/* auto float div elements */
if (it->Formats() != DivDiagram::DIV_ABSOLUTE ) {
const int fromtop = it->pos().y() + 1;
if (!auto_li[fromtop]) {
auto_li.insert(fromtop,it);
} else {
auto_li.insert(fromtop + 1,it);
}
} else {
/* absolute fixed elements */
absolutecount++;
abso_li.insert(absolutecount,it);
}
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks