Registered Member
|
bcooksley,
not sure how to do this. I wanted to try this:
But my application has a MyApp class with a protected QApplication member m_app. How will I be able to do the last cast? Currently I get a:
Anyone got an idea on my "could not find plugin" issue? I'm really stuck on that I would guess it's a simple problem |
Administrator
|
Try this:
You can do casts from a QCoreApplication object all the way up to your K(Unique)Application subclass without any issues, or interleaving steps
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
bcooksley,
I've tried this but then an error occured:
I think that's because MyApp::m_app is a QApplication... My MyApp class .h:
and .cpp
|
Registered Member
|
OK,
I've created a solution ( perhaps won't win the beauty contest price but it works). I just put my mainwindow in a namespace and created a get function which returns the mainwindow and then ran createGUI()... and it works. Special thanks to bcooksley, zander,cyrille and the rest of the guys. |
KDE Developer
|
About the code sample in the initial post: it failed because the plugin is called libkwordpart.so but is located in "modules", which is not what KPluginLoader expects (the compat code for "libfoo in modules" is above KPluginLoader).
=> the solution is KPluginLoader("libkwordpart"). But of course this puts an implementation detail (the name of the module on disk, which should one day be fixed to remove the 'lib' prefix, as one can see in the warnings), so it would be better to start from the desktop file instead, which is less likely to change names. This gives:
Last edited by dfaure on Wed Jan 27, 2010 1:12 pm, edited 1 time in total.
|
Registered Member
|
GREAT!!!! it works perfectly. A HUGE Thanks for dfaure of the kde development team and co-designer of the KParts-technology.
|
Registered Member
|
I got this working with the KPluginLoader
thank you, xyfix for your help. |
Registered Member
|
tmoti,
the libloader method is depricated. I had a talk with david faure about it and I changed the kde manual so that it now states that people should use the kservice desktop file instead. |
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan