How to open external document to a second canvas in a docker?

Yue Liu yue.liu at mail.com
Sat Oct 13 15:45:15 BST 2012


2012/10/13 Inge Wallin <inge at lysator.liu.se>:
> On Saturday, October 13, 2012 03:42:37 Yue Liu wrote:
>> Hi,
>>
>> [deleted]
>>
>> But to implement this, I have to show a canvas and external document
>> in a docker, I'm not sure how to do it right. My idea is:
>>
>>  - class StencilDocument inherited from KoOdfDocument and
>> KoShapeBasedDocumentBase
>>  - class StencilCanvas inherited from KoCanvasBase
>>  - put StencilCanvas in the docker, load StencilDocument to the canvas
>>  - user drag shapes from the docker and drop to the application main canvas
>>
>> Is this practical? If not, what would be a practical way of doing
>> this? If it's totally wrong to do this, what do you think is a better
>> solution for stencil box docker?
>
> Although I'm not aware of the details to give a definite answer, it *looks*
> like it could work.  Another way would be to have an off-screen canvas, paint
> the stencil into a QImage, thereby creating a cache and then show only the
> image in the docker. If nothing else it would speed up the repainting a lot.
Sounds better. Can you explain more about off-screen canvas? Is that
just a ordinary canvas not added to the docker widget?

>
> Also: If you have every stencil as one document, won't the loading time for
> the full stencil set be very long? One reason why you would have a whole
> stencil set in one file is that it makes loading and therefore the startup
> time of the application faster.
For a stencil I mean a collection of shapes, currently one shape use
one document and it only loads when it is dragged to the canvas. My
plan will use one document for a collection of shapes and loads them
before user actions.

>
> Finally, how will a stencil set be grouped? Will it be one file per stencil,
> one directory per set?
>From the definition of stencil I think stencil is a set of shapes,
which use one document, and stencil-set is a folder with several
stencil documents in same category.

>
>         -Inge
>
>> Thanks,
>> Yue Liu
>> _______________________________________________
>> calligra-devel mailing list
>> calligra-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/calligra-devel
> _______________________________________________
> calligra-devel mailing list
> calligra-devel at kde.org
> https://mail.kde.org/mailman/listinfo/calligra-devel



More information about the calligra-devel mailing list