• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

parley

  • sources
  • kde-4.14
  • kdeedu
  • parley
  • scripts_test
scripts.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 
3  Copyright 2008 Avgoustinos Kadis <avgoustinos.kadis@kdemail.net>
4 
5  ***************************************************************************/
6 
7 /***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "scripts.h"
17 
18 #include <kross/core/manager.h>
19 #include <kross/core/action.h>
20 
21 #include <KDebug>
22 
28 void ScriptTest::test()
29 {
30 // foreach(QString s, Kross::Manager::self().interpreters())
31 // kDebug() << s;
32 
33  Kross::Action action(this, "MyScript");
34  action.setFile("myscript.py");
35  QVariantList args;
36  QVariant result = action.callFunction("testTuple", args);
37  kDebug() << result;
38 
39 
40  /*Kross::Action action(this,"MyScript");
41  action.setFile("myscript.py");
42  QVariantList args;
43  args << "love";
44  QVariant result = action.callFunction("fetchTranslation",args);
45  QList<QVariant> translations = result.toList();
46 
47  for (int i = 0; i < translations.size(); i++)
48  if (translations[i].canConvert<QString>())
49  kDebug() << translations[i].toString();
50  //if (translations[i].canConvert<QString>()) {*/
51 
52  /*kDebug() << result;
53  QVariant list_result = action.callFunction("returnlist");
54  kDebug() << list_result;
55  QList<QVariant> ql = list_result.toList();
56  for (int i = 0; i < ql.size(); i++)
57  if (ql[i].canConvert<int>())
58  kDebug() << ql[i].toInt(NULL);*/
59  //foreach (QVariant v, list_result.
60 
61 }
62 
66 void ScriptTest::testJS()
67 {
68  Kross::Action action(this, "MyJSScript");
69  action.setFile("myscript.js");
70  QVariantList args;
71  args << "hello";
72  QVariant script_result = action.callFunction("fetchTranslation", args);
73  kDebug() << script_result;
74 }
ScriptTest::test
void test()
Definition: scripts.cpp:28
scripts.h
ScriptTest::testJS
void testJS()
Definition: scripts.cpp:66
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal