Qt 4.8
qjsdebuggeragent.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDeclarative module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "private/qjsdebuggeragent_p.h"
43 #include "private/qdeclarativedebughelper_p.h"
44 #include "private/qjsdebugservice_p.h"
45 
46 #include <QtCore/qdatetime.h>
47 #include <QtCore/qcoreapplication.h>
48 #include <QtCore/qset.h>
49 #include <QtCore/qurl.h>
50 #include <QtScript/qscriptcontextinfo.h>
51 #include <QtScript/qscriptengine.h>
52 #include <QtScript/qscriptvalueiterator.h>
53 
55 
57 {
58 public:
60  : q(q), state(NoState), isInitialized(false), coverageEnabled(false)
61  {}
62 
63  void continueExec();
66  void positionChange(qint64 scriptId, int lineNumber, int columnNumber);
67  QScriptEngine *engine() { return q->engine(); }
68  void stopped();
69 
70 public:
73  int stepDepth;
74  int stepCount;
75 
79  // breakpoints by filename (without path)
85 };
86 
87 namespace {
88 
89 class SetupExecEnv
90 {
91 public:
92  SetupExecEnv(QJSDebuggerAgentPrivate *a)
93  : agent(a),
94  previousState(a->state),
95  hadException(a->engine()->hasUncaughtException())
96  {
97  agent->state = StoppedState;
98  }
99 
100  ~SetupExecEnv()
101  {
102  if (!hadException && agent->engine()->hasUncaughtException())
103  agent->engine()->clearExceptions();
104  agent->state = previousState;
105  }
106 
107 private:
109  JSDebuggerState previousState;
110  bool hadException;
111 };
112 
113 } // anonymous namespace
114 
115 static JSAgentWatchData fromScriptValue(const QString &expression,
116  const QScriptValue &value)
117 {
118  static const QString arrayStr = QCoreApplication::translate
119  ("Debugger::JSAgentWatchData", "[Array of length %1]");
120  static const QString undefinedStr = QCoreApplication::translate
121  ("Debugger::JSAgentWatchData", "<undefined>");
122 
124  data.exp = expression.toUtf8();
125  data.name = data.exp;
126  data.hasChildren = false;
127  data.value = value.toString().toUtf8();
128  data.objectId = value.objectId();
129  if (value.isArray()) {
130  data.type = "Array";
131  data.value = arrayStr.arg(value.property(QLatin1String("length")).toString()).toUtf8();
132  data.hasChildren = true;
133  } else if (value.isBool()) {
134  data.type = "Bool";
135  // data.value = value.toBool() ? "true" : "false";
136  } else if (value.isDate()) {
137  data.type = "Date";
138  data.value = value.toDateTime().toString().toUtf8();
139  } else if (value.isError()) {
140  data.type = "Error";
141  } else if (value.isFunction()) {
142  data.type = "Function";
143  } else if (value.isUndefined()) {
144  data.type = undefinedStr.toUtf8();
145  } else if (value.isNumber()) {
146  data.type = "Number";
147  } else if (value.isRegExp()) {
148  data.type = "RegExp";
149  } else if (value.isString()) {
150  data.type = "String";
151  } else if (value.isVariant()) {
152  data.type = "Variant";
153  } else if (value.isQObject()) {
154  const QObject *obj = value.toQObject();
155  data.type = "Object";
156  data.value += '[';
157  data.value += obj->metaObject()->className();
158  data.value += ']';
159  data.hasChildren = true;
160  } else if (value.isObject()) {
161  data.type = "Object";
162  data.hasChildren = true;
163  data.value = "[Object]";
164  } else if (value.isNull()) {
165  data.type = "<null>";
166  } else {
167  data.type = "<unknown>";
168  }
169  return data;
170 }
171 
173 {
175  QScriptValueIterator it(object);
176  while (it.hasNext()) {
177  it.next();
179  continue;
180  if (/*object.isQObject() &&*/ it.value().isFunction()) {
181  // Cosmetics: skip all functions and slot, there are too many of them,
182  // and it is not useful information in the debugger.
183  continue;
184  }
186  result.append(data);
187  }
188  if (result.isEmpty()) {
190  data.name = "<no initialized data>";
191  data.hasChildren = false;
192  data.value = " ";
193  data.objectId = 0;
194  result.append(data);
195  }
196  return result;
197 }
198 
199 static QString fileName(const QString &fileUrl)
200 {
201  int lastDelimiterPos = fileUrl.lastIndexOf(QLatin1Char('/'));
202  return fileUrl.mid(lastDelimiterPos, fileUrl.size() - lastDelimiterPos);
203 }
204 
206 {
207  foreach (const JSAgentWatchData &data, list)
208  knownObjectIds << data.objectId;
209 }
210 
212 {
214  if (ctx) {
215  QScriptValue activationObject = ctx->activationObject();
216  QScriptValue thisObject = ctx->thisObject();
217  locals = expandObject(activationObject);
218  if (thisObject.isObject()
219  && thisObject.objectId() != engine()->globalObject().objectId()
220  && QScriptValueIterator(thisObject).hasNext())
221  locals.prepend(fromScriptValue(QLatin1String("this"), thisObject));
222  recordKnownObjects(locals);
223  knownObjectIds << activationObject.objectId();
224  }
225  return locals;
226 }
227 
234  : QObject(parent)
235  , QScriptEngineAgent(engine)
236  , d(new QJSDebuggerAgentPrivate(this))
237 {
239 }
240 
242  : QObject(parent)
243  , QScriptEngineAgent(QDeclarativeDebugHelper::getScriptEngine(engine))
244  , d(new QJSDebuggerAgentPrivate(this))
245 {
247 }
248 
253 {
254  engine()->setAgent(0);
255  delete d;
256 }
257 
262 {
263  return d->isInitialized;
264 }
265 
267 {
268  d->isInitialized = true;
270 }
271 
273 {
274  d->breakpoints = breakpoints;
275 
277  foreach (const JSAgentBreakpointData &bp, breakpoints)
279 
280  d->isInitialized = true;
281 }
282 
284 {
285  d->watchExpressions = watchExpressions;
286 }
287 
289 {
290  d->stepDepth = 0;
292  d->continueExec();
293 }
294 
296 {
297  d->stepDepth = 0;
299  d->continueExec();
300 }
301 
303 {
304  d->stepDepth = 0;
306  d->continueExec();
307 }
308 
310 {
311  d->state = NoState;
312  d->continueExec();
313 }
314 
316 {
317  SetupExecEnv execEnv(d);
318 
319  JSAgentWatchData data = fromScriptValue(expr, engine()->evaluate(expr));
320  d->knownObjectIds << data.objectId;
321  return data;
322 }
323 
325 {
326  SetupExecEnv execEnv(d);
327 
328  QScriptValue v;
329  if (d->knownObjectIds.contains(objectId))
330  v = engine()->objectById(objectId);
331 
333  d->recordKnownObjects(result);
334  return result;
335 }
336 
338 {
339  SetupExecEnv execEnv(d);
340  return d->getLocals(engine()->currentContext());
341 }
342 
344 {
345  SetupExecEnv execEnv(d);
346 
347  int deep = 0;
349  while (ctx && deep < frameId) {
350  ctx = ctx->parentContext();
351  deep++;
352  }
353 
354  return d->getLocals(ctx);
355 }
356 
358 {
359  SetupExecEnv execEnv(d);
360 
362 
363  for (QScriptContext *ctx = engine()->currentContext(); ctx; ctx = ctx->parentContext()) {
365 
366  JSAgentStackData frame;
367  frame.functionName = info.functionName().toUtf8();
368  if (frame.functionName.isEmpty()) {
369  if (ctx->parentContext()) {
370  switch (info.functionType()) {
372  frame.functionName = "<anonymous>";
373  break;
375  frame.functionName = "<native>";
376  break;
379  frame.functionName = "<native slot>";
380  break;
381  }
382  } else {
383  frame.functionName = "<global>";
384  }
385  }
386  frame.lineNumber = info.lineNumber();
387  // if the line number is unknown, fallback to the function line number
388  if (frame.lineNumber == -1)
389  frame.lineNumber = info.functionStartLineNumber();
390 
391  frame.fileUrl = info.fileName().toUtf8();
392  backtrace.append(frame);
393  }
394 
395  return backtrace;
396 }
397 
399 {
400  SetupExecEnv execEnv(d);
401 
403  foreach (const QString &expr, d->watchExpressions)
404  watches << fromScriptValue(expr, engine()->evaluate(expr));
405  d->recordKnownObjects(watches);
406  return watches;
407 }
408 
410  const QString &property,
411  const QString &value)
412 {
413  SetupExecEnv execEnv(d);
414 
415  if (d->knownObjectIds.contains(objectId)) {
416  QScriptValue object = engine()->objectById(objectId);
417  if (object.isObject()) {
418  QScriptValue result = engine()->evaluate(value);
419  object.setProperty(property, result);
420  }
421  }
422 }
423 
428  const QString &fileName, int baseLineNumber)
429 {
430  d->filenames.insert(id, fileName);
431 
432  if (d->coverageEnabled) {
434  id, program, fileName, baseLineNumber,
435  0, 0, QString()};
437  }
438 }
439 
444 {
445  d->filenames.remove(id);
446 }
447 
452 {
453 }
454 
459 {
460 }
461 
466 {
467  d->stepDepth++;
468 
469  if (d->coverageEnabled) {
471  scriptId, QString(), QString(), 0, 0, 0, QString()};
474  }
475 }
476 
480 void QJSDebuggerAgent::functionExit(qint64 scriptId, const QScriptValue &returnValue)
481 {
482  d->stepDepth--;
483 
484  if (d->coverageEnabled) {
486  scriptId, QString(), QString(), 0, 0, 0, returnValue.toString()};
488  }
489 }
490 
494 void QJSDebuggerAgent::positionChange(qint64 scriptId, int lineNumber, int columnNumber)
495 {
496  d->positionChange(scriptId, lineNumber, columnNumber);
497 
498  if (d->coverageEnabled) {
500  scriptId, QString(), QString(), 0, lineNumber, columnNumber, QString()};
502  }
503 }
504 
505 void QJSDebuggerAgentPrivate::positionChange(qint64 scriptId, int lineNumber, int columnNumber)
506 {
507  Q_UNUSED(columnNumber);
508 
509  if (state == StoppedState)
510  return; //no re-entrency
511 
512  // check breakpoints
513  if (!breakpoints.isEmpty()) {
514  const QScriptContext *ctx = engine()->currentContext();
515  const QScriptContextInfo info(ctx);
516 
518  QHash<qint64, QString>::const_iterator it = filenames.constFind(scriptId);
519  // It is possible that the scripts are loaded before the agent is attached
520  if (it == filenames.constEnd()) {
521  it = filenames.insert(scriptId, info.fileName());
522  }
523 
524  const QString filePath = it.value();
525  const JSAgentBreakpoints bps = fileNameToBreakpoints.values(fileName(filePath)).toSet();
526 
527  foreach (const JSAgentBreakpointData &bp, bps) {
528  if (bp.lineNumber == lineNumber) {
529  stopped();
530  return;
531  }
532  }
533  }
534  }
535 
536  switch (state) {
537  case NoState:
538  case StoppedState:
539  // Do nothing
540  break;
541  case SteppingOutState:
542  if (stepDepth >= 0)
543  break;
544  //fallthough
545  case SteppingOverState:
546  if (stepDepth > 0)
547  break;
548  //fallthough
549  case SteppingIntoState:
550  stopped();
551  break;
552  }
553 
554 }
555 
560  const QScriptValue &exception,
561  bool hasHandler)
562 {
563  Q_UNUSED(scriptId);
564  Q_UNUSED(exception);
565  Q_UNUSED(hasHandler);
566 // qDebug() << Q_FUNC_INFO << exception.toString() << hasHandler;
567 #if 0 //sometimes, we get exceptions that we should just ignore.
568  if (!hasHandler && state != StoppedState)
569  stopped(true, exception);
570 #endif
571 }
572 
576 void QJSDebuggerAgent::exceptionCatch(qint64 scriptId, const QScriptValue &exception)
577 {
578  Q_UNUSED(scriptId);
579  Q_UNUSED(exception);
580 }
581 
583 {
585 }
586 
588 {
590  d->stopped();
591  return QVariant();
592  }
593  return QScriptEngineAgent::extension(extension, argument);
594 }
595 
597 {
598  bool becauseOfException = false;
599  const QScriptValue &exception = QScriptValue();
600 
601  knownObjectIds.clear();
602  state = StoppedState;
603 
604  emit q->stopped(becauseOfException, exception.toString());
605 
607 }
608 
610 {
611  loop.quit();
612 }
613 
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
double d
Definition: qnumeric_p.h:62
The QScriptContext class represents a Qt Script function invocation.
bool isUndefined() const
Returns true if this QScriptValue is of the primitive type Undefined; otherwise returns false...
void stopped(bool becauseOfException, const QString &exception)
bool isNull() const
Returns true if this QScriptValue is of the primitive type Null; otherwise returns false...
QScriptValue evaluate(const QString &program, const QString &fileName=QString(), int lineNumber=1)
Evaluates program, using lineNumber as the base line number, and returns the result of the evaluation...
JSAgentWatchData executeExpression(const QString &expr)
QScriptValue property(const QString &name, const ResolveFlags &mode=ResolvePrototype) const
Returns the value of this QScriptValue&#39;s property with the given name, using the given mode to resolv...
static mach_timebase_info_data_t info
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QList< JSAgentWatchData > getLocals(QScriptContext *)
void clear()
Removes all items from the hash.
Definition: qhash.h:574
bool isBool() const
Returns true if this QScriptValue is of the primitive type Boolean; otherwise returns false...
void exceptionThrow(qint64 scriptId, const QScriptValue &exception, bool hasHandler)
Reimplemented Function
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
bool isFunction() const
Returns true if this QScriptValue is a function; otherwise returns false.
void setProperty(qint64 objectId, const QString &property, const QString &value)
QDateTime toDateTime() const
Returns a QDateTime representation of this value, in local time.
bool supportsExtension(Extension extension) const
Returns true if the QScriptEngineAgent supports the given extension; otherwise, false is returned...
#define it(className, varName)
QScriptEngine * engine() const
Returns the QScriptEngine that this agent is associated with.
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
Definition: qstring.cpp:4074
~QJSDebuggerAgent()
Destroys this QJSDebuggerAgent.
bool isError() const
Returns true if this QScriptValue is an object of the Error class; otherwise returns false...
QString toString() const
Returns the string value of this QScriptValue, as defined in ECMA-262 section 9.8, "ToString".
JSDebuggerState
QScriptValue globalObject() const
Returns this engine&#39;s Global Object.
QScriptValue objectById(qint64 id) const
Returns the object with the given id, or an invalid QScriptValue if there is no object with that id...
QList< JSAgentWatchData > watches()
QString name() const
Returns the name of the last property that was jumped over using next() or previous().
void exceptionCatch(qint64 scriptId, const QScriptValue &exception)
Reimplemented Function
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
QObject * toQObject() const
If this QScriptValue is a QObject, returns the QObject pointer that the QScriptValue represents; othe...
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
QVariant extension(Extension extension, const QVariant &argument=QVariant())
This virtual function can be reimplemented in a QScriptEngineAgent subclass to provide support for ex...
QString toString(Qt::DateFormat f=Qt::TextDate) const
Returns the datetime as a string in the format given.
Definition: qdatetime.cpp:2628
qint64 elapsed() const
Returns the number of milliseconds since this QElapsedTimer was last started.
void recordKnownObjects(const QList< JSAgentWatchData > &)
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
void positionChange(qint64 scriptId, int lineNumber, int columnNumber)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QHash< QString, JSAgentBreakpointData > fileNameToBreakpoints
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
void processMessage(const JSAgentCoverageData &message)
static QString translate(const char *context, const char *key, const char *disambiguation=0, Encoding encoding=CodecForTr)
QString fileName() const
Returns the name of the file where the code being executed was defined, if available; otherwise retur...
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
qint64 objectId() const
Returns the ID of this object, or -1 if this QScriptValue is not an object.
QList< JSAgentWatchData > locals()
The QScriptEngine class provides an environment for evaluating Qt Script code.
JSAgentBreakpoints breakpoints
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
virtual QVariant extension(Extension extension, const QVariant &argument=QVariant())
This virtual function can be reimplemented in a QScriptEngineAgent subclass to provide support for ex...
qint64 restart()
Restarts the timer and returns the time elapsed since the previous start.
The QEventLoop class provides a means of entering and leaving an event loop.
Definition: qeventloop.h:55
int lineNumber() const
Returns the line number corresponding to the statement being executed, or -1 if the line number is no...
QJSDebuggerAgentPrivate(QJSDebuggerAgent *q)
QHash< qint64, QString > filenames
unsigned __int64 quint64
Definition: qglobal.h:943
bool contains(const T &value) const
Definition: qset.h:91
int size() const
Returns the number of characters in this string.
Definition: qstring.h:102
bool isString() const
Returns true if this QScriptValue is of the primitive type String; otherwise returns false...
QElapsedTimer m_timer
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
#define emit
Definition: qobjectdefs.h:76
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
void contextPop()
Reimplemented Function
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Definition: qstring.cpp:4302
QScriptEngine * engine()
QList< JSAgentWatchData > localsAtFrame(int frameId)
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
void setBreakpoints(const JSAgentBreakpoints &)
void setCoverageEnabled(bool enabled)
__int64 qint64
Definition: qglobal.h:942
bool isVariant() const
Returns true if this QScriptValue is a variant value; otherwise returns false.
static QList< JSAgentWatchData > expandObject(const QScriptValue &object)
void setWatchExpressions(const QStringList &)
QJSDebuggerAgentPrivate * d
int functionStartLineNumber() const
Returns the line number where the definition of the called function starts, or -1 if the line number ...
QList< JSAgentStackData > backtrace()
QScriptValue::PropertyFlags flags() const
Returns the flags of the last property that was jumped over using next() or previous().
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
void setProperty(const QString &name, const QScriptValue &value, const PropertyFlags &flags=KeepExistingFlags)
Sets the value of this QScriptValue&#39;s property with the given name to the given value.
The QScriptContextInfo class provides additional information about a QScriptContext.
bool isNumber() const
Returns true if this QScriptValue is of the primitive type Number; otherwise returns false...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
The QScriptValueIterator class provides a Java-style iterator for QScriptValue.
void functionEntry(qint64 scriptId)
Reimplemented Function
The QDeclarativeEngine class provides an environment for instantiating QML components.
bool isRegExp() const
Returns true if this QScriptValue is an object of the RegExp class; otherwise returns false...
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:3000
QObject * parent() const
Returns a pointer to the parent object.
Definition: qobject.h:273
#define ctx
Definition: qgl.cpp:6094
QScriptValue value() const
Returns the value of the last property that was jumped over using next() or previous().
QJSDebuggerAgent(QScriptEngine *engine, QObject *parent=0)
Constructs a new agent for the given engine.
QScriptContext * currentContext() const
Returns the current context.
const char * className() const
Returns the class name.
Definition: qobjectdefs.h:491
QList< JSAgentWatchData > expandObjectById(quint64 objectId)
static JSAgentWatchData fromScriptValue(const QString &expression, const QScriptValue &value)
bool isQObject() const
Returns true if this QScriptValue is a QObject; otherwise returns false.
QVariant property(const char *name) const
Returns the value of the object&#39;s name property.
Definition: qobject.cpp:3807
FunctionType functionType() const
Returns the type of the called function.
bool isDate() const
Returns true if this QScriptValue is an object of the Date class; otherwise returns false...
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
QScriptValue activationObject() const
Returns the activation object of this QScriptContext.
QList< T > values() const
Definition: qset.h:232
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:772
void setAgent(QScriptEngineAgent *agent)
Installs the given agent on this engine.
bool isArray() const
Returns true if this QScriptValue is an object of the Array class; otherwise returns false...
QScriptValue thisObject() const
Returns the `this&#39; object associated with this QScriptContext.
static QJSDebugService * instance()
void contextPush()
Reimplemented Function
bool hasUncaughtException() const
Returns true if the last script evaluation resulted in an uncaught exception; otherwise returns false...
Extension
This enum specifies the possible extensions to a QScriptEngineAgent.
void functionExit(qint64 scriptId, const QScriptValue &returnValue)
Reimplemented Function
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57
bool isInitialized() const
Indicates whether the agent got the list of breakpoints.
void scriptUnload(qint64 id)
Reimplemented Function
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
static QString fileName(const QString &fileUrl)
void positionChange(qint64 scriptId, int lineNumber, int columnNumber)
Reimplemented Function
The QScriptEngineAgent class provides an interface to report events pertaining to QScriptEngine execu...
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
#define enabled
void next()
Advances the iterator by one position.
void scriptLoad(qint64 id, const QString &program, const QString &fileName, int baseLineNumber)
Reimplemented Function
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
QScriptContext * parentContext() const
Returns the parent context of this QScriptContext.
bool isObject() const
Returns true if this QScriptValue is of the Object type; otherwise returns false. ...
bool hasNext() const
Returns true if there is at least one item ahead of the iterator (i.e.
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QString functionName() const
Returns the name of the called function, or an empty string if the name is not available.