From koffice-devel Mon Jan 28 23:43:13 2008 From: Florian Merz Date: Mon, 28 Jan 2008 23:43:13 +0000 To: koffice-devel Subject: Re: Some questions about repainting tools Message-Id: <200801290043.13517.FlorianMerz () gmx ! de> X-MARC-Message: https://marc.info/?l=koffice-devel&m=120158996810183 Hi, I did have a look at the TextTool before, but I must have been blind. I had a second look and it seems to make a lot more sense to me now. Just to make sure, that I understand this correctly: - I have to reimplement the repaintDecorations() function - A good way to do this is by calling m_canvas->updateCanvas(QRectF) This will tell the canvas to repaint and the canvas will then in turn call the tool's paint() function - Finally I call repaintDecorations() in my tool whenever something changes, which needs a change in the decoration, too - Some other parts of the application might call repaintDecorations(), so I shouldn't abuse this function for something else (seems to happen for example when I switch to another tool) Please tell me if I got it right, now. It would also be nice to have some information in the API, that explains how this function is supposed to be used. Right now there is nothing that indicates that the function needs to be reimplemented, and a reference to updateCanvas() might be useful, too. Thanks, Florian Am Montag, 28. Januar 2008 schrieb Martin Pfeiffer: > Hi Florian, > as the method repaintDecorations is virtual I would guess that it is > meant to be reimplemented by each of the tools. > For examples look at the koffice/plugins/ dir for a shape ( the text > shape for example ) that REimplements repaintDecorations()... > Martin > > On Monday 28 January 2008 18:14:45 Florian Merz wrote: > > Hi everyone, > > > > I was playing around with the Flake library, and I thought maybe > > someone can answer me some questions: > > > > The documentation says the repaintDecorations() function can be used to > > trigger a canvas update, but the implementation in KoTool is empty. It > > also seems like it is never called, except when I switch to another > > tool, and In that case it is called two times in a row. If the function > > is empty, and no one calls it while the tool is being used, what is it > > there for? > > > > What is the best way to trigger a repaint of the tool's decoration from > > inside the tool? > > > > Why does the KoInteractionTool call the KoTool::repaintDecorations() > > function if that function doesn't do anything at all? > > > > Thanks for your help, > > Florian _______________________________________________ koffice-devel mailing list koffice-devel@kde.org https://mail.kde.org/mailman/listinfo/koffice-devel