Summary

I got problems to run KJS scripts. I could run several scripts with warnings, But I could not run scripts. As I tried examples script, console program and gui program which use *.ui file is OK. But the program which make instance of any QWidget in script does not work. DCOP example also did not work. wish someone help, thanks.


My environment

Before I ask question. This is how did I installed KDE. Please tell me if I mistook in install process.

Compile environment

 OS. linux/debian(woody)
 > gcc --version
 eading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
 gcc version 2.95.4 20011002 (Debian prerelease)

Install PATH

 QT      /opt/qt-3.3.1
 KDE     /opt/kde-3.2.2
 I installed KDE packages under the directory.
 I compiled them by gcc2.95 that installed by apt-get.
 The only problem I had in configure. ./configure did not check
 I set disable cups. I edit ./configure file manually and past configure.
 I did not have any other special problems in compile/install process.
 Except solve dependences, I just ./configure --prefix=/opt/kde-3.2.2
 and make install. No trouble in compile/install.
 After reboot KDE, most of KDE applications worked fine.

Environment variables (I set thise in ~/.zshrc)

 > echo $PATH
 /usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/opt/kde-3.2.2/bin:/usr/X11R6/bin
 > echo $KDEDIR
 /opt/kde
 > echo $QTDIR
 /opt/qt-3.3.1
 
 NOTE: /opt/kde is a symbolic link to /opt/kde-3.2.2

Versions

 > kjscmd --version
 Qt: 3.3.1
 KDE: 3.2.2
 KJSCmd: 0.3

Tests

 I could make Qt application and run it.
 I could make KDE application and run it.
 I could use dcop command and kdcop to control KDE applications.
 I could run kjs script which print to console or using *.ui file.
 
 I checked thise by helloworld program, and tried tutorial's example.
 Please tell to me, if I need to show more detail of this to find my problem.


Troubles

I found out similar warning/error messages on dot kde forum.

 http://dot.kde.org/1081347970/1081357658/1081368053/1081377422/

Overwise, I can not solve my trouble yet.

Run kjscmd command

 I tried to run kjscmd on konsole.
tea@kit> kjscmd
kio (KSycoca): Trying to open ksycoca from /var/tmp/kdecache-tea/ksycoca
kio (KTrader): KServiceTypeProfile::offers( JSBindingPlugin/Binding, )
kio (KTrader): Returning 3 offers
kjsembed: JSFactory::createProxy: Target 'kjsembed_part' type KJSEmbed::KJSEmbedPart
kjsembed: Proxy created
kjscmd: WARNING: addBindingsClass() KJSEmbed::KJSEmbedPart not known
kjsembed: Returning object
kjsembed: TextStream proxy created
kjscmd: TextStreamImp::addBindings()
kjsembed: TextStream proxy created
kjscmd: TextStreamImp::addBindings()
kjsembed: TextStream proxy created
kjscmd: TextStreamImp::addBindings()
kjscmd:  filename 
kjsembed: JSFactory::createProxy: Target 'KJSConfig' type KJSEmbed::Bindings::Config
kjsembed: Proxy created
kjscmd: WARNING: addBindingsClass() KJSEmbed::Bindings::Config not known
kjsembed: Returning object
kjsembed: JSFactory::createProxy: Target 'kjscmd' type KApplication
kjsembed: Proxy created
kjscmd: WARNING: addBindingsClass() KApplication not known
kjsembed: Returning object
kjsembed: JSFactory::createProxy: Target 'kjsembed_part' type KJSEmbed::JSConsoleWidget
kjsembed: Proxy created
kjsembed: WARNING: findSignature: not supported type stackUnder(QWidget*)
kjscmd: WARNING: addBindingsClass() KJSEmbed::JSConsoleWidget not known
kjsembed: Returning object
 This shows errors.
 But I could run kjscmd from start menu -> develop -> kjscmd.
 I checked the shortcut command in start menu, then I could open
 the kjscmd console with --exec option from shell.

Some scripts works.

 This trouble I met is not I can't run all kjs scripts.
 Some scripts works, some does not work.
 > cat hello_kjs.js
 #!/usr/bin/env kjscmd print("Hello, world\n");
    
 > chmod u+x hello_kjs.js
 > ./hello_kjs.js                            /home/tea/tmp/kde/kjs/hello
kio (KSycoca): Trying to open ksycoca from /var/tmp/kdecache-tea/ksycoca
kio (KTrader): KServiceTypeProfile::offers( JSBindingPlugin/Binding, )
kio (KTrader): Returning 3 offers
kjsembed: JSFactory::createProxy: Target 'kjsembed_part' type KJSEmbed::KJSEmbedPart
kjsembed: Proxy created
kjscmd: WARNING: addBindingsClass() KJSEmbed::KJSEmbedPart not known
kjsembed: Returning object
kjsembed: TextStream proxy created
kjscmd: TextStreamImp::addBindings()
kjsembed: TextStream proxy created
kjscmd: TextStreamImp::addBindings()
kjsembed: TextStream proxy created
kjscmd: TextStreamImp::addBindings()
kjscmd:  filename
kjsembed: JSFactory::createProxy: Target 'KJSConfig' type KJSEmbed::Bindings::Config
kjsembed: Proxy created
kjscmd: WARNING: addBindingsClass() KJSEmbed::Bindings::Config not known
kjsembed: Returning object
kjsembed: JSFactory::createProxy: Target 'kjscmd' type KApplication
kjsembed: Proxy created
kjscmd: WARNING: addBindingsClass() KApplication not known
kjsembed: Returning object
kjsembed: KJSEmbedPart::runFile(): file is './hello_kjs.js'
Hello World!
 The console program works. it prints Hello, world on console,
 though it also has warning messages.
 
 I have to note. I don't know what about this warning messages are talking.
hello_ui.js
 #!/usr/bin/env kjscmd
var ui = Factory.loadui("hello_ui.ui"); ui.show(); application.exec();
hello_ui.ui
<!DOCTYPE UI>
<UI version="3.3" stdsetdef="1">
<class>hello_ui</class>
<widget class="QWidget">
    <property name="name">
        <cstring>hello_ui</cstring>
    </property>
    <property name="geometry">
        <rect>
            <x>0</x>
            <y>0</y>
        </rect>
    </property>
    <property name="caption">
        <string>Hello UI</string>
    </property>
    <vbox>
        <property name="name">
            <cstring>unnamed</cstring>
        </property>
        <widget class="QLabel">
            <property name="name">
                <cstring>unnamed</cstring>
            </property>
            <property name="text">
                <string>Hello, world!</string>
            </property>
        </widget>
    </vbox>
</widget>
</UI>
syntax highlighted by Code2HTML, v. 0.9.1

Some script does not work.

I did not try all examples yet. QListView sample workes, QComboBox sample does not.

The ``combo.js'' script from http://xmelegance.org/kjsembed/examples/ QComboBox. I downloaded and no edit. I tried to run the script with several ways, ./combo.js, kjscmd combo.js, kjscmd --exec combo.js, kjscmd --exec -- combo.js. but the results were always same.

kio (KSycoca): Trying to open ksycoca from /var/tmp/kdecache-tea/ksycoca
kio (KTrader): KServiceTypeProfile::offers( JSBindingPlugin/Binding, )
kio (KTrader): Returning 3 offers
kjsembed: JSFactory::createProxy: Target 'kjsembed_part' type KJSEmbed::KJSEmbedPart
kjsembed: Proxy created
kjscmd: WARNING: addBindingsClass() KJSEmbed::KJSEmbedPart not known
kjsembed: Returning object
kjsembed: TextStream proxy created
kjscmd: TextStreamImp::addBindings()
kjsembed: TextStream proxy created
kjscmd: TextStreamImp::addBindings()
kjsembed: TextStream proxy created
kjscmd: TextStreamImp::addBindings()
kjscmd:  filename 
kjsembed: JSFactory::createProxy: Target 'KJSConfig' type KJSEmbed::Bindings::Config
kjsembed: Proxy created
kjscmd: WARNING: addBindingsClass() KJSEmbed::Bindings::Config not known
kjsembed: Returning object
kjsembed: JSFactory::createProxy: Target 'kjscmd' type KApplication
kjsembed: Proxy created
kjscmd: WARNING: addBindingsClass() KApplication not known
kjsembed: Returning object
kjsembed: KJSEmbedPart::runFile(): file is './combo.js'
kjsembed: KJSEmbedPart::create() name  class QHBox
kjsembed: JSFactory::createProxy: Target 'unnamed' type QHBox
kjsembed: Proxy created
kjsembed: WARNING: findSignature: not supported type stackUnder(QWidget*)
kjsembed: Returning object
kjsembed: KJSEmbedPart::create() name  class QLabel
kjsembed: JSFactory::createProxy: Target 'unnamed' type QLabel
kjsembed: Proxy created
kjsembed: WARNING: findSignature: not supported type stackUnder(QWidget*)
kjsembed: WARNING: findSignature: not supported type setPicture(const QPicture&)
kjsembed: WARNING: findSignature: not supported type setMovie(const QMovie&)
kjsembed: Returning object
kjsembed: KJSEmbedPart::create() name  class QComboBox
kjsembed: JSFactory::createProxy: Target 'unnamed' type QComboBox
kjsembed: Proxy created
kjsembed: WARNING: findSignature: not supported type stackUnder(QWidget*)
kjsembed: Returning object
TypeError: Value undefined (result of expression cb.insertItem) is not an object. Cannot be called.
Error and does not show anything.

I doubt my Qt library maybe missing QComboBox class, But I make sure I have the qcombobox.h and I test by simple C++/Qt program.

/**
 * test of QComboBox
 */

#include <qapplication.h> #include <qhbox.h> #include <qlabel.h> #include <qcombobox.h>
int main(int argc, char **argv) { QApplication app( argc, argv ); QHBox hbox; QLabel label( &hbox ); QComboBox cb( &hbox ); label.setText("Combo test"); cb.insertItem("Test 1"); cb.insertItem("Test 2"); cb.insertItem("Test 3"); cb.insertItem("Test 4"); app.setMainWidget( &hbox ); hbox.show();
return app.exec(); }
syntax highlighted by Code2HTML, v. 0.9.1

It's not only the combobox sample. DCOP sample also. when I run dcop.js, I can see the entry of kjscmd-XXX by kdcop and I found out the slot I wrote, but I could not call it.

How can I solve this problem ?

I don't know what information I should show. Because, I did not get the point, yet. and newbie about KDE develop. This document is the all what I tried and what I got.

Can I have your advice ? I hope you can help me.


...

Thanks for reading.

-- Ikkei Shimomura.