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

PyKDE vs pure KDE

Tags: None
(comma "," separated)
sjkwizard
Registered Member
Posts
20
Karma
0
OS

PyKDE vs pure KDE

Fri Dec 17, 2010 1:25 pm
Hi all. I want to start programming something for KDE and I don't know where to start. My first goal is to extend an existing python software with a gtk interface adding a kde interface.
I thought to write this interface in pykde but I haven't found any useful documentation for pykde. So I'm wondering...can I write a pure KDE (C++) interface reusing the python core of the other app or I can just use pykde for writing it? Or it's better to rewrite even the core of the app in KDE (C++)? (I see that "pure" KDE is better documented)
Thanks!
User avatar
TheBlackCat
Registered Member
Posts
2945
Karma
8
OS

Re: PyKDE vs pure KDE

Fri Dec 17, 2010 2:11 pm
Here is the API reference: http://api.kde.org/pykde-4.5-api/modules.html

And since KDE is Qt-based the PyQt docs should tell you a lot:
http://www.riverbankcomputing.com/stati ... t4ref.html
http://www.riverbankcomputing.co.uk/sta ... asses.html

The rest should be the same as either python or KDE/Qt. Is there anything else you need?


Man is the lowest-cost, 150-pound, nonlinear, all-purpose computer system which can be mass-produced by unskilled labor.
-NASA in 1965
sjkwizard
Registered Member
Posts
20
Karma
0
OS

Re: PyKDE vs pure KDE

Fri Dec 17, 2010 8:19 pm
Thanks for the info. Another thing...I used Qt Creator for designing the inteface, I compiled it with pykdeuic4 and then I added the code by hand. But if I need to add something on the interface and I recompile it, it will destroy all my code right? So I can use Qt Creator just for designing the inteface the first time right?
User avatar
tanghus
Registered Member
Posts
6
Karma
0
OS

Re: PyKDE vs pure KDE

Sat Dec 18, 2010 1:17 am
You should import the class from the file generated by pykdeuic4 and then make a subclass from it. Du the coding in the subclass, then you can run pykdeuic4 again without ruining your code.
As it says in the files generated by pykdeuic4:
# WARNING! All changes to this file will be lost.


Best Regards / Med venlig hilsen

Thomas Olsen
User avatar
tanghus
Registered Member
Posts
6
Karma
0
OS

Re: PyKDE vs pure KDE

Sat Dec 18, 2010 6:27 am
Forgot to mention that the subclass must also be derived from QWidget (or a QWidget derived class).

For example:


Code: Select all
from generated_ui import *

class MyClass(QWidget,Ui_GeneratedClass):
    def __init__(self,parent):
        QWidget.__init__(self,parent)
        self.setupUi(self)

Or whatever the file/class are called.

Well this is one way to do it ;-)


Best Regards / Med venlig hilsen

Thomas Olsen
sjkwizard
Registered Member
Posts
20
Karma
0
OS

Re: PyKDE vs pure KDE

Sat Dec 18, 2010 9:43 am
Thanks a lot!


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient