Minor fixes for JS global variable viewer.
This commit is contained in:
parent
dc2d3c26aa
commit
1dde9e7e75
|
@ -742,7 +742,7 @@ void QScriptDialog_t::closeWindow(void)
|
||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void QScriptDialog_t::loadPropertyTree(QJSValue& object, QTreeWidgetItem* parentItem)
|
void QScriptDialog_t::loadPropertyTree(QJSValue& object, JsPropertyItem* parentItem)
|
||||||
{
|
{
|
||||||
QJSValueIterator it(object);
|
QJSValueIterator it(object);
|
||||||
|
|
||||||
|
@ -755,7 +755,7 @@ void QScriptDialog_t::loadPropertyTree(QJSValue& object, QTreeWidgetItem* parent
|
||||||
|
|
||||||
if (!isPrototype)
|
if (!isPrototype)
|
||||||
{
|
{
|
||||||
QTreeWidgetItem* item = new QTreeWidgetItem();
|
JsPropertyItem* item = new JsPropertyItem();
|
||||||
QString value;
|
QString value;
|
||||||
const char *type = "unknown";
|
const char *type = "unknown";
|
||||||
|
|
||||||
|
@ -833,6 +833,7 @@ void QScriptDialog_t::loadPropertyTree(QJSValue& object, QTreeWidgetItem* parent
|
||||||
item->setText(0, it.name());
|
item->setText(0, it.name());
|
||||||
item->setText(1, type);
|
item->setText(1, type);
|
||||||
item->setText(2, value);
|
item->setText(2, value);
|
||||||
|
item->jsValue = child;
|
||||||
|
|
||||||
if (parentItem == nullptr)
|
if (parentItem == nullptr)
|
||||||
{
|
{
|
||||||
|
@ -1055,6 +1056,7 @@ void QScriptDialog_t::startScript(void)
|
||||||
|
|
||||||
QJSValue globals = scriptInstance->getEngine()->globalObject();
|
QJSValue globals = scriptInstance->getEngine()->globalObject();
|
||||||
|
|
||||||
|
propTree->clear();
|
||||||
loadPropertyTree(globals);
|
loadPropertyTree(globals);
|
||||||
|
|
||||||
FCEU_WRAPPER_UNLOCK();
|
FCEU_WRAPPER_UNLOCK();
|
||||||
|
|
|
@ -139,6 +139,22 @@ public slots:
|
||||||
void frameFinishedUpdate();
|
void frameFinishedUpdate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class JsPropertyItem : public QTreeWidgetItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
JsPropertyItem()
|
||||||
|
: QTreeWidgetItem()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~JsPropertyItem() override
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QJSValue jsValue;
|
||||||
|
QMap<QString, JsPropertyItem*> childMap;
|
||||||
|
};
|
||||||
|
|
||||||
class QScriptDialog_t : public QDialog
|
class QScriptDialog_t : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -153,7 +169,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *bar);
|
void closeEvent(QCloseEvent *bar);
|
||||||
void openJSKillMessageBox(void);
|
void openJSKillMessageBox(void);
|
||||||
void loadPropertyTree(QJSValue& val, QTreeWidgetItem* parentItem = nullptr);
|
void loadPropertyTree(QJSValue& val, JsPropertyItem* parentItem = nullptr);
|
||||||
|
|
||||||
QTimer *periodicTimer;
|
QTimer *periodicTimer;
|
||||||
QLineEdit *scriptPath;
|
QLineEdit *scriptPath;
|
||||||
|
|
Loading…
Reference in New Issue