Registered Member
|
bcooksley,
since KParts::MainWindow is derived from KXMLGUIWindow I don't need my MainWindow to derive from KXMLGUIWindow just from KParts::MainWindow would be enough.....right?? |
Administrator
|
Correct. I thought you were using KMainWindow which doesn't support XMLGUI.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
|
Registered Member
|
I've derived my MainWindow application from KParts::MainWindow, but how do I proceed further when I want each of the QTabWidgets of my app to show a KWord part. Do I need to derive the object(currently a derivation of QTextEdit) that was shown on the tabs from KParts::ReadWritePart?
I've read that if I want multiple kparts in my MainWindow I should connect the KParts::MainWindow::CreateGui slot to the KPartManager::activePartChanged signal, this sounds pretty sane but how do I fit this manager in my app? |
Registered Member
|
OK, now that my application is kpart-aware and I have the XMLGUI up and running (some action's have been moved to the new XMLGUI structure) but now I want to integrate kword as a kpart in my application. In my application I have these QTabWidgets where I currently put derived QTextEdit objects in. Now I replaced this and in the constructor of this object I do this:
I put kate in the code above because that seem to work, because I get a text edit area where I can enter text ( which I already had with the QTextEdit object so not sure if this actually works). But when I put something else instead of katepart like kwordpart the edit area dissapears. So how can I use kword as a kpart? |
Registered Member
|
anyone an idea how to merge the gui of the kpart (for now kate later kword ) with my app, this is XMLGUI based ?
|
Registered Member
|
it seems like I've been using some deprecated classes (e.g. KLibLoader)
but when I use the right one (I assume) "KPluginLoader loader("kwordpart");" I get an error "KPluginLoader::KPluginLoader: Could not find plugin "kwordpart"" . The libkwordpart.so is located in $HOME/koffice/src/lib/ this directory is in my LD_LIBRARY_PATH but how do I make it clear to the plugin loader. Environment variables KDEDIR & KDEDIRS don't have this directory. |
Administrator
|
The following KParts guide may help
http://techbase.kde.org/Development/Tut ... ing_KParts
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
bcooksley,
Unfortunately that tutorial won't help me, because I've already read it (was mentioned by cyrille). Judging on what I got (katepart is working but kwordpart is not found) I think one of you experts should have a look at it. Nevertheless I will read it again perhaps I overread something. I've also tried to find the solution on the internet, but the information on this is pretty scarce (it's only on the internet and no google groups ). Another unfortunate point is that the link is outdated according to this http://api.kde.org/4.x-api/kdelibs-apid ... oader.html where it's mentioned that KLibLoader is depricated. |
KDE Developer
|
Maybe you can put your app on gitorious or some hosting so people can see the code you have.
Right now its very hard to guess why it would fail. There are plenty more tutorials on techbase and loads of info on kparts and parts discovery on api.kde.org that may be helpful
Thomas Zander
KWord maintainer |
Registered Member
|
Thomas, bcooksley ,
please understand that a lot of the code is protected( legal issue) . I'll supply you all the information you guys need to help me out. I know that it is very hard (some think it's impossible) but since you're professionals that shouldn't hold you back, so please bear with me. I'll put the short-short version of the code here. MainWindow.h:
MainWindow.cpp:
ViewMode.h:
ViewMode.cpp:
ReportEditor.h:
ReportEditor.cpp:
The kate part works I get an editor, but since the gui isn't merged yet no actions or buttons from kate is available ( only key shortcuts). But when katepart is replaced with kwordpart I get an error
And can anybody tell me what's the way to run the createGUI in order to get the actions and buttons merged? |
Administrator
|
Just after you add the part to the layout, you need to call
Where part is the KParts::ReadWritePart or KParts::ReadOnlyPart you have just created.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Thank you bcooksley,
Any idea about the KPluginLoader not finding the plugin? I've built koffice 2.1 without any errors and saw that the plugin resides in $HOME/koffice-2.1/src/lib . |
Registered Member
|
bcooksley,
is it wise to pass a mainwindow object pointer via the function addReport(ViewMode) and the constructor of ReportEditor , just to have a pointer to the mainwindow object available in ReportEditor? |
Administrator
|
An alternate way to do it would be to create a static function in your K(Unique)Application class which returns it.
kapp is a global static provided by KApplication. QApplication also has one, qApp. m_mainWindow is a pointer, stored by your Application subclass.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan