This forum has been archived. All content is frozen. Please use KDE Discuss instead.

integrate kword in myapp

Tags: None
(comma "," separated)
xyfix
Registered Member
Posts
110
Karma
0

integrate kword in myapp

Tue Dec 08, 2009 4:31 pm
guys,

i have a application that makes use of qtabwidget and I want to add a stripped version of kword to the last tab. I already have a QMainWindow with all the menu ( File,Edit,View) stuff for my application. I want a light version of kword with button bars. If someone has done this before or has a lot of experience and know how to do this, please do reply. I will put all the stuff that I'll run into in this thread. :)

xyfix
The User
KDE Developer
Posts
647
Karma
0
OS

Re: integrate kword in myapp

Tue Dec 08, 2009 5:17 pm
Do you really want to use KWord or something like the rich textediting in KMail?
xyfix
Registered Member
Posts
110
Karma
0

Re: integrate kword in myapp

Wed Dec 09, 2009 9:58 am
since my application is based on c++ and QT, I want something that is very close to this and koffice/kword looks perfect to me. I don't know wether KMail has multiple columns and other fancy features as kword has. But I hope that some of you professionals can help me with this.
User avatar
cyrille
Moderator
Posts
110
Karma
1

Re: integrate kword in myapp

Wed Dec 09, 2009 10:51 am


Cyrille Berger
Krita developer and Calligra release coordinator
blog
xyfix
Registered Member
Posts
110
Karma
0

Re: integrate kword in myapp

Tue Dec 15, 2009 10:42 am
cyrille,

from the documentation ( http://api.kde.org/4.3-api/kdelibs-apid ... index.html ) I get that the mainwindow of my application should be derived from KParts::MainWindow instead of the current derivation from QMainWindow. Since the KPart/MainWindow delivers a skeleton that will be used by the KParts I can't use this ....right??

xyfix
The User
KDE Developer
Posts
647
Karma
0
OS

Re: integrate kword in myapp

Tue Dec 15, 2009 12:54 pm
Do you really want to integrate KOffice-Shapes and all these stuff?
User avatar
dpalacio
Registered Member
Posts
240
Karma
2
OS

Re: integrate kword in myapp

Tue Dec 15, 2009 3:28 pm
xyfix wrote:cyrille,

from the documentation ( http://api.kde.org/4.3-api/kdelibs-apid ... index.html ) I get that the mainwindow of my application should be derived from KParts::MainWindow instead of the current derivation from QMainWindow. Since the KPart/MainWindow delivers a skeleton that will be used by the KParts I can't use this ....right??

xyfix

You do not need to derive from KParts::MainWindow, just grab the part widget and use it in a QMainWindow.


connect(post, SIGNAL(readSignature()), qapp, SLOT(quit()));
xyfix
Registered Member
Posts
110
Karma
0

Re: integrate kword in myapp

Wed Dec 16, 2009 11:06 am
Ok,

I've been reading about kparts (I'm not finished yet) and it looks like something that I need in order to integrate kword (and some other kparts,e.g. kspread) into my application. Unfortunately it's a bit complex but I want to learn more about it. As I told before my application is based on Qt/c++, the mainwindow has a QTabWidget which currently opens tabs with an object that is derived from QTextEdit. I want to change this QTextEdit and replace it with kword (using as a kpart).

The User,

actually I don't need the Koffice-Shapes, but if it comes with the kword I'll accept it. My intention is to disable/remove some of the functionality of kword and keep only the necessary parts.
User avatar
zander
KDE Developer
Posts
87
Karma
1

Re: integrate kword in myapp

Wed Dec 16, 2009 11:35 am
Why don't you just use kotext and flake libs to make your QTextEdit render ODF? It uses the normal QTextDocument, afterall.


Thomas Zander
KWord maintainer
xyfix
Registered Member
Posts
110
Karma
0

Re: integrate kword in myapp

Wed Dec 16, 2009 12:13 pm
Zander,

will I then be able to support tables, spelling check, kspread, multicolumn text, etc..?
xyfix
Registered Member
Posts
110
Karma
0

Re: integrate kword in myapp

Wed Dec 16, 2009 3:53 pm
Guys,

in this article http://developer.kde.org/documentation/ ... index.html it's written that in order to use a kpart inside my application and do some gui merging I need to define my gui in xml. That will need a whole lot of work, am I understanding it correctly or not ?
In that same article it's written that:
Code: Select all
Note that it's also possible to use a part in a standard application, using KTMainWindow, but then no GUI merging happens. In this case, only the functionality provided by the widget and by the part API are available, so the application has to create the GUI for part's functionality itself, or the part has to provide it through context menus. In any case, it is much less flexible.


But then I would have to derive my application main window from KTMainWindow as I stated above. Can somebody explain,because I just thought that I don't have to do that derivation.
User avatar
zander
KDE Developer
Posts
87
Karma
1

Re: integrate kword in myapp

Wed Dec 16, 2009 8:00 pm
will I then be able to support tables, spelling check, kspread, multicolumn text, etc..?


No. You never stated what you wanted, so I just put out an idea. Seems you want KWord but not KWord. Oh, well.

Bottom line is; you should experiment. Write code, try approaches. See what works.


Thomas Zander
KWord maintainer
xyfix
Registered Member
Posts
110
Karma
0

Re: integrate kword in myapp

Thu Dec 17, 2009 10:08 am
Zander,

my fault if I wasn't clear enough, I apologize. Can you please tell me wether the kpart approach suggested by cyrille the best way to go?
I already have a application based on Qt with a QMainWindow and a QTabWidget on which I want the texteditor ( kword ) to appear. Currently all tabs of the QTabWidget presents an object that is derived from QTextEdit, not a high-end editor like KWord.
I'm trying my best by coding and reading all kinds of articles on how to start but so far no success.
xyfix
Registered Member
Posts
110
Karma
0

Re: integrate kword in myapp

Mon Jan 04, 2010 10:09 pm
Can somebody tell me wether I need to put the interface of my current app in a XML file like in the kparts if I want to use a kpart in my app? And does anybody have any experience in using a kpart( like kword) in their already existing app. I have tried to integrate kword into my app, but I'm encountering some problems. First of all I now derive my QMainWindow from KMainWindow and the class which used to be derived from QTextEdit is now derived from ReadWritePart. I'm not sure wether my approach will be successful, only a expert can tell me that in front.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: integrate kword in myapp

Mon Jan 04, 2010 10:23 pm
I do not think the merging of menus will work properly if you do not using KDE XMLGUI technology yourself. It is reasonably easy to port to however.

You need to derive from KXMLGUIWindow instead.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan