[prev in list] [next in list] [prev in thread] [next in thread]
List: kjsembed
Subject: Re: [kjsembed] Translation of PyKDE script to KJS
From: Ian Reinhart Geiser <geiseri () yahoo ! com>
Date: 2005-04-28 14:13:08
Message-ID: 200504281013.13558.geiseri () yahoo ! com
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Wednesday 27 April 2005 03:41 pm, Matej Cepl wrote:
> Hi,
>
> I am a total newbie in KJS world so forgive me please if the
> question is totally stupid (I really tried to find all necessary
> information, but I got lost).
>
> I have created a small dialog in Qt Designer and Python and I
> would love to translate it into KJS (I hope it would be at least
> slightly faster -- Python script takes at least five seconds to
> start, and that is too slow for me; I cannot write C++ and I
> would rather maintain script). I tried to create KJS version
> (see attached), but this end doesn't work (there doesn't seem to
> be sort() method for listBox1) and even when the dialog is shown
> it is dead (now method seems to do anything, although all
> connections are defined in .ui file):
>
> ui.child("listBox1").sort();
ui.listBox1.sort();
> ui.show();
> /* app.setMainWidget(f) */
> application.exec();
//application.exec();
> listBoxItems = [];
> numItems = ui.listBox1.numItemsVisible();
> for(num=0;n<numItems;n++) {
> listBoxItems += ui.listBox1.text(num);
> }
> saveList(listBoxItems);
application.exec(); // <- this might be the real problem
>
> Can you help me with this script to make it work, please?
One current limitation of KJSEmbed is that we cannot connect signal/slot
connections from a UI file. So you have to manually do a connect() in the
javascript.
As for startup time KJSEmbed is chained by Qt/KDE libs for startup, so you may
get nailed there. I am trying very hard in KJSEmbed for Qt4 to streamline
this.
Cheers
-ian reinhart geiser
[Attachment #5 (application/pgp-signature)]
_______________________________________________
kjsembed mailing list
kjsembed@kde.org
https://mail.kde.org/mailman/listinfo/kjsembed
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic