I try to (draw) in split mode a QTextDocument on each page to edit text & display pages, (like openoffice)
the spitt is only a QGraphicsItem paint after i retranslate
all keybord / mouse event to correct QPointF, only to textapi.

But i can not controll the cutting blockelement ...
the page 1 & 2 is ok after the cutting paint go crazy.

I suppose i must write a QPaintEngine like QTextDocument[::]print() and PageBreakFlags must run i suppose ?
Or is here other way?

How i subclass QPaintEngine to binding to QGraphicsItem[::]paint() ?
and respect PageBreakFlags policy...


Qt Code:
  1. /* M_PageSize DDPAGE; = container
  2.   from margin and multi page size */
  3. void BaseText::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
  4. QWidget *widget)
  5. {
  6. const QRectF rectalldoc = boundingRect(); /* all page rect call to recalc pagetotal */
  7. const int PageS = DocPageSumme;
  8. QTextDocument *_d = document();
  9. for (int i = 0; i < PageS; ++i) {
  10. painter->save();
  11. const QRectF innrect = DDPAGE.PageInternal(i); /* rect to place one page */
  12. painter->translate(innrect.topLeft().x(), innrect.topLeft().y() - (i * DDPAGE.hight()) );
  13. _d->drawContents(painter,QRectF(0, i * DDPAGE.hight() ,_d->size().rwidth(), DDPAGE.hight() ));
  14. painter->restore();
  15. }
  16. }
To copy to clipboard, switch view to plain text mode