[PyKDE] NewBie: Any KWidget without KApplication possible

Jim Bublitz jbublitz at nwinternet.com
Tue Feb 4 18:08:01 GMT 2003


On 04-Feb-03 Claus Schumacher wrote:
> I'm any absolue newbie in PyKDE. I already managed to program
> PyQt with  QtDesigner according to the examples.
> 
> Is it possible to inherit KWidget like KDatePicker in
> QApplication(s) instead  of KApplication(s)

Since all KDE widgets are subclasses of QWidget, it *might* be
possible that *some* KDE widgets would work in a QApplication based
program. HOWEVER, in the case of KDatePicker (and probably most
other KDE widgets), the actual widget code depends on things like
KInstance, KLocale, or other KDE classes that are instantiated
through the contruction of KApplication.

In the KDatePicker case (I tried it anyway), the app segfaults, and
I'm guessing that's because dates depend on locale information (like
format or translation of month names) and KDE widgets expect a KDE
class or structure to exist that holds that information. KDE themes
capability would add another possible incompatibility.

I haven't looked at this extensively, but my guess is that to get
it to work you'd end up duplicating the KApplication functionality.
If you're familiar with C++, looking at the KDE source for
KDatePicker (it's in kdelibs/kdeui) might help you write your own
date picker class in Python/PyQt.

Jim




More information about the PyQt mailing list