| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2018 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtSCriptTools 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 The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/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 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | #include "qscriptdebuggerlocalswidget_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggerlocalswidget_p.h`/ |
| 41 | #include "qscriptdebuggerlocalswidgetinterface_p_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggerlocalswidgetinterface_p_p.h`/ |
| 42 | #include "qscriptdebuggerlocalsmodel_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggerlocalsmodel_p.h`/ |
| 43 | #include "qscriptcompletionproviderinterface_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptcompletionproviderinterface_p.h`/ |
| 44 | #include "qscriptcompletiontaskinterface_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptcompletiontaskinterface_p.h`/ |
| 45 | |
| 46 | #include <QtCore/qdebug.h> |
| 47 | #include <QtWidgets/qheaderview.h> |
| 48 | #include <QtWidgets/qcompleter.h> |
| 49 | #include <QtCore/qstringlistmodel.h> |
| 50 | #include <QtWidgets/qtreeview.h> |
| 51 | #include <QtWidgets/qboxlayout.h> |
| 52 | #include <QtCore/qsortfilterproxymodel.h> |
| 53 | #include <QtWidgets/qlineedit.h> |
| 54 | #include <QtWidgets/qstyleditemdelegate.h> |
| 55 | #include <QtGui/qevent.h> |
| 56 | #include <QtWidgets/qmessagebox.h> |
| 57 | #include <QtScript/qscriptengine.h>cxx . . $ `<file>/include/QtScript/qscriptengine.h`/ |
| 58 | |
| 59 | QT_BEGIN_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:148:10`! |
| 60 | |
| 61 | namespacecxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp`/ { |
| 62 | |
| 63 | class CustomProxyModelcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp`/CustomProxyModel# : public QSortFilterProxyModelcxx . . $ QSortFilterProxyModel# |
| 64 | { |
| 65 | public: |
| 66 | CustomProxyModelcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp`/CustomProxyModel#CustomProxyModel(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent = 0) |
| 67 | : QSortFilterProxyModelcxx . . $ QSortFilterProxyModel#(parent) {} |
| 68 | |
| 69 | bool hasChildrencxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp`/CustomProxyModel#hasChildren(b4ec4506a4420b60).(const QModelIndexcxx . . $ QModelIndex# &parent) const |
| 70 | { |
| 71 | if (!sourceModelcxx . . $ QAbstractProxyModel#sourceModel(c9c1e11e7bd96493).()) |
| 72 | return false; |
| 73 | QModelIndexcxx . . $ QModelIndex# sourceParent = mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(parent); |
| 74 | if (parent.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).() && !sourceParent.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) |
| 75 | return false; |
| 76 | return sourceModelcxx . . $ QAbstractProxyModel#sourceModel(c9c1e11e7bd96493).()->hasChildren(sourceParent); |
| 77 | } |
| 78 | }; |
| 79 | |
| 80 | } // namespace |
| 81 | |
| 82 | class QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate# |
| 83 | : public QScriptDebuggerLocalsWidgetInterfacePrivatecxx . . $ QScriptDebuggerLocalsWidgetInterfacePrivate# |
| 84 | { |
| 85 | Q_DECLARE_PUBLICcxx . . $ `<external>/15045578679651060896/qglobal.h:1172:9`!(QScriptDebuggerLocalsWidget) |
| 86 | public: |
| 87 | QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#QScriptDebuggerLocalsWidgetPrivate(49f6e7a06ebc5aa8).(); |
| 88 | ~cxx . . $ QScriptDebuggerLocalsWidgetPrivate#`~QScriptDebuggerLocalsWidgetPrivate`(ced63f7c635d850d).QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#(); |
| 89 | |
| 90 | void completecxx . . $ QScriptDebuggerLocalsWidgetPrivate#complete(17ab243aad10630c).(QLineEditcxx . . $ QLineEdit# *le); |
| 91 | |
| 92 | // private slots |
| 93 | void _q_onCompletionTaskFinishedcxx . . $ QScriptDebuggerLocalsWidgetPrivate#_q_onCompletionTaskFinished(49f6e7a06ebc5aa8).(); |
| 94 | void _q_insertCompletioncxx . . $ QScriptDebuggerLocalsWidgetPrivate#_q_insertCompletion(3520e46b33348bf6).(const QStringcxx . . $ QString# &text); |
| 95 | void _q_expandIndexcxx . . $ QScriptDebuggerLocalsWidgetPrivate#_q_expandIndex(87a6de385263c395).(const QModelIndexcxx . . $ QModelIndex# &index); |
| 96 | |
| 97 | QTreeViewcxx . . $ QTreeView# *viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.; |
| 98 | QPointercxx . . $ QPointer#<QLineEditcxx . . $ QLineEdit#> completingEditorcxx . . $ QScriptDebuggerLocalsWidgetPrivate#completingEditor.; |
| 99 | QCompletercxx . . $ QCompleter# *completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer.; |
| 100 | CustomProxyModelcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp`/CustomProxyModel# *proxycxx . . $ QScriptDebuggerLocalsWidgetPrivate#proxy.; |
| 101 | }; |
| 102 | |
| 103 | QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#::QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#QScriptDebuggerLocalsWidgetPrivate(49f6e7a06ebc5aa8).() |
| 104 | { |
| 105 | completingEditor = 0; |
| 106 | completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer. = 0; |
| 107 | proxycxx . . $ QScriptDebuggerLocalsWidgetPrivate#proxy. = 0; |
| 108 | } |
| 109 | |
| 110 | QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#::~cxx . . $ QScriptDebuggerLocalsWidgetPrivate#`~QScriptDebuggerLocalsWidgetPrivate`(ced63f7c635d850d).QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#() |
| 111 | { |
| 112 | } |
| 113 | |
| 114 | void QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#::completecxx . . $ QScriptDebuggerLocalsWidgetPrivate#complete(17ab243aad10630c).(QLineEditcxx . . $ QLineEdit# *le) |
| 115 | { |
| 116 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(QScriptDebuggerLocalsWidget); |
| 117 | QScriptCompletionTaskInterfacecxx . . $ QScriptCompletionTaskInterface# *task = 0; |
| 118 | // ### need to pass the current frame # |
| 119 | task = completionProvider->createCompletionTask( |
| 120 | le->text(), le->cursorPosition(), |
| 121 | q->localsModel()->frameIndex(), /*options=*/0); |
| 122 | QObjectcxx . . $ QObject#::connectcxx . . $ QObjectPrivate#connect(835f87066c895669).(task, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(finished()), |
| 123 | q, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(_q_onCompletionTaskFinished())); |
| 124 | completingEditor = le; |
| 125 | task->startcxx . . $ QScriptCompletionTaskInterface#start(49f6e7a06ebc5aa8).(); |
| 126 | } |
| 127 | |
| 128 | void QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#::_q_onCompletionTaskFinishedcxx . . $ QScriptDebuggerLocalsWidgetPrivate#_q_onCompletionTaskFinished(49f6e7a06ebc5aa8).() |
| 129 | { |
| 130 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(QScriptDebuggerLocalsWidget); |
| 131 | QScriptCompletionTaskInterfacecxx . . $ QScriptCompletionTaskInterface# *task = 0; |
| 132 | task = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QScriptCompletionTaskInterfacecxx . . $ QScriptCompletionTaskInterface#*>(q_funccxx . . $ QScriptDebuggerLocalsWidgetPrivate#q_func(4563fc973231f07e).()->sendercxx . . $ QObject#sender(2dbb680a34285c44).()); |
| 133 | if (!completingEditor) { |
| 134 | task->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 135 | return; |
| 136 | } |
| 137 | |
| 138 | if (task->resultCountcxx . . $ QScriptCompletionTaskInterface#resultCount(455f465bc33b4cdf).() == 1) { |
| 139 | // do the completion right away |
| 140 | QStringcxx . . $ QString# completion = task->resultAtcxx . . $ QScriptCompletionTaskInterface#resultAt(3f3c3d0e9c0eb37f).(0); |
| 141 | completion.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(task->appendixcxx . . $ QScriptCompletionTaskInterface#appendix(6ef7b6c27b00b43d).()); |
| 142 | QStringcxx . . $ QString# tmp = completingEditor->text(); |
| 143 | tmp.removecxx . . $ QString#remove(6483560ce2afa901).(task->positioncxx . . $ QScriptCompletionTaskInterface#position(455f465bc33b4cdf).(), task->lengthcxx . . $ QScriptCompletionTaskInterface#length(455f465bc33b4cdf).()); |
| 144 | tmp.insertcxx . . $ QString#insert(2bb32e75202d9675).(task->positioncxx . . $ QScriptCompletionTaskInterface#position(455f465bc33b4cdf).(), completion); |
| 145 | completingEditor->setText(tmp); |
| 146 | completingEditor = 0; |
| 147 | } else if (task->resultCountcxx . . $ QScriptCompletionTaskInterface#resultCount(455f465bc33b4cdf).() > 1) { |
| 148 | // popup completion |
| 149 | if (!completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer.) { |
| 150 | completer = new QCompleter(q); |
| 151 | completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer.->setCompletionModecxx . . $ QCompleter#setCompletionMode(73b436c818b58342).(QCompletercxx . . $ QCompleter#::PopupCompletioncxx . . $ QCompleter#PopupCompletion.); |
| 152 | completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer.->setCaseSensitivitycxx . . $ QCompleter#setCaseSensitivity(dbd87adfa24451df).(Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.); |
| 153 | completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer.->setWrapAroundcxx . . $ QCompleter#setWrapAround(b45ddcbc8423892c).(false); |
| 154 | QObjectcxx . . $ QObject#::connectcxx . . $ QObjectPrivate#connect(835f87066c895669).(completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(activated(QString)), |
| 155 | q, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(_q_insertCompletion(QString))); |
| 156 | } |
| 157 | #ifndef QT_NO_STRINGLISTMODEL |
| 158 | QStringListModelcxx . . $ QStringListModel# *model = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QStringListModelcxx . . $ QStringListModel#*>(completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer.->modelcxx . . $ QCompleter#model(c9c1e11e7bd96493).()); |
| 159 | if (!model) { |
| 160 | model = new QStringListModel(q); |
| 161 | completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer.->setModelcxx . . $ QCompleter#setModel(c6e1f1e42522b780).(model); |
| 162 | } |
| 163 | QStringListcxx . . $ QStringList# stringscxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 164 | for (int i = 0; i < task->resultCountcxx . . $ QScriptCompletionTaskInterface#resultCount(455f465bc33b4cdf).(); ++i) |
| 165 | strings.append(task->resultAtcxx . . $ QScriptCompletionTaskInterface#resultAt(3f3c3d0e9c0eb37f).(i)); |
| 166 | model->setStringListcxx . . $ QStringListModel#setStringList(631c0101495f0328).(strings); |
| 167 | #endif |
| 168 | QStringcxx . . $ QString# prefix = completingEditor->text().mid(task->position(), task->length()); |
| 169 | completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer.->setCompletionPrefixcxx . . $ QCompleter#setCompletionPrefix(3520e46b33348bf6).(prefix); |
| 170 | completingEditor->setCompleter(completer); |
| 171 | // we want to handle the insertion ourselves |
| 172 | QObjectcxx . . $ QObject#::disconnectcxx . . $ QObjectPrivate#disconnect(4b4856c80ea1a80c).(completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer., 0, completingEditor, 0); |
| 173 | completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer.->completecxx . . $ QCompleter#complete(22ba0428947158b).(); |
| 174 | } |
| 175 | task->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 176 | } |
| 177 | |
| 178 | void QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#::_q_insertCompletioncxx . . $ QScriptDebuggerLocalsWidgetPrivate#_q_insertCompletion(3520e46b33348bf6).(const QStringcxx . . $ QString# &text) |
| 179 | { |
| 180 | Q_ASSERTcxx . . $ `<external>/15045578679651060896/qglobal.h:859:13`!(completingEditor != 0); |
| 181 | QStringcxx . . $ QString# tmp = completingEditor->text(); |
| 182 | tmp.insertcxx . . $ QString#insert(2bb32e75202d9675).(completingEditor->cursorPosition(), text.midcxx . . $ QString#mid(44b7563da18aea72).(completercxx . . $ QScriptDebuggerLocalsWidgetPrivate#completer.->completionPrefixcxx . . $ QCompleter#completionPrefix(6ef7b6c27b00b43d).().lengthcxx . . $ QString#length(455f465bc33b4cdf).())); |
| 183 | completingEditor->setText(tmp); |
| 184 | completingEditor = 0; |
| 185 | } |
| 186 | |
| 187 | void QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#::_q_expandIndexcxx . . $ QScriptDebuggerLocalsWidgetPrivate#_q_expandIndex(87a6de385263c395).(const QModelIndexcxx . . $ QModelIndex# &index) |
| 188 | { |
| 189 | if (viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->modelcxx . . $ QAbstractItemView#model(c9c1e11e7bd96493).() ==cxx . . $ `operator==`(abb235a625a921b3). index.modelcxx . . $ QModelIndex#model(9e8e94cc3b959740).()) |
| 190 | viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->expandcxx . . $ QTreeView#expand(87a6de385263c395).(proxycxx . . $ QScriptDebuggerLocalsWidgetPrivate#proxy.->mapFromSourcecxx . . $ QSortFilterProxyModel#mapFromSource(f800c6f2fa4cbe57).(index)); |
| 191 | } |
| 192 | |
| 193 | class QScriptDebuggerLocalsItemDelegatecxx . . $ QScriptDebuggerLocalsItemDelegate# |
| 194 | : public QStyledItemDelegatecxx . . $ QStyledItemDelegate# |
| 195 | { |
| 196 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 197 | public: |
| 198 | QScriptDebuggerLocalsItemDelegatecxx . . $ QScriptDebuggerLocalsItemDelegate#QScriptDebuggerLocalsItemDelegate(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent = 0); |
| 199 | |
| 200 | QWidgetcxx . . $ QWidget# *createEditorcxx . . $ QScriptDebuggerLocalsItemDelegate#createEditor(f2c7e294f1841167).(QWidgetcxx . . $ QWidget# *parent, const QStyleOptionViewItemcxx . . $ QStyleOptionViewItem# &option, const QModelIndexcxx . . $ QModelIndex# &index) const; |
| 201 | void setModelDatacxx . . $ QScriptDebuggerLocalsItemDelegate#setModelData(3e66fac4f8e72d1b).(QWidgetcxx . . $ QWidget# *editor, QAbstractItemModelcxx . . $ QAbstractItemModel# *model, const QModelIndexcxx . . $ QModelIndex# &index) const; |
| 202 | void paintcxx . . $ QScriptDebuggerLocalsItemDelegate#paint(a0cfc6dde5a97d5a).(QPaintercxx . . $ QPainter# *painter, const QStyleOptionViewItemcxx . . $ QStyleOptionViewItem# &option, const QModelIndexcxx . . $ QModelIndex# &index) const; |
| 203 | |
| 204 | bool eventFiltercxx . . $ QScriptDebuggerLocalsItemDelegate#eventFilter(978aa4af1d030efa).(QObjectcxx . . $ QObject# *watched, QEventcxx . . $ QEvent# *event); |
| 205 | |
| 206 | private Q_SLOTScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:92:10`!: |
| 207 | void validateInputcxx . . $ QScriptDebuggerLocalsItemDelegate#validateInput(3520e46b33348bf6).(const QStringcxx . . $ QString# &text) |
| 208 | { |
| 209 | QWidgetcxx . . $ QWidget# *editor = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QWidgetcxx . . $ QWidget#*>(sendercxx . . $ QObject#sender(2dbb680a34285c44).()); |
| 210 | QPalettecxx . . $ QPalette# pal = editorcxx . . $ QPalette#QPalette(f826ed73d5553cd5).->palettecxx . . $ QWidget#palette(a7bd6a16d2c88209).(); |
| 211 | QColorcxx . . $ QColor# colcxx . . $ QColor#QColor(ced63f7c635d850d).; |
| 212 | bool ok = (QScriptEnginecxx . . $ QScriptEngine#::checkSyntaxcxx . . $ QScriptEngine#checkSyntax(8d9372f5264bad7a).(text).statecxx . . $ QScriptSyntaxCheckResult#state(6de130bf2cd181e2).() == QScriptSyntaxCheckResultcxx . . $ QScriptSyntaxCheckResult#::Validcxx . . $ QScriptSyntaxCheckResult#Valid.); |
| 213 | if (ok) { |
| 214 | col =cxx . . $ QColor#`operator=`(7dc25a5504d99c29). Qtcxx . . $ Qt/::whitecxx . . $ Qt/white.; |
| 215 | } else { |
| 216 | QScriptSyntaxCheckResultcxx . . $ QScriptSyntaxCheckResult# result = QScriptEnginecxx . . $ QScriptEngine#::checkSyntaxcxx . . $ QScriptEngine#checkSyntax(8d9372f5264bad7a).( |
| 217 | text + QLatin1Charcxx . . $ QLatin1Char#('\n')); |
| 218 | if (result.statecxx . . $ QScriptSyntaxCheckResult#state(6de130bf2cd181e2).() == QScriptSyntaxCheckResultcxx . . $ QScriptSyntaxCheckResult#::Intermediatecxx . . $ QScriptSyntaxCheckResult#Intermediate.) |
| 219 | col =cxx . . $ QColor#`operator=`(fd1b853fb77c9003). QColorcxx . . $ QColor#QColor(2261ffe5112eab06).(255, 240, 192); |
| 220 | else |
| 221 | col =cxx . . $ QColor#`operator=`(fd1b853fb77c9003). QColorcxx . . $ QColor#QColor(2261ffe5112eab06).(255, 102, 102); |
| 222 | } |
| 223 | pal.setColorcxx . . $ QPalette#setColor(5c3218fcc49a2895).(QPalettecxx . . $ QPalette#::Activecxx . . $ QPalette#Active., QPalettecxx . . $ QPalette#::Basecxx . . $ QPalette#Base., col); |
| 224 | editor->setPalettecxx . . $ QWidget#setPalette(f826ed73d5553cd5).(pal); |
| 225 | } |
| 226 | }; |
| 227 | |
| 228 | QScriptDebuggerLocalsItemDelegatecxx . . $ QScriptDebuggerLocalsItemDelegate#::QScriptDebuggerLocalsItemDelegatecxx . . $ QScriptDebuggerLocalsItemDelegate#QScriptDebuggerLocalsItemDelegate(749de1b6ae65bddd).( |
| 229 | QObjectcxx . . $ QObject# *parent) |
| 230 | : QStyledItemDelegatecxx . . $ QStyledItemDelegate#(parent) |
| 231 | { |
| 232 | } |
| 233 | |
| 234 | QWidgetcxx . . $ QWidget# *QScriptDebuggerLocalsItemDelegatecxx . . $ QScriptDebuggerLocalsItemDelegate#::createEditorcxx . . $ QScriptDebuggerLocalsItemDelegate#createEditor(f2c7e294f1841167).( |
| 235 | QWidgetcxx . . $ QWidget# *parent, const QStyleOptionViewItemcxx . . $ QStyleOptionViewItem# &option, |
| 236 | const QModelIndexcxx . . $ QModelIndex# &index) const |
| 237 | { |
| 238 | QWidgetcxx . . $ QWidget# *editor = QStyledItemDelegatecxx . . $ QStyledItemDelegate#::createEditorcxx . . $ QStyledItemDelegate#createEditor(f2c7e294f1841167).(parent, option, index); |
| 239 | if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 1) { |
| 240 | // value |
| 241 | QLineEditcxx . . $ QLineEdit# *le = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QLineEditcxx . . $ QLineEdit#*>(editor); |
| 242 | if (le) { |
| 243 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(le, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(textEdited(QString)), |
| 244 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(validateInput(QString))); |
| 245 | } |
| 246 | } |
| 247 | return editor; |
| 248 | } |
| 249 | |
| 250 | bool QScriptDebuggerLocalsItemDelegatecxx . . $ QScriptDebuggerLocalsItemDelegate#::eventFiltercxx . . $ QScriptDebuggerLocalsItemDelegate#eventFilter(978aa4af1d030efa).(QObjectcxx . . $ QObject# *watched, QEventcxx . . $ QEvent# *event) |
| 251 | { |
| 252 | QLineEditcxx . . $ QLineEdit# *le = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QLineEditcxx . . $ QLineEdit#*>(watched); |
| 253 | if (!le) |
| 254 | return QStyledItemDelegatecxx . . $ QStyledItemDelegate#::eventFiltercxx . . $ QStyledItemDelegate#eventFilter(978aa4af1d030efa).(watched, event); |
| 255 | |
| 256 | QScriptDebuggerLocalsWidgetcxx . . $ QScriptDebuggerLocalsWidget# *localsWidget = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QScriptDebuggerLocalsWidgetcxx . . $ QScriptDebuggerLocalsWidget#*>(parentcxx . . $ QObject#parent(2dbb680a34285c44).()); |
| 257 | Q_ASSERTcxx . . $ `<external>/15045578679651060896/qglobal.h:859:13`!(localsWidget != 0); |
| 258 | QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate# *lvp = |
| 259 | reinterpret_cast<QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#*>( |
| 260 | QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#::getcxx . . $ QWidgetPrivate#get(6c8170cf30417fdb).(localsWidget)); |
| 261 | |
| 262 | if ((event->typecxx . . $ QEvent#type(916a8de57f4d422b).() == QEventcxx . . $ QEvent#::FocusIncxx . . $ QEvent#FocusIn.) && lvp->completingEditor) { |
| 263 | // because QLineEdit insists on being difficult... |
| 264 | return true; |
| 265 | } |
| 266 | |
| 267 | if (event->typecxx . . $ QEvent#type(916a8de57f4d422b).() != QEventcxx . . $ QEvent#::KeyPresscxx . . $ QEvent#KeyPress.) |
| 268 | return QStyledItemDelegatecxx . . $ QStyledItemDelegate#::eventFiltercxx . . $ QStyledItemDelegate#eventFilter(978aa4af1d030efa).(watched, event); |
| 269 | QKeyEventcxx . . $ QKeyEvent# *ke = static_cast<QKeyEvent*>(event); |
| 270 | if ((ke->keycxx . . $ QKeyEvent#key(455f465bc33b4cdf).() == Qtcxx . . $ Qt/::Key_Entercxx . . $ Qt/Key_Enter.) || (ke->keycxx . . $ QKeyEvent#key(455f465bc33b4cdf).() == Qtcxx . . $ Qt/::Key_Returncxx . . $ Qt/Key_Return.)) { |
| 271 | if (QScriptEnginecxx . . $ QScriptEngine#::checkSyntaxcxx . . $ QScriptEngine#checkSyntax(8d9372f5264bad7a).(le->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).()).statecxx . . $ QScriptSyntaxCheckResult#state(6de130bf2cd181e2).() != QScriptSyntaxCheckResultcxx . . $ QScriptSyntaxCheckResult#::Validcxx . . $ QScriptSyntaxCheckResult#Valid.) { |
| 272 | // ignore when script contains syntax error |
| 273 | return true; |
| 274 | } |
| 275 | } |
| 276 | if (ke->keycxx . . $ QKeyEvent#key(455f465bc33b4cdf).() != Qtcxx . . $ Qt/::Key_Tabcxx . . $ Qt/Key_Tab.) |
| 277 | return QStyledItemDelegatecxx . . $ QStyledItemDelegate#::eventFiltercxx . . $ QStyledItemDelegate#eventFilter(978aa4af1d030efa).(watched, event); |
| 278 | |
| 279 | // trigger completion |
| 280 | lvp->completecxx . . $ QScriptDebuggerLocalsWidgetPrivate#complete(17ab243aad10630c).(le); |
| 281 | return true; |
| 282 | } |
| 283 | |
| 284 | void QScriptDebuggerLocalsItemDelegatecxx . . $ QScriptDebuggerLocalsItemDelegate#::setModelDatacxx . . $ QScriptDebuggerLocalsItemDelegate#setModelData(3e66fac4f8e72d1b).( |
| 285 | QWidgetcxx . . $ QWidget# *editor, QAbstractItemModelcxx . . $ QAbstractItemModel# *model, |
| 286 | const QModelIndexcxx . . $ QModelIndex# &index) const |
| 287 | { |
| 288 | if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 1) { |
| 289 | // check that the syntax is OK |
| 290 | QStringcxx . . $ QString# expression = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QLineEditcxx . . $ QLineEdit#*>(editor)->text(); |
| 291 | if (QScriptEnginecxx . . $ QScriptEngine#::checkSyntaxcxx . . $ QScriptEngine#checkSyntax(8d9372f5264bad7a).(expression).statecxx . . $ QScriptSyntaxCheckResult#state(6de130bf2cd181e2).() != QScriptSyntaxCheckResultcxx . . $ QScriptSyntaxCheckResult#::Validcxx . . $ QScriptSyntaxCheckResult#Valid.) |
| 292 | return; |
| 293 | } |
| 294 | QStyledItemDelegatecxx . . $ QStyledItemDelegate#::setModelDatacxx . . $ QStyledItemDelegate#setModelData(3e66fac4f8e72d1b).(editor, model, index); |
| 295 | } |
| 296 | |
| 297 | void QScriptDebuggerLocalsItemDelegatecxx . . $ QScriptDebuggerLocalsItemDelegate#::paintcxx . . $ QScriptDebuggerLocalsItemDelegate#paint(a0cfc6dde5a97d5a).(QPaintercxx . . $ QPainter# *painter, const QStyleOptionViewItemcxx . . $ QStyleOptionViewItem# &option, |
| 298 | const QModelIndexcxx . . $ QModelIndex# &index) const |
| 299 | { |
| 300 | QStyledItemDelegatecxx . . $ QStyledItemDelegate#::paintcxx . . $ QStyledItemDelegate#paint(a0cfc6dde5a97d5a).(painter, option, index); |
| 301 | #if 0 |
| 302 | QModelIndex parent = index.parent(); |
| 303 | if (parent.isValid()) { |
| 304 | QStyledItemDelegate::paint(painter, option, index); |
| 305 | } else { |
| 306 | // this is a top-level item. |
| 307 | const QTreeView *view = qobject_cast<const QTreeView*>(option.widget); |
| 308 | Q_ASSERT(view != 0); |
| 309 | |
| 310 | QStyleOptionButton buttonOption; |
| 311 | |
| 312 | buttonOption.state = option.state; |
| 313 | #ifdef Q_WS_MAC |
| 314 | buttonOption.state |= QStyle::State_Raised; |
| 315 | #endif |
| 316 | buttonOption.state &= ~QStyle::State_HasFocus; |
| 317 | |
| 318 | buttonOption.rect = option.rect; |
| 319 | buttonOption.palette = option.palette; |
| 320 | buttonOption.features = QStyleOptionButton::None; |
| 321 | view->style()->drawControl(QStyle::CE_PushButton, &buttonOption, painter, view); |
| 322 | |
| 323 | QStyleOption branchOption; |
| 324 | static const int i = 9; // ### hardcoded in qcommonstyle.cpp |
| 325 | QRect r = option.rect; |
| 326 | branchOption.rect = QRect(r.left() + i/2, r.top() + (r.height() - i)/2, i, i); |
| 327 | branchOption.palette = option.palette; |
| 328 | branchOption.state = QStyle::State_Children; |
| 329 | |
| 330 | if (view->isExpanded(index)) |
| 331 | branchOption.state |= QStyle::State_Open; |
| 332 | |
| 333 | view->style()->drawPrimitive(QStyle::PE_IndicatorBranch, &branchOption, painter, view); |
| 334 | |
| 335 | // draw text |
| 336 | QRect textrect = QRect(r.left() + i*2, r.top(), r.width() - ((5*i)/2), r.height()); |
| 337 | QString text = elidedText(option.fontMetrics, textrect.width(), Qt::ElideMiddle, |
| 338 | index.data(Qt::DisplayRole).toString()); |
| 339 | view->style()->drawItemText(painter, textrect, Qt::AlignCenter, |
| 340 | option.palette, view->isEnabled(), text); |
| 341 | } |
| 342 | #endif |
| 343 | } |
| 344 | |
| 345 | QScriptDebuggerLocalsWidgetcxx . . $ QScriptDebuggerLocalsWidget#::QScriptDebuggerLocalsWidgetcxx . . $ QScriptDebuggerLocalsWidget#QScriptDebuggerLocalsWidget(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent) |
| 346 | : QScriptDebuggerLocalsWidgetInterfacecxx . . $ QScriptDebuggerLocalsWidgetInterface#(*new QScriptDebuggerLocalsWidgetPrivatecxx . . $ QScriptDebuggerLocalsWidgetPrivate#QScriptDebuggerLocalsWidgetPrivate(49f6e7a06ebc5aa8)., parent, {}) |
| 347 | { |
| 348 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptDebuggerLocalsWidget); |
| 349 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view. = new QTreeViewcxx . . $ QTreeView#QTreeView(108f35f7aa7f3cf9).(); |
| 350 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->setItemDelegatecxx . . $ QAbstractItemView#setItemDelegate(fa3867fa1f6ca1e7).(new QScriptDebuggerLocalsItemDelegate(this)); |
| 351 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->setEditTriggerscxx . . $ QAbstractItemView#setEditTriggers(cbe1d262190fb0b).(QAbstractItemViewcxx . . $ QAbstractItemView#::DoubleClickedcxx . . $ QAbstractItemView#DoubleClicked.); |
| 352 | // d->view->setEditTriggers(QAbstractItemView::NoEditTriggers); |
| 353 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->setEditTriggerscxx . . $ QAbstractItemView#setEditTriggers(cbe1d262190fb0b).(QAbstractItemViewcxx . . $ QAbstractItemView#::DoubleClickedcxx . . $ QAbstractItemView#DoubleClicked. | QAbstractItemViewcxx . . $ QAbstractItemView#::SelectedClickedcxx . . $ QAbstractItemView#SelectedClicked.); |
| 354 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->setAlternatingRowColorscxx . . $ QAbstractItemView#setAlternatingRowColors(b45ddcbc8423892c).(true); |
| 355 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->setSelectionBehaviorcxx . . $ QAbstractItemView#setSelectionBehavior(3a606fd1f72e340).(QAbstractItemViewcxx . . $ QAbstractItemView#::SelectRowscxx . . $ QAbstractItemView#SelectRows.); |
| 356 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->setSortingEnabledcxx . . $ QTreeView#setSortingEnabled(b45ddcbc8423892c).(true); |
| 357 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->headercxx . . $ QTreeView#header(f0c0fe1a435d30ff).()->setDefaultAlignmentcxx . . $ QHeaderView#setDefaultAlignment(9d0000d583057bbf).(Qtcxx . . $ Qt/::AlignLeftcxx . . $ Qt/AlignLeft.); |
| 358 | // d->view->header()->setSortIndicatorShown(true); |
| 359 | // d->view->header()->setResizeMode(QHeaderView::ResizeToContents); |
| 360 | |
| 361 | QVBoxLayoutcxx . . $ QVBoxLayout# *vbox = new QVBoxLayout(this); |
| 362 | vbox->setContentsMarginscxx . . $ QLayout#setContentsMargins(748afa4755bc9595).(0, 0, 0, 0); |
| 363 | vbox->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.); |
| 364 | } |
| 365 | |
| 366 | QScriptDebuggerLocalsWidgetcxx . . $ QScriptDebuggerLocalsWidget#::~cxx . . $ QScriptDebuggerLocalsWidget#`~QScriptDebuggerLocalsWidget`(ced63f7c635d850d).QScriptDebuggerLocalsWidgetcxx . . $ QScriptDebuggerLocalsWidget#() |
| 367 | { |
| 368 | } |
| 369 | |
| 370 | /*! |
| 371 | \reimp |
| 372 | */ |
| 373 | QScriptDebuggerLocalsModelcxx . . $ QScriptDebuggerLocalsModel# *QScriptDebuggerLocalsWidgetcxx . . $ QScriptDebuggerLocalsWidget#::localsModelcxx . . $ QScriptDebuggerLocalsWidget#localsModel(e707ec8da26927e9).() const |
| 374 | { |
| 375 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptDebuggerLocalsWidget); |
| 376 | if (!d->proxycxx . . $ QScriptDebuggerLocalsWidgetPrivate#proxy.) |
| 377 | return 0; |
| 378 | return qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QScriptDebuggerLocalsModelcxx . . $ QScriptDebuggerLocalsModel#*>(d->proxycxx . . $ QScriptDebuggerLocalsWidgetPrivate#proxy.->sourceModelcxx . . $ QAbstractProxyModel#sourceModel(c9c1e11e7bd96493).()); |
| 379 | } |
| 380 | |
| 381 | /*! |
| 382 | \reimp |
| 383 | */ |
| 384 | void QScriptDebuggerLocalsWidgetcxx . . $ QScriptDebuggerLocalsWidget#::setLocalsModelcxx . . $ QScriptDebuggerLocalsWidget#setLocalsModel(17cea713735b9d3e).(QScriptDebuggerLocalsModelcxx . . $ QScriptDebuggerLocalsModel# *model) |
| 385 | { |
| 386 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptDebuggerLocalsWidget); |
| 387 | if (localsModelcxx . . $ QScriptDebuggerLocalsWidget#localsModel(e707ec8da26927e9).()) { |
| 388 | QObjectcxx . . $ QObject#::disconnectcxx . . $ QObject#disconnect(bb355c0e5cae20e4).(localsModelcxx . . $ QScriptDebuggerLocalsWidget#localsModel(e707ec8da26927e9).(), 0, d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view., 0); |
| 389 | } |
| 390 | if (model) { |
| 391 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(model, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(scopeObjectAvailable(QModelIndex)), |
| 392 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(_q_expandIndex(QModelIndex))); |
| 393 | } |
| 394 | if (!d->proxycxx . . $ QScriptDebuggerLocalsWidgetPrivate#proxy.) { |
| 395 | d->proxy = new CustomProxyModel(this); |
| 396 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->sortByColumncxx . . $ QTreeView#sortByColumn(11168df8d4e8286d).(0, Qtcxx . . $ Qt/::AscendingOrdercxx . . $ Qt/AscendingOrder.); |
| 397 | } |
| 398 | d->proxycxx . . $ QScriptDebuggerLocalsWidgetPrivate#proxy.->setSourceModelcxx . . $ QSortFilterProxyModel#setSourceModel(c6e1f1e42522b780).(model); |
| 399 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->setModelcxx . . $ QTreeView#setModel(c6e1f1e42522b780).(d->proxycxx . . $ QScriptDebuggerLocalsWidgetPrivate#proxy.); |
| 400 | } |
| 401 | |
| 402 | /*! |
| 403 | \reimp |
| 404 | */ |
| 405 | void QScriptDebuggerLocalsWidgetcxx . . $ QScriptDebuggerLocalsWidget#::expandcxx . . $ QScriptDebuggerLocalsWidget#expand(87a6de385263c395).(const QModelIndexcxx . . $ QModelIndex# &index) |
| 406 | { |
| 407 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptDebuggerLocalsWidget); |
| 408 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->expandcxx . . $ QTreeView#expand(87a6de385263c395).(index); |
| 409 | d->viewcxx . . $ QScriptDebuggerLocalsWidgetPrivate#view.->setFirstColumnSpannedcxx . . $ QTreeView#setFirstColumnSpanned(f9586e4a248ef41c).(index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).(), QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(), true); |
| 410 | } |
| 411 | |
| 412 | QT_END_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:149:10`! |
| 413 | |
| 414 | #include "qscriptdebuggerlocalswidget.moc"cxx . . $ `<file>/src/scripttools/.moc/qscriptdebuggerlocalswidget.moc`/ |
| 415 | |
| 416 | #include "moc_qscriptdebuggerlocalswidget_p.cpp"cxx . . $ `<file>/src/scripttools/.moc/moc_qscriptdebuggerlocalswidget_p.cpp`/ |