| 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 "qscriptbreakpointswidget_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptbreakpointswidget_p.h`/ |
| 41 | #include "qscriptbreakpointswidgetinterface_p_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptbreakpointswidgetinterface_p_p.h`/ |
| 42 | #include "qscriptbreakpointsmodel_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptbreakpointsmodel_p.h`/ |
| 43 | #include "qscriptdebuggerscriptsmodel_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggerscriptsmodel_p.h`/ |
| 44 | |
| 45 | #include <QtCore/qdebug.h> |
| 46 | #include <QtWidgets/qaction.h> |
| 47 | #include <QtWidgets/qcompleter.h> |
| 48 | #include <QtWidgets/qheaderview.h> |
| 49 | #include <QtWidgets/qlineedit.h> |
| 50 | #include <QtWidgets/qmessagebox.h> |
| 51 | #include <QtWidgets/qtoolbar.h> |
| 52 | #include <QtWidgets/qtoolbutton.h> |
| 53 | #include <QtWidgets/qtreeview.h> |
| 54 | #include <QtWidgets/qboxlayout.h> |
| 55 | #include <QtWidgets/qstyleditemdelegate.h> |
| 56 | #include <QtGui/qevent.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 | class QScriptNewBreakpointWidgetcxx . . $ QScriptNewBreakpointWidget# : public QWidgetcxx . . $ QWidget# |
| 62 | { |
| 63 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 64 | public: |
| 65 | QScriptNewBreakpointWidgetcxx . . $ QScriptNewBreakpointWidget#QScriptNewBreakpointWidget(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent = 0) |
| 66 | : QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(parent) { |
| 67 | QStringcxx . . $ QString# system = QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).("win"); |
| 68 | QHBoxLayoutcxx . . $ QHBoxLayout# *hboxLayout = new QHBoxLayout(this); |
| 69 | #ifdef Q_OS_MAC |
| 70 | system = QLatin1String("mac"); |
| 71 | #else |
| 72 | hboxLayout->setSpacingcxx . . $ QBoxLayout#setSpacing(d4f767463ce0a6b3).(6); |
| 73 | hboxLayout->setContentsMarginscxx . . $ QLayout#setContentsMargins(79c4c8645766fc71).(0, 0, 0, 0); |
| 74 | #endif |
| 75 | |
| 76 | toolClose = new QToolButton(this); |
| 77 | toolClosecxx . . $ QScriptNewBreakpointWidget#toolClose.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(QStringcxx . . $ QString#::fromUtf8cxx . . $ QString#fromUtf8(5ac70cc0fa2a874e).(":/qt/scripttools/debugging/images/%1/closetab.png").argcxx . . $ QString#arg(bc823072288cbbb5).(system))); |
| 78 | toolClosecxx . . $ QScriptNewBreakpointWidget#toolClose.->setAutoRaisecxx . . $ QToolButton#setAutoRaise(b45ddcbc8423892c).(true); |
| 79 | toolClosecxx . . $ QScriptNewBreakpointWidget#toolClose.->setTextcxx . . $ QAbstractButton#setText(3520e46b33348bf6).(trcxx . . $ QScriptNewBreakpointWidget#tr(75d9f1c324b4579d).("Close")); |
| 80 | hboxLayout->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(toolClosecxx . . $ QScriptNewBreakpointWidget#toolClose.); |
| 81 | |
| 82 | fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit. = new QLineEditcxx . . $ QLineEdit#QLineEdit(108f35f7aa7f3cf9).(); |
| 83 | setFocusProxycxx . . $ QWidget#setFocusProxy(108f35f7aa7f3cf9).(fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit.); |
| 84 | QRegExpcxx . . $ QRegExp# locationRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).(QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).(".+:[0-9]+")); |
| 85 | QRegExpValidatorcxx . . $ QRegExpValidator# *validator = new QRegExpValidator(locationRegExp, fileNameEdit); |
| 86 | fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit.->setValidatorcxx . . $ QLineEdit#setValidator(65a0e52d19f97f21).(validator); |
| 87 | hboxLayout->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit.); |
| 88 | |
| 89 | toolOk = new QToolButton(this); |
| 90 | toolOkcxx . . $ QScriptNewBreakpointWidget#toolOk.->setIconcxx . . $ QAbstractButton#setIcon(71dcdac178620ed6).(QIconcxx . . $ QIcon#QIcon(3520e46b33348bf6).(QStringcxx . . $ QString#::fromUtf8cxx . . $ QString#fromUtf8(5ac70cc0fa2a874e).(":/qt/scripttools/debugging/images/%1/plus.png").argcxx . . $ QString#arg(bc823072288cbbb5).(system))); |
| 91 | toolOkcxx . . $ QScriptNewBreakpointWidget#toolOk.->setAutoRaisecxx . . $ QToolButton#setAutoRaise(b45ddcbc8423892c).(true); |
| 92 | toolOkcxx . . $ QScriptNewBreakpointWidget#toolOk.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(false); |
| 93 | hboxLayout->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(toolOkcxx . . $ QScriptNewBreakpointWidget#toolOk.); |
| 94 | |
| 95 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(toolClosecxx . . $ QScriptNewBreakpointWidget#toolClose., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(hide())); |
| 96 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(toolOkcxx . . $ QScriptNewBreakpointWidget#toolOk., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clicked()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onOkClicked())); |
| 97 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(textChanged(QString)), |
| 98 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onTextChanged())); |
| 99 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(returnPressed()), |
| 100 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onOkClicked())); |
| 101 | } |
| 102 | |
| 103 | void setCompletercxx . . $ QScriptNewBreakpointWidget#setCompleter(638321c80ff6aea).(QCompletercxx . . $ QCompleter# *comp) |
| 104 | { fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit.->setCompletercxx . . $ QLineEdit#setCompleter(638321c80ff6aea).(comp); } |
| 105 | |
| 106 | Q_SIGNALScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:93:10`!: |
| 107 | void newBreakpointRequestcxx . . $ QScriptNewBreakpointWidget#newBreakpointRequest(29ed8fcd127906b1).(const QStringcxx . . $ QString# &fileName, int lineNumber); |
| 108 | |
| 109 | protected: |
| 110 | void keyPressEventcxx . . $ QScriptNewBreakpointWidget#keyPressEvent(c92999c1b6b09cc0).(QKeyEventcxx . . $ QKeyEvent# *e) |
| 111 | { |
| 112 | if (e->keycxx . . $ QKeyEvent#key(455f465bc33b4cdf).() == Qtcxx . . $ Qt/::Key_Escapecxx . . $ Qt/Key_Escape.) |
| 113 | hidecxx . . $ QWidget#hide(49f6e7a06ebc5aa8).(); |
| 114 | else |
| 115 | QWidgetcxx . . $ QWidget#::keyPressEventcxx . . $ QWidget#keyPressEvent(c92999c1b6b09cc0).(e); |
| 116 | } |
| 117 | |
| 118 | private Q_SLOTScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:92:10`!: |
| 119 | void onOkClickedcxx . . $ QScriptNewBreakpointWidget#onOkClicked(49f6e7a06ebc5aa8).() |
| 120 | { |
| 121 | QStringcxx . . $ QString# location = fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit.->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).(); |
| 122 | fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit.->clearcxx . . $ QLineEdit#clear(49f6e7a06ebc5aa8).(); |
| 123 | QStringcxx . . $ QString# fileName = location.leftcxx . . $ QString#left(3f3c3d0e9c0eb37f).(location.lastIndexOfcxx . . $ QString#lastIndexOf(75b556ba78e4903c).(QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).(':'))); |
| 124 | int lineNumber = location.midcxx . . $ QString#mid(44b7563da18aea72).(fileName.lengthcxx . . $ QString#length(455f465bc33b4cdf).()+1).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 125 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! newBreakpointRequestcxx . . $ QScriptNewBreakpointWidget#newBreakpointRequest(29ed8fcd127906b1).(fileName, lineNumber); |
| 126 | } |
| 127 | |
| 128 | void onTextChangedcxx . . $ QScriptNewBreakpointWidget#onTextChanged(49f6e7a06ebc5aa8).() |
| 129 | { |
| 130 | toolOkcxx . . $ QScriptNewBreakpointWidget#toolOk.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit.->hasAcceptableInputcxx . . $ QLineEdit#hasAcceptableInput(50ce9a9e25b4a850).()); |
| 131 | } |
| 132 | |
| 133 | private: |
| 134 | QLineEditcxx . . $ QLineEdit# *fileNameEditcxx . . $ QScriptNewBreakpointWidget#fileNameEdit.; |
| 135 | QToolButtoncxx . . $ QToolButton# *toolClosecxx . . $ QScriptNewBreakpointWidget#toolClose.; |
| 136 | QToolButtoncxx . . $ QToolButton# *toolOkcxx . . $ QScriptNewBreakpointWidget#toolOk.; |
| 137 | }; |
| 138 | |
| 139 | |
| 140 | |
| 141 | class QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate# |
| 142 | : public QScriptBreakpointsWidgetInterfacePrivatecxx . . $ QScriptBreakpointsWidgetInterfacePrivate# |
| 143 | { |
| 144 | Q_DECLARE_PUBLICcxx . . $ `<external>/15045578679651060896/qglobal.h:1172:9`!(QScriptBreakpointsWidget) |
| 145 | public: |
| 146 | QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#QScriptBreakpointsWidgetPrivate(49f6e7a06ebc5aa8).(); |
| 147 | ~cxx . . $ QScriptBreakpointsWidgetPrivate#`~QScriptBreakpointsWidgetPrivate`(ced63f7c635d850d).QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#(); |
| 148 | |
| 149 | void _q_newBreakpointcxx . . $ QScriptBreakpointsWidgetPrivate#_q_newBreakpoint(49f6e7a06ebc5aa8).(); |
| 150 | void _q_deleteBreakpointcxx . . $ QScriptBreakpointsWidgetPrivate#_q_deleteBreakpoint(49f6e7a06ebc5aa8).(); |
| 151 | void _q_onCurrentChangedcxx . . $ QScriptBreakpointsWidgetPrivate#_q_onCurrentChanged(87a6de385263c395).(const QModelIndexcxx . . $ QModelIndex# &index); |
| 152 | void _q_onNewBreakpointRequestcxx . . $ QScriptBreakpointsWidgetPrivate#_q_onNewBreakpointRequest(29ed8fcd127906b1).(const QStringcxx . . $ QString# &fileName, int lineNumber); |
| 153 | |
| 154 | static QPixmapcxx . . $ QPixmap# pixmapcxx . . $ QScriptBreakpointsWidgetPrivate#pixmap(13bf8f5656ba7097).(const QStringcxx . . $ QString# &path) |
| 155 | { |
| 156 | static QStringcxx . . $ QString# prefix = QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).(":/qt/scripttools/debugging/images/"); |
| 157 | return QPixmapcxx . . $ QPixmap#(prefix + path); |
| 158 | } |
| 159 | |
| 160 | QTreeViewcxx . . $ QTreeView# *viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.; |
| 161 | QScriptNewBreakpointWidgetcxx . . $ QScriptNewBreakpointWidget# *newBreakpointWidgetcxx . . $ QScriptBreakpointsWidgetPrivate#newBreakpointWidget.; |
| 162 | QActioncxx . . $ QAction# *deleteBreakpointActioncxx . . $ QScriptBreakpointsWidgetPrivate#deleteBreakpointAction.; |
| 163 | QScriptDebuggerScriptsModelcxx . . $ QScriptDebuggerScriptsModel# *scriptsModelcxx . . $ QScriptBreakpointsWidgetPrivate#scriptsModel.; |
| 164 | }; |
| 165 | |
| 166 | QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#::QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#QScriptBreakpointsWidgetPrivate(49f6e7a06ebc5aa8).() |
| 167 | { |
| 168 | } |
| 169 | |
| 170 | QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#::~cxx . . $ QScriptBreakpointsWidgetPrivate#`~QScriptBreakpointsWidgetPrivate`(ced63f7c635d850d).QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#() |
| 171 | { |
| 172 | } |
| 173 | |
| 174 | void QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#::_q_newBreakpointcxx . . $ QScriptBreakpointsWidgetPrivate#_q_newBreakpoint(49f6e7a06ebc5aa8).() |
| 175 | { |
| 176 | newBreakpointWidgetcxx . . $ QScriptBreakpointsWidgetPrivate#newBreakpointWidget.->showcxx . . $ QWidget#show(49f6e7a06ebc5aa8).(); |
| 177 | newBreakpointWidgetcxx . . $ QScriptBreakpointsWidgetPrivate#newBreakpointWidget.->setFocuscxx . . $ QWidget#setFocus(49f6e7a06ebc5aa8).(Qtcxx . . $ Qt/::OtherFocusReasoncxx . . $ Qt/OtherFocusReason.); |
| 178 | } |
| 179 | |
| 180 | void QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#::_q_deleteBreakpointcxx . . $ QScriptBreakpointsWidgetPrivate#_q_deleteBreakpoint(49f6e7a06ebc5aa8).() |
| 181 | { |
| 182 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(QScriptBreakpointsWidget); |
| 183 | QModelIndexcxx . . $ QModelIndex# index = viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.->currentIndexcxx . . $ QAbstractItemView#currentIndex(a394cbc57608ce34).(); |
| 184 | if (index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) { |
| 185 | int id = q->breakpointsModelcxx . . $ QScriptBreakpointsWidget#breakpointsModel(78174c69c7c3555c).()->breakpointIdAtcxx . . $ QScriptBreakpointsModel#breakpointIdAt(7ccb52b1bfe01045).(index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()); |
| 186 | q->breakpointsModelcxx . . $ QScriptBreakpointsWidget#breakpointsModel(78174c69c7c3555c).()->deleteBreakpointcxx . . $ QScriptBreakpointsModel#deleteBreakpoint(d4f767463ce0a6b3).(id); |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | void QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#::_q_onCurrentChangedcxx . . $ QScriptBreakpointsWidgetPrivate#_q_onCurrentChanged(87a6de385263c395).(const QModelIndexcxx . . $ QModelIndex# &index) |
| 191 | { |
| 192 | deleteBreakpointActioncxx . . $ QScriptBreakpointsWidgetPrivate#deleteBreakpointAction.->setEnabledcxx . . $ QAction#setEnabled(b45ddcbc8423892c).(index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()); |
| 193 | } |
| 194 | |
| 195 | void QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#::_q_onNewBreakpointRequestcxx . . $ QScriptBreakpointsWidgetPrivate#_q_onNewBreakpointRequest(29ed8fcd127906b1).(const QStringcxx . . $ QString# &fileName, int lineNumber) |
| 196 | { |
| 197 | QScriptBreakpointDatacxx . . $ QScriptBreakpointData# datacxx . . $ QScriptBreakpointData#QScriptBreakpointData(29ed8fcd127906b1).(fileName, lineNumber); |
| 198 | q_funccxx . . $ QScriptBreakpointsWidgetPrivate#q_func(3f4717fa924a56e6).()->breakpointsModelcxx . . $ QScriptBreakpointsWidget#breakpointsModel(78174c69c7c3555c).()->setBreakpointcxx . . $ QScriptBreakpointsModel#setBreakpoint(694486080f38713d).(data); |
| 199 | } |
| 200 | |
| 201 | class QScriptBreakpointsItemDelegatecxx . . $ QScriptBreakpointsItemDelegate# : public QStyledItemDelegatecxx . . $ QStyledItemDelegate# |
| 202 | { |
| 203 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 204 | public: |
| 205 | QScriptBreakpointsItemDelegatecxx . . $ QScriptBreakpointsItemDelegate#QScriptBreakpointsItemDelegate(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent = 0) |
| 206 | : QStyledItemDelegatecxx . . $ QStyledItemDelegate#(parent) {} |
| 207 | |
| 208 | QWidgetcxx . . $ QWidget# *createEditorcxx . . $ QScriptBreakpointsItemDelegate#createEditor(f2c7e294f1841167).(QWidgetcxx . . $ QWidget# *parent, |
| 209 | const QStyleOptionViewItemcxx . . $ QStyleOptionViewItem# &option, |
| 210 | const QModelIndexcxx . . $ QModelIndex# &index) const |
| 211 | { |
| 212 | QWidgetcxx . . $ QWidget# *editor = QStyledItemDelegatecxx . . $ QStyledItemDelegate#::createEditorcxx . . $ QStyledItemDelegate#createEditor(f2c7e294f1841167).(parent, option, index); |
| 213 | if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 2) { |
| 214 | // condition |
| 215 | QLineEditcxx . . $ QLineEdit# *le = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QLineEditcxx . . $ QLineEdit#*>(editor); |
| 216 | if (le) { |
| 217 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(le, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(textEdited(QString)), |
| 218 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(validateInput(QString))); |
| 219 | } |
| 220 | } |
| 221 | return editor; |
| 222 | } |
| 223 | |
| 224 | bool eventFiltercxx . . $ QScriptBreakpointsItemDelegate#eventFilter(978aa4af1d030efa).(QObjectcxx . . $ QObject# *editor, QEventcxx . . $ QEvent# *event) |
| 225 | { |
| 226 | if (QLineEditcxx . . $ QLineEdit# *le = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QLineEditcxx . . $ QLineEdit#*>(editor)) { |
| 227 | if (event->typecxx . . $ QEvent#type(916a8de57f4d422b).() == QEventcxx . . $ QEvent#::KeyPresscxx . . $ QEvent#KeyPress.) { |
| 228 | int key = static_cast<QKeyEvent*>(event)->key(); |
| 229 | if ((key == Qtcxx . . $ Qt/::Key_Entercxx . . $ Qt/Key_Enter.) || (key == Qtcxx . . $ Qt/::Key_Returncxx . . $ Qt/Key_Return.)) { |
| 230 | if (QScriptEnginecxx . . $ QScriptEngine#::checkSyntaxcxx . . $ QScriptEngine#checkSyntax(8d9372f5264bad7a).(le->textcxx . . $ QLineEdit#text(6ef7b6c27b00b43d).()).statecxx . . $ QScriptSyntaxCheckResult#state(6de130bf2cd181e2).() != QScriptSyntaxCheckResultcxx . . $ QScriptSyntaxCheckResult#::Validcxx . . $ QScriptSyntaxCheckResult#Valid.) { |
| 231 | // ignore when script contains syntax error |
| 232 | return true; |
| 233 | } |
| 234 | } |
| 235 | } |
| 236 | } |
| 237 | return QStyledItemDelegatecxx . . $ QStyledItemDelegate#::eventFiltercxx . . $ QStyledItemDelegate#eventFilter(978aa4af1d030efa).(editor, event); |
| 238 | } |
| 239 | |
| 240 | void setModelDatacxx . . $ QScriptBreakpointsItemDelegate#setModelData(3e66fac4f8e72d1b).(QWidgetcxx . . $ QWidget# *editor, QAbstractItemModelcxx . . $ QAbstractItemModel# *model, |
| 241 | const QModelIndexcxx . . $ QModelIndex# &index) const |
| 242 | { |
| 243 | if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 2) { |
| 244 | // check that the syntax is OK |
| 245 | QStringcxx . . $ QString# condition = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QLineEditcxx . . $ QLineEdit#*>(editor)->text(); |
| 246 | if (QScriptEnginecxx . . $ QScriptEngine#::checkSyntaxcxx . . $ QScriptEngine#checkSyntax(8d9372f5264bad7a).(condition).statecxx . . $ QScriptSyntaxCheckResult#state(6de130bf2cd181e2).() != QScriptSyntaxCheckResultcxx . . $ QScriptSyntaxCheckResult#::Validcxx . . $ QScriptSyntaxCheckResult#Valid.) |
| 247 | return; |
| 248 | } |
| 249 | QStyledItemDelegatecxx . . $ QStyledItemDelegate#::setModelDatacxx . . $ QStyledItemDelegate#setModelData(3e66fac4f8e72d1b).(editor, model, index); |
| 250 | } |
| 251 | |
| 252 | private Q_SLOTScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:92:10`!: |
| 253 | void validateInputcxx . . $ QScriptBreakpointsItemDelegate#validateInput(3520e46b33348bf6).(const QStringcxx . . $ QString# &text) |
| 254 | { |
| 255 | QWidgetcxx . . $ QWidget# *editor = qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QWidgetcxx . . $ QWidget#*>(sendercxx . . $ QObject#sender(2dbb680a34285c44).()); |
| 256 | QPalettecxx . . $ QPalette# pal = editorcxx . . $ QPalette#QPalette(f826ed73d5553cd5).->palettecxx . . $ QWidget#palette(a7bd6a16d2c88209).(); |
| 257 | QColorcxx . . $ QColor# colcxx . . $ QColor#QColor(ced63f7c635d850d).; |
| 258 | bool ok = (QScriptEnginecxx . . $ QScriptEngine#::checkSyntaxcxx . . $ QScriptEngine#checkSyntax(8d9372f5264bad7a).(text).statecxx . . $ QScriptSyntaxCheckResult#state(6de130bf2cd181e2).() == QScriptSyntaxCheckResultcxx . . $ QScriptSyntaxCheckResult#::Validcxx . . $ QScriptSyntaxCheckResult#Valid.); |
| 259 | if (ok) { |
| 260 | col =cxx . . $ QColor#`operator=`(7dc25a5504d99c29). Qtcxx . . $ Qt/::whitecxx . . $ Qt/white.; |
| 261 | } else { |
| 262 | QScriptSyntaxCheckResultcxx . . $ QScriptSyntaxCheckResult# result = QScriptEnginecxx . . $ QScriptEngine#::checkSyntaxcxx . . $ QScriptEngine#checkSyntax(8d9372f5264bad7a).( |
| 263 | text + QLatin1Charcxx . . $ QLatin1Char#('\n')); |
| 264 | if (result.statecxx . . $ QScriptSyntaxCheckResult#state(6de130bf2cd181e2).() == QScriptSyntaxCheckResultcxx . . $ QScriptSyntaxCheckResult#::Intermediatecxx . . $ QScriptSyntaxCheckResult#Intermediate.) |
| 265 | col =cxx . . $ QColor#`operator=`(fd1b853fb77c9003). QColorcxx . . $ QColor#QColor(2261ffe5112eab06).(255, 240, 192); |
| 266 | else |
| 267 | col =cxx . . $ QColor#`operator=`(fd1b853fb77c9003). QColorcxx . . $ QColor#QColor(2261ffe5112eab06).(255, 102, 102); |
| 268 | } |
| 269 | pal.setColorcxx . . $ QPalette#setColor(5c3218fcc49a2895).(QPalettecxx . . $ QPalette#::Activecxx . . $ QPalette#Active., QPalettecxx . . $ QPalette#::Basecxx . . $ QPalette#Base., col); |
| 270 | editor->setPalettecxx . . $ QWidget#setPalette(f826ed73d5553cd5).(pal); |
| 271 | } |
| 272 | }; |
| 273 | |
| 274 | QScriptBreakpointsWidgetcxx . . $ QScriptBreakpointsWidget#::QScriptBreakpointsWidgetcxx . . $ QScriptBreakpointsWidget#QScriptBreakpointsWidget(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent) |
| 275 | : QScriptBreakpointsWidgetInterfacecxx . . $ QScriptBreakpointsWidgetInterface#(*new QScriptBreakpointsWidgetPrivatecxx . . $ QScriptBreakpointsWidgetPrivate#QScriptBreakpointsWidgetPrivate(49f6e7a06ebc5aa8)., parent, {}) |
| 276 | { |
| 277 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsWidget); |
| 278 | d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view. = new QTreeViewcxx . . $ QTreeView#QTreeView(108f35f7aa7f3cf9).(); |
| 279 | // d->view->setEditTriggers(QAbstractItemView::NoEditTriggers); |
| 280 | d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.->setEditTriggerscxx . . $ QAbstractItemView#setEditTriggers(cbe1d262190fb0b).(QAbstractItemViewcxx . . $ QAbstractItemView#::AllEditTriggerscxx . . $ QAbstractItemView#AllEditTriggers.); |
| 281 | // d->view->setAlternatingRowColors(true); |
| 282 | d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.->setRootIsDecoratedcxx . . $ QTreeView#setRootIsDecorated(b45ddcbc8423892c).(false); |
| 283 | d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.->setSelectionBehaviorcxx . . $ QAbstractItemView#setSelectionBehavior(3a606fd1f72e340).(QAbstractItemViewcxx . . $ QAbstractItemView#::SelectRowscxx . . $ QAbstractItemView#SelectRows.); |
| 284 | // d->view->header()->hide(); |
| 285 | // d->view->header()->setDefaultAlignment(Qt::AlignLeft); |
| 286 | // d->view->header()->setResizeMode(QHeaderView::ResizeToContents); |
| 287 | d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.->setItemDelegatecxx . . $ QAbstractItemView#setItemDelegate(fa3867fa1f6ca1e7).(new QScriptBreakpointsItemDelegate(this)); |
| 288 | |
| 289 | d->newBreakpointWidgetcxx . . $ QScriptBreakpointsWidgetPrivate#newBreakpointWidget. = new QScriptNewBreakpointWidgetcxx . . $ QScriptNewBreakpointWidget#(); |
| 290 | d->newBreakpointWidgetcxx . . $ QScriptBreakpointsWidgetPrivate#newBreakpointWidget.->hidecxx . . $ QWidget#hide(49f6e7a06ebc5aa8).(); |
| 291 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(d->newBreakpointWidgetcxx . . $ QScriptBreakpointsWidgetPrivate#newBreakpointWidget., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(newBreakpointRequest(QString,int)), |
| 292 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(_q_onNewBreakpointRequest(QString,int))); |
| 293 | |
| 294 | QIconcxx . . $ QIcon# newBreakpointIconcxx . . $ QIcon#QIcon(ced63f7c635d850d).; |
| 295 | newBreakpointIcon.addPixmapcxx . . $ QIcon#addPixmap(148c119025559ed9).(d->pixmapcxx . . $ QScriptBreakpointsWidgetPrivate#pixmap(13bf8f5656ba7097).(QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).("new.png")), QIconcxx . . $ QIcon#::Normalcxx . . $ QIcon#Normal.); |
| 296 | QActioncxx . . $ QAction# *newBreakpointAction = new QAction(newBreakpointIcon, tr("New"), this); |
| 297 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(newBreakpointAction, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), |
| 298 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(_q_newBreakpoint())); |
| 299 | |
| 300 | QIconcxx . . $ QIcon# deleteBreakpointIconcxx . . $ QIcon#QIcon(ced63f7c635d850d).; |
| 301 | deleteBreakpointIcon.addPixmapcxx . . $ QIcon#addPixmap(148c119025559ed9).(d->pixmapcxx . . $ QScriptBreakpointsWidgetPrivate#pixmap(13bf8f5656ba7097).(QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).("delete.png")), QIconcxx . . $ QIcon#::Normalcxx . . $ QIcon#Normal.); |
| 302 | d->deleteBreakpointAction = new QAction(deleteBreakpointIcon, tr("Delete"), this); |
| 303 | d->deleteBreakpointActioncxx . . $ QScriptBreakpointsWidgetPrivate#deleteBreakpointAction.->setEnabledcxx . . $ QAction#setEnabled(b45ddcbc8423892c).(false); |
| 304 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(d->deleteBreakpointActioncxx . . $ QScriptBreakpointsWidgetPrivate#deleteBreakpointAction., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(triggered()), |
| 305 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(_q_deleteBreakpoint())); |
| 306 | |
| 307 | #ifndef QT_NO_TOOLBAR |
| 308 | QToolBarcxx . . $ QToolBar# *toolBar = new QToolBarcxx . . $ QToolBar#(); |
| 309 | toolBar->addActioncxx . . $ QToolBar#addAction(92b1e80c0a7f1406).(newBreakpointAction); |
| 310 | toolBar->addActioncxx . . $ QToolBar#addAction(92b1e80c0a7f1406).(d->deleteBreakpointActioncxx . . $ QScriptBreakpointsWidgetPrivate#deleteBreakpointAction.); |
| 311 | #endif |
| 312 | |
| 313 | QVBoxLayoutcxx . . $ QVBoxLayout# *vbox = new QVBoxLayout(this); |
| 314 | vbox->setContentsMarginscxx . . $ QLayout#setContentsMargins(79c4c8645766fc71).(0, 0, 0, 0); |
| 315 | #ifndef QT_NO_TOOLBAR |
| 316 | vbox->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(toolBar); |
| 317 | #endif |
| 318 | vbox->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(d->newBreakpointWidgetcxx . . $ QScriptBreakpointsWidgetPrivate#newBreakpointWidget.); |
| 319 | vbox->addWidgetcxx . . $ QBoxLayout#addWidget(d39963fa34d6acb).(d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.); |
| 320 | } |
| 321 | |
| 322 | QScriptBreakpointsWidgetcxx . . $ QScriptBreakpointsWidget#::~cxx . . $ QScriptBreakpointsWidget#`~QScriptBreakpointsWidget`(ced63f7c635d850d).QScriptBreakpointsWidgetcxx . . $ QScriptBreakpointsWidget#() |
| 323 | { |
| 324 | } |
| 325 | |
| 326 | /*! |
| 327 | \reimp |
| 328 | */ |
| 329 | QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel# *QScriptBreakpointsWidgetcxx . . $ QScriptBreakpointsWidget#::breakpointsModelcxx . . $ QScriptBreakpointsWidget#breakpointsModel(78174c69c7c3555c).() const |
| 330 | { |
| 331 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptBreakpointsWidget); |
| 332 | return qobject_castcxx . . $ qobject_cast(529b296f76edd7b).<QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#*>(d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.->modelcxx . . $ QAbstractItemView#model(c9c1e11e7bd96493).()); |
| 333 | } |
| 334 | |
| 335 | /*! |
| 336 | \reimp |
| 337 | */ |
| 338 | void QScriptBreakpointsWidgetcxx . . $ QScriptBreakpointsWidget#::setBreakpointsModelcxx . . $ QScriptBreakpointsWidget#setBreakpointsModel(33dec847fe365311).(QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel# *model) |
| 339 | { |
| 340 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsWidget); |
| 341 | d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.->setModelcxx . . $ QTreeView#setModel(c6e1f1e42522b780).(model); |
| 342 | d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.->headercxx . . $ QTreeView#header(f0c0fe1a435d30ff).()->resizeSectioncxx . . $ QHeaderView#resizeSection(3e454b8ccf442868).(0, 50); |
| 343 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(835f87066c895669).(d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.->selectionModelcxx . . $ QAbstractItemView#selectionModel(cc7a226abaf79c2f).(), SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(currentChanged(QModelIndex,QModelIndex)), |
| 344 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(_q_onCurrentChanged(QModelIndex))); |
| 345 | } |
| 346 | |
| 347 | /*! |
| 348 | \reimp |
| 349 | */ |
| 350 | QScriptDebuggerScriptsModelcxx . . $ QScriptDebuggerScriptsModel# *QScriptBreakpointsWidgetcxx . . $ QScriptBreakpointsWidget#::scriptsModelcxx . . $ QScriptBreakpointsWidget#scriptsModel(ac7ba6bd96f21e31).() const |
| 351 | { |
| 352 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptBreakpointsWidget); |
| 353 | return d->scriptsModelcxx . . $ QScriptBreakpointsWidgetPrivate#scriptsModel.; |
| 354 | } |
| 355 | |
| 356 | /*! |
| 357 | \reimp |
| 358 | */ |
| 359 | void QScriptBreakpointsWidgetcxx . . $ QScriptBreakpointsWidget#::setScriptsModelcxx . . $ QScriptBreakpointsWidget#setScriptsModel(32ce85fcbcfe135c).(QScriptDebuggerScriptsModelcxx . . $ QScriptDebuggerScriptsModel# *model) |
| 360 | { |
| 361 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsWidget); |
| 362 | d->scriptsModelcxx . . $ QScriptBreakpointsWidgetPrivate#scriptsModel. = model; |
| 363 | QCompletercxx . . $ QCompleter# *completer = new QCompleter(model, this); |
| 364 | completer->setCompletionRolecxx . . $ QCompleter#setCompletionRole(d4f767463ce0a6b3).(Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.); |
| 365 | d->newBreakpointWidgetcxx . . $ QScriptBreakpointsWidgetPrivate#newBreakpointWidget.->setCompletercxx . . $ QScriptNewBreakpointWidget#setCompleter(638321c80ff6aea).(completer); |
| 366 | } |
| 367 | |
| 368 | /*! |
| 369 | \reimp |
| 370 | */ |
| 371 | void QScriptBreakpointsWidgetcxx . . $ QScriptBreakpointsWidget#::keyPressEventcxx . . $ QScriptBreakpointsWidget#keyPressEvent(c92999c1b6b09cc0).(QKeyEventcxx . . $ QKeyEvent# *e) |
| 372 | { |
| 373 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsWidget); |
| 374 | if (e->keycxx . . $ QKeyEvent#key(455f465bc33b4cdf).() == Qtcxx . . $ Qt/::Key_Deletecxx . . $ Qt/Key_Delete.) { |
| 375 | QModelIndexcxx . . $ QModelIndex# index = d->viewcxx . . $ QScriptBreakpointsWidgetPrivate#view.->currentIndexcxx . . $ QAbstractItemView#currentIndex(a394cbc57608ce34).(); |
| 376 | if (!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).()) |
| 377 | return; |
| 378 | int id = breakpointsModelcxx . . $ QScriptBreakpointsWidget#breakpointsModel(78174c69c7c3555c).()->breakpointIdAtcxx . . $ QScriptBreakpointsModel#breakpointIdAt(7ccb52b1bfe01045).(index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).()); |
| 379 | breakpointsModelcxx . . $ QScriptBreakpointsWidget#breakpointsModel(78174c69c7c3555c).()->deleteBreakpointcxx . . $ QScriptBreakpointsModel#deleteBreakpoint(d4f767463ce0a6b3).(id); |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | QT_END_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:149:10`! |
| 384 | |
| 385 | #include "qscriptbreakpointswidget.moc"cxx . . $ `<file>/src/scripttools/.moc/qscriptbreakpointswidget.moc`/ |
| 386 | |
| 387 | #include "moc_qscriptbreakpointswidget_p.cpp"cxx . . $ `<file>/src/scripttools/.moc/moc_qscriptbreakpointswidget_p.cpp`/ |