Scripting questions

Christian Kreibich christian at whoop.org
Wed Nov 10 01:36:54 UTC 2010


Hi there,

I'm trying to write Amarok scripts in QtScript and have a few questions.

      * When an event callback takes considerable time (e.g. in response
        to a button press) the event loop is apparently not processed.
        How do I need to structure my code to work around this, say to
        update progress bars? Do I have access to QThread at the script
        level (if so, an example would be welcome) or can/should I
        somehow call QScriptEngine::setProcessEventsInterval? 

      * What is the logic for accessing GUI elements in the loaded UI?
        I'm having a hard time understanding how the nesting of layout
        elements in the UI maps to paths into the resulting UI
        structure. For example, some of my GUI's buttons are available
        directly under the toplevel element even though in the .ui they
        are nested in a few layout elements, while for other elements I
        need to specify some (but not all) layouting elements to access
        the element.

      * It seems QString is not available even when using
        Importer.loadQtBinding('qt.core'). Is that correct?

      * Seems it would be great if uncaught exceptions were reported to
        the console by default. It seems they are not reported (even if
        using --debug) unless I use "try {  } catch (err)
        { Amarok.debug(err) }" in my callbacks, which is a bit tedious.
        Am I missing a simple way to do this?

-- 
Cheers,
Christian




More information about the Amarok mailing list