Registered Member
|
Hello,
I was wondering how to get a hold of the QTextDocument of the KWDocument. For the test I did this
but my text isn't shown on the document, what did I do wrong. I'm just trying to understand the code. |
KDE Developer
|
Try to use KWDocument::mainFrameSet() instead of creating a new one.
The layout() call is not needed either, altering a frameset that is used in an existing koffice document will do that automatically on display. Also check out the KoTextEditor (you can get hold of one using the KoTextDocument API) which would make it easier to update your text.
Thomas Zander
KWord maintainer |
Registered Member
|
Thomas,
I tried what you wrote
I'm also found the api you mentioned, but now the program crashes. I think because of the fact that mainFrameSet() returns a null. The function is put in the constructor (just for the test ) .In this phase is there already a default KWTextFrame ? |
Registered Member
|
Thomas,
I moved the test code outside the KWDocument class and it's now called via a signal. So the KWDocument object should have a QTextDocument returned when I do a mainFrameSet()->document() right? But when debugged I get an error at this statement. I get a segmentation fault when this code is hit( red arrow in gdb) |
Registered Member
|
Thomas, thanks a lot I found my error, it's working now. So far the text now I will continue with the pictures .
|
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan