Jump to content

Calligra/Calligra Mobile/How To Calligra QML

From KDE Community Wiki

This page logs the difficulties we had while implementing Calligra with QML

Canvas Controller

A canvas controller is what handles the viewing, scrolling, zooming etc for a document canvas. The document rendering is done by a canvas item.

  • We first got to create a new canvas controller that derives from KoCanvasController and QDeclarativeItem (in case of QML)
  • reimplement setCanvas
  • add a openDocument or similar slot which can be then called from QML to open a document

Problems

  • CanvasItem displays a viewport of the document, not the whole document (so you should *not* tell the canvasItem to display 200 pages at once. So we cannot use it on a scroll area of a QML Flickable element. So we have to do scrolling ourselves :(