Debian Codegraph @

src/scripttools/debugging/qscriptbreakpointsmodel.cpp

raw symbols SCIP
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 "qscriptbreakpointsmodel_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptbreakpointsmodel_p.h`/
41 #include "qscriptdebuggerjobschedulerinterface_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggerjobschedulerinterface_p.h`/
42 #include "qscriptdebuggercommandschedulerjob_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggercommandschedulerjob_p.h`/
43 #include "qscriptdebuggercommandschedulerfrontend_p.h"cxx . . $ `<file>/src/scripttools/debugging/qscriptdebuggercommandschedulerfrontend_p.h`/
44
45 #include "private/qabstractitemmodel_p.h"
46
47 #include <QtCore/qpair.h>
48 #include <QtCore/qcoreapplication.h>
49 #include <QtGui/qicon.h>
50 #include <QtCore/qdebug.h>
51
52 QT_BEGIN_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:148:10`!
53
54 /*!
55 \since 4.5
56 \class QScriptBreakpointsModel
57 \internal
58 */
59
60 class QScriptBreakpointsModelPrivatecxx . . $ QScriptBreakpointsModelPrivate#
61 : public QAbstractItemModelPrivatecxx . . $ QAbstractItemModelPrivate#
62 {
63 Q_DECLARE_PUBLICcxx . . $ `<external>/15045578679651060896/qglobal.h:1172:9`!(QScriptBreakpointsModel)
64 public:
65 QScriptBreakpointsModelPrivatecxx . . $ QScriptBreakpointsModelPrivate#QScriptBreakpointsModelPrivate(49f6e7a06ebc5aa8).();
66 ~cxx . . $ QScriptBreakpointsModelPrivate#`~QScriptBreakpointsModelPrivate`(ced63f7c635d850d).QScriptBreakpointsModelPrivatecxx . . $ QScriptBreakpointsModelPrivate#();
67
68 QScriptDebuggerJobSchedulerInterfacecxx . . $ QScriptDebuggerJobSchedulerInterface# *jobSchedulercxx . . $ QScriptBreakpointsModelPrivate#jobScheduler.;
69 QScriptDebuggerCommandSchedulerInterfacecxx . . $ QScriptDebuggerCommandSchedulerInterface# *commandSchedulercxx . . $ QScriptBreakpointsModelPrivate#commandScheduler.;
70 QListcxx . . $ QList#<QPaircxx . . $ QPair#<int, QScriptBreakpointDatacxx . . $ QScriptBreakpointData#> > breakpointscxx . . $ QScriptBreakpointsModelPrivate#breakpoints.;
71 };
72
73 QScriptBreakpointsModelPrivatecxx . . $ QScriptBreakpointsModelPrivate#::QScriptBreakpointsModelPrivatecxx . . $ QScriptBreakpointsModelPrivate#QScriptBreakpointsModelPrivate(49f6e7a06ebc5aa8).()
74 {
75 }
76
77 QScriptBreakpointsModelPrivatecxx . . $ QScriptBreakpointsModelPrivate#::~cxx . . $ QScriptBreakpointsModelPrivate#`~QScriptBreakpointsModelPrivate`(ced63f7c635d850d).QScriptBreakpointsModelPrivatecxx . . $ QScriptBreakpointsModelPrivate#()
78 {
79 }
80
81 QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#QScriptBreakpointsModel(ee0a2b3b99d18a5c).(
82 QScriptDebuggerJobSchedulerInterfacecxx . . $ QScriptDebuggerJobSchedulerInterface# *jobScheduler,
83 QScriptDebuggerCommandSchedulerInterfacecxx . . $ QScriptDebuggerCommandSchedulerInterface# *commandScheduler,
84 QObjectcxx . . $ QObject# *parent)
85 : QAbstractItemModelcxx . . $ QAbstractItemModel#(*new QScriptBreakpointsModelPrivatecxx . . $ QScriptBreakpointsModelPrivate#QScriptBreakpointsModelPrivate(49f6e7a06ebc5aa8)., parent)
86 {
87 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsModel);
88 d->jobSchedulercxx . . $ QScriptBreakpointsModelPrivate#jobScheduler. = jobScheduler;
89 d->commandSchedulercxx . . $ QScriptBreakpointsModelPrivate#commandScheduler. = commandScheduler;
90 }
91
92 QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::~cxx . . $ QScriptBreakpointsModel#`~QScriptBreakpointsModel`(ced63f7c635d850d).QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#()
93 {
94 }
95
96 namespacecxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/
97 {
98
99 class SetBreakpointJobcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointJob# : public QScriptDebuggerCommandSchedulerJobcxx . . $ QScriptDebuggerCommandSchedulerJob#
100 {
101 public:
102 SetBreakpointJobcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointJob#SetBreakpointJob(ccf90e8b5c309b33).(const QScriptBreakpointDatacxx . . $ QScriptBreakpointData# &data,
103 QScriptDebuggerCommandSchedulerInterfacecxx . . $ QScriptDebuggerCommandSchedulerInterface# *scheduler)
104 : QScriptDebuggerCommandSchedulerJobcxx . . $ QScriptDebuggerCommandSchedulerJob#(scheduler),
105 m_data(data)
106 { }
107
108 void startcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointJob#start(49f6e7a06ebc5aa8).()
109 {
110 QScriptDebuggerCommandSchedulerFrontendcxx . . $ QScriptDebuggerCommandSchedulerFrontend# frontend(commandSchedulercxx . . $ QScriptDebuggerCommandSchedulerJob#commandScheduler(80d89317ed956ed9).(), this);
111 frontend.scheduleSetBreakpointcxx . . $ QScriptDebuggerCommandSchedulerFrontend#scheduleSetBreakpoint(a664fe1f05d5cb93).(m_data);
112 }
113
114 void handleResponsecxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointJob#handleResponse(46b5ea012c87a176).(const QScriptDebuggerResponsecxx . . $ QScriptDebuggerResponse# &, int)
115 {
116 finishcxx . . $ QScriptDebuggerJob#finish(49f6e7a06ebc5aa8).();
117 }
118
119 private:
120 QScriptBreakpointDatacxx . . $ QScriptBreakpointData# m_datacxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointJob#m_data.;
121 };
122
123 } // namespace
124
125 /*!
126 Sets a breakpoint defined by the given \a data.
127 A new row will be inserted into the model if the breakpoint could be
128 successfully set.
129 */
130 void QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::setBreakpointcxx . . $ QScriptBreakpointsModel#setBreakpoint(694486080f38713d).(const QScriptBreakpointDatacxx . . $ QScriptBreakpointData# &data)
131 {
132 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsModel);
133 QScriptDebuggerJobcxx . . $ QScriptDebuggerJob# *job = new SetBreakpointJobcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointJob#(data, d->commandSchedulercxx . . $ QScriptBreakpointsModelPrivate#commandScheduler.);
134 d->jobSchedulercxx . . $ QScriptBreakpointsModelPrivate#jobScheduler.->scheduleJobcxx . . $ QScriptDebuggerJobSchedulerInterface#scheduleJob(40f7c20f23bab508).(job);
135 }
136
137 namespacecxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/
138 {
139
140 class SetBreakpointDataJobcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointDataJob# : public QScriptDebuggerCommandSchedulerJobcxx . . $ QScriptDebuggerCommandSchedulerJob#
141 {
142 public:
143 SetBreakpointDataJobcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointDataJob#SetBreakpointDataJob(f3e9d6c1898991ba).(int id, const QScriptBreakpointDatacxx . . $ QScriptBreakpointData# &data,
144 QScriptDebuggerCommandSchedulerInterfacecxx . . $ QScriptDebuggerCommandSchedulerInterface# *scheduler)
145 : QScriptDebuggerCommandSchedulerJobcxx . . $ QScriptDebuggerCommandSchedulerJob#(scheduler),
146 m_idcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointDataJob#m_id.(id), m_data(data)
147 { }
148
149 void startcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointDataJob#start(49f6e7a06ebc5aa8).()
150 {
151 QScriptDebuggerCommandSchedulerFrontendcxx . . $ QScriptDebuggerCommandSchedulerFrontend# frontend(commandSchedulercxx . . $ QScriptDebuggerCommandSchedulerJob#commandScheduler(80d89317ed956ed9).(), this);
152 frontend.scheduleSetBreakpointDatacxx . . $ QScriptDebuggerCommandSchedulerFrontend#scheduleSetBreakpointData(5bb1a8207f361431).(m_idcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointDataJob#m_id., m_data);
153 }
154
155 void handleResponsecxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointDataJob#handleResponse(46b5ea012c87a176).(const QScriptDebuggerResponsecxx . . $ QScriptDebuggerResponse# &, int)
156 {
157 finishcxx . . $ QScriptDebuggerJob#finish(49f6e7a06ebc5aa8).();
158 }
159
160 private:
161 int m_idcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointDataJob#m_id.;
162 QScriptBreakpointDatacxx . . $ QScriptBreakpointData# m_datacxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointDataJob#m_data.;
163 };
164
165 } // namespace
166
167 /*!
168 Sets the \a data associated with the breakpoint identified by \a id.
169 A dataChanged() signal will be emitted if the breakpoint data could
170 be successfully changed.
171 */
172 void QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::setBreakpointDatacxx . . $ QScriptBreakpointsModel#setBreakpointData(f20b3c29c55c72e7).(int id, const QScriptBreakpointDatacxx . . $ QScriptBreakpointData# &data)
173 {
174 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsModel);
175 QScriptDebuggerJobcxx . . $ QScriptDebuggerJob# *job = new SetBreakpointDataJobcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointDataJob#(id, data, d->commandSchedulercxx . . $ QScriptBreakpointsModelPrivate#commandScheduler.);
176 d->jobSchedulercxx . . $ QScriptBreakpointsModelPrivate#jobScheduler.->scheduleJobcxx . . $ QScriptDebuggerJobSchedulerInterface#scheduleJob(40f7c20f23bab508).(job);
177 }
178
179 namespacecxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/
180 {
181
182 class DeleteBreakpointJobcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/DeleteBreakpointJob# : public QScriptDebuggerCommandSchedulerJobcxx . . $ QScriptDebuggerCommandSchedulerJob#
183 {
184 public:
185 DeleteBreakpointJobcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/DeleteBreakpointJob#DeleteBreakpointJob(df4ea8c112132023).(int id, QScriptDebuggerCommandSchedulerInterfacecxx . . $ QScriptDebuggerCommandSchedulerInterface# *scheduler)
186 : QScriptDebuggerCommandSchedulerJobcxx . . $ QScriptDebuggerCommandSchedulerJob#(scheduler),
187 m_idcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/DeleteBreakpointJob#m_id.(id)
188 { }
189
190 void startcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/DeleteBreakpointJob#start(49f6e7a06ebc5aa8).()
191 {
192 QScriptDebuggerCommandSchedulerFrontendcxx . . $ QScriptDebuggerCommandSchedulerFrontend# frontend(commandSchedulercxx . . $ QScriptDebuggerCommandSchedulerJob#commandScheduler(80d89317ed956ed9).(), this);
193 frontend.scheduleDeleteBreakpointcxx . . $ QScriptDebuggerCommandSchedulerFrontend#scheduleDeleteBreakpoint(7864480464b09eea).(m_idcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/DeleteBreakpointJob#m_id.);
194 }
195
196 void handleResponsecxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/DeleteBreakpointJob#handleResponse(46b5ea012c87a176).(const QScriptDebuggerResponsecxx . . $ QScriptDebuggerResponse# &, int)
197 {
198 finishcxx . . $ QScriptDebuggerJob#finish(49f6e7a06ebc5aa8).();
199 }
200
201 private:
202 int m_idcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/DeleteBreakpointJob#m_id.;
203 };
204
205 } // namespace
206
207 /*!
208 Deletes the breakpoint with the given \a id.
209 The corresponding row in the model will be removed if the breakpoint
210 was successfully deleted.
211 */
212 void QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::deleteBreakpointcxx . . $ QScriptBreakpointsModel#deleteBreakpoint(d4f767463ce0a6b3).(int id)
213 {
214 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsModel);
215 QScriptDebuggerJobcxx . . $ QScriptDebuggerJob# *job = new DeleteBreakpointJobcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/DeleteBreakpointJob#(id, d->commandSchedulercxx . . $ QScriptBreakpointsModelPrivate#commandScheduler.);
216 d->jobSchedulercxx . . $ QScriptBreakpointsModelPrivate#jobScheduler.->scheduleJobcxx . . $ QScriptDebuggerJobSchedulerInterface#scheduleJob(40f7c20f23bab508).(job);
217 }
218
219 /*!
220 Adds a breakpoint to the model. This function does not actually set
221 a breakpoint (i.e. it doesn't communicate with the debugger).
222 */
223 void QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::addBreakpointcxx . . $ QScriptBreakpointsModel#addBreakpoint(f20b3c29c55c72e7).(int id, const QScriptBreakpointDatacxx . . $ QScriptBreakpointData# &data)
224 {
225 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsModel);
226 int rowIndex = d->breakpoints.size();
227 beginInsertRowscxx . . $ QAbstractItemModel#beginInsertRows(d1f44b3c3a3f9fa).(QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(), rowIndex, rowIndex);
228 d->breakpoints.append(qMakePaircxx . . $ qMakePair(bb4b5bd6a8d5b6f3).(id, data));
229 endInsertRowscxx . . $ QAbstractItemModel#endInsertRows(49f6e7a06ebc5aa8).();
230 }
231
232 /*!
233 Modify the \a data of breakpoint \a id.
234 */
235 void QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::modifyBreakpointcxx . . $ QScriptBreakpointsModel#modifyBreakpoint(f20b3c29c55c72e7).(int id, const QScriptBreakpointDatacxx . . $ QScriptBreakpointData# &data)
236 {
237 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsModel);
238 for (int i = 0; i <cxx . . $ `operator<`(9d1caf642710d3b0). d->breakpoints.size(); ++i) {
239 if (d->breakpoints.at(i).first ==cxx . . $ `operator==`(844795bf13b447e6). id) {
240 d->breakpoints[i] = qMakePaircxx . . $ qMakePair(bb4b5bd6a8d5b6f3).(id, data);
241 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! dataChangedcxx . . $ QAbstractItemModel#dataChanged(ae8a85c811f0c28a).(createIndexcxx . . $ QAbstractItemModel#createIndex(61b1598615bb0ee0).(i, 0), createIndexcxx . . $ QAbstractItemModel#createIndex(61b1598615bb0ee0).(i, columnCountcxx . . $ QScriptBreakpointsModel#columnCount(e3878d4d6cd9529c).()-1));
242 break;
243 }
244 }
245 }
246
247 /*!
248 Remove the breakpoint identified by \a id from the model. This
249 function does not delete the breakpoint (i.e. it doesn't communicate
250 with the debugger).
251 */
252 void QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::removeBreakpointcxx . . $ QScriptBreakpointsModel#removeBreakpoint(d4f767463ce0a6b3).(int id)
253 {
254 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsModel);
255 for (int i = 0; i <cxx . . $ `operator<`(9d1caf642710d3b0). d->breakpoints.size(); ++i) {
256 if (d->breakpoints.at(i).first ==cxx . . $ `operator==`(844795bf13b447e6). id) {
257 beginRemoveRowscxx . . $ QAbstractItemModel#beginRemoveRows(d1f44b3c3a3f9fa).(QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(), i, i);
258 d->breakpoints.removeAt(i);
259 endRemoveRowscxx . . $ QAbstractItemModel#endRemoveRows(49f6e7a06ebc5aa8).();
260 break;
261 }
262 }
263 }
264
265 /*!
266 Returns the id of the breakpoint at the given \a row.
267 */
268 int QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::breakpointIdAtcxx . . $ QScriptBreakpointsModel#breakpointIdAt(7ccb52b1bfe01045).(int row) const
269 {
270 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptBreakpointsModel);
271 return d->breakpoints.at(row).first;
272 }
273
274 /*!
275 Returns the data for the breakpoint at the given \a row.
276 */
277 QScriptBreakpointDatacxx . . $ QScriptBreakpointData# QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::breakpointDataAtcxx . . $ QScriptBreakpointsModel#breakpointDataAt(f47377ac0cc278c1).(int row) const
278 {
279 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptBreakpointsModel);
280 return d->breakpoints.at(row).second;
281 }
282
283 QScriptBreakpointDatacxx . . $ QScriptBreakpointData# QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::breakpointDatacxx . . $ QScriptBreakpointsModel#breakpointData(f47377ac0cc278c1).(int id) const
284 {
285 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptBreakpointsModel);
286 for (int i = 0; i <cxx . . $ `operator<`(9d1caf642710d3b0). d->breakpoints.size(); ++i) {
287 if (d->breakpoints.at(i).first ==cxx . . $ `operator==`(844795bf13b447e6). id)
288 return d->breakpoints.at(i).second;
289 }
290 return QScriptBreakpointDatacxx . . $ QScriptBreakpointData#QScriptBreakpointData(49f6e7a06ebc5aa8).();
291 }
292
293 /*!
294 Tries to find a breakpoint with the given \a scriptId and \a
295 lineNumber. Returns the id of the first breakpoint that matches, or
296 -1 if no such breakpoint is found.
297 */
298 int QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::resolveBreakpointcxx . . $ QScriptBreakpointsModel#resolveBreakpoint(c59ecb89964b6eb7).(qint64cxx . . $ qint64# scriptId, int lineNumber) const
299 {
300 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptBreakpointsModel);
301 for (int i = 0; i <cxx . . $ `operator<`(9d1caf642710d3b0). d->breakpoints.size(); ++i) {
302 if ((d->breakpoints.at(i).second.scriptId() ==cxx . . $ `operator==`(844795bf13b447e6). scriptId)
303 && (d->breakpoints.at(i).second.lineNumber() ==cxx . . $ `operator==`(844795bf13b447e6). lineNumber)) {
304 return d->breakpoints.at(i).first;
305 }
306 }
307 return -1;
308 }
309
310 int QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::resolveBreakpointcxx . . $ QScriptBreakpointsModel#resolveBreakpoint(91f46685ef4c12b5).(const QStringcxx . . $ QString# &fileName, int lineNumber) const
311 {
312 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptBreakpointsModel);
313 for (int i = 0; i <cxx . . $ `operator<`(9d1caf642710d3b0). d->breakpoints.size(); ++i) {
314 if ((d->breakpoints.at(i).second.fileName() ==cxx . . $ `operator==`(844795bf13b447e6). fileName)
315 && (d->breakpoints.at(i).second.lineNumber() ==cxx . . $ `operator==`(844795bf13b447e6). lineNumber)) {
316 return d->breakpoints.at(i).first;
317 }
318 }
319 return -1;
320 }
321
322 /*!
323 \reimp
324 */
325 QModelIndexcxx . . $ QModelIndex# QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::indexcxx . . $ QScriptBreakpointsModel#index(37dbccf64c4e392).(int row, int column, const QModelIndexcxx . . $ QModelIndex# &parent) const
326 {
327 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptBreakpointsModel);
328 if (parent.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).())
329 return QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).();
330 if ((row < 0) || (row >=cxx . . $ `operator>=`(489f5a20d57ffae2). d->breakpoints.size()))
331 return QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).();
332 if ((column < 0) || (column >= columnCountcxx . . $ QScriptBreakpointsModel#columnCount(e3878d4d6cd9529c).()))
333 return QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).();
334 return createIndexcxx . . $ QAbstractItemModel#createIndex(61b1598615bb0ee0).(row, column);
335 }
336
337 /*!
338 \reimp
339 */
340 QModelIndexcxx . . $ QModelIndex# QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::parentcxx . . $ QScriptBreakpointsModel#parent(f800c6f2fa4cbe57).(const QModelIndexcxx . . $ QModelIndex# &) const
341 {
342 return QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).();
343 }
344
345 /*!
346 \reimp
347 */
348 int QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::columnCountcxx . . $ QScriptBreakpointsModel#columnCount(e3878d4d6cd9529c).(const QModelIndexcxx . . $ QModelIndex# &parent) const
349 {
350 if (!parent.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).())
351 return 6;
352 return 0;
353 }
354
355 /*!
356 \reimp
357 */
358 int QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::rowCountcxx . . $ QScriptBreakpointsModel#rowCount(e3878d4d6cd9529c).(const QModelIndexcxx . . $ QModelIndex# &parent) const
359 {
360 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptBreakpointsModel);
361 if (!parent.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).())
362 return d->breakpoints.size();
363 return 0;
364 }
365
366 /*!
367 \reimp
368 */
369 QVariantcxx . . $ QVariant# QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::datacxx . . $ QScriptBreakpointsModel#data(69b5b18a001c0029).(const QModelIndexcxx . . $ QModelIndex# &index, int role) const
370 {
371 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QScriptBreakpointsModel);
372 if (!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).() || (index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).() >=cxx . . $ `operator>=`(489f5a20d57ffae2). d->breakpoints.size()))
373 return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).();
374 const QPaircxx . . $ QPair#<int, QScriptBreakpointDatacxx . . $ QScriptBreakpointData#> &item = d->breakpoints.at(index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).());
375 if (role == Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.) {
376 if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 0)
377 return item.first;
378 else if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 1) {
379 QStringcxx . . $ QString# loc = item.second.fileName();
380 if (loc.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
381 loc = QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).("<anonymous script, id=%0>").argcxx . . $ QString#arg(ec0c7a4bb7c7a5fe).(item.second.scriptId());
382 loc.appendcxx . . $ QString#append(2bd4372d9c41ccd4).(QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).(":%0").argcxx . . $ QString#arg(ec0c7a4bb7c7a5fe).(item.second.lineNumber()));
383 return loccxx . . $ QVariant#QVariant(3520e46b33348bf6).;
384 } else if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 2) {
385 if (!item.second.condition().isEmpty())
386 return item.second.condition();
387 } else if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 3) {
388 if (item.second.ignoreCount() !=cxx . . $ `operator!=`(844795bf13b447e6). 0)
389 return item.second.ignoreCount();
390 } else if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 5) {
391 return item.second.hitCount();
392 }
393 } else if (role == Qtcxx . . $ Qt/::CheckStateRolecxx . . $ Qt/CheckStateRole.) {
394 if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 0) {
395 return item.second.isEnabled() ? Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked. : Qtcxx . . $ Qt/::Uncheckedcxx . . $ Qt/Unchecked.;
396 } else if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 4) {
397 return item.second.isSingleShot() ? Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked. : Qtcxx . . $ Qt/::Uncheckedcxx . . $ Qt/Unchecked.;
398 }
399 } else if (role == Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.) {
400 if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 2)
401 return item.second.condition();
402 else if (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).() == 3)
403 return item.second.ignoreCount();
404 }
405 return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).();
406 }
407
408 /*!
409 \reimp
410 */
411 bool QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::setDatacxx . . $ QScriptBreakpointsModel#setData(6d1d8401440d0a2c).(const QModelIndexcxx . . $ QModelIndex# &index, const QVariantcxx . . $ QVariant# &value, int role)
412 {
413 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QScriptBreakpointsModel);
414 if (!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).() || (index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).() >=cxx . . $ `operator>=`(489f5a20d57ffae2). d->breakpoints.size()))
415 return false;
416 const QPaircxx . . $ QPair#<int, QScriptBreakpointDatacxx . . $ QScriptBreakpointData#> &item = d->breakpoints.at(index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).());
417 QScriptBreakpointDatacxx . . $ QScriptBreakpointData# modifiedDatacxx . . $ QScriptBreakpointData#QScriptBreakpointData(49f6e7a06ebc5aa8).;
418 int col = index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).();
419 if ((col == 0) || (col == 4)) {
420 if (role == Qtcxx . . $ Qt/::CheckStateRolecxx . . $ Qt/CheckStateRole.) {
421 modifiedData = item.second;
422 if (col == 0)
423 modifiedData.setEnabledcxx . . $ QScriptBreakpointData#setEnabled(b45ddcbc8423892c).(value.toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).() == Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.);
424 else
425 modifiedData.setSingleShotcxx . . $ QScriptBreakpointData#setSingleShot(b45ddcbc8423892c).(value.toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).() == Qtcxx . . $ Qt/::Checkedcxx . . $ Qt/Checked.);
426 }
427 } else if (col == 2) {
428 if (role == Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.) {
429 modifiedData = item.second;
430 modifiedData.setConditioncxx . . $ QScriptBreakpointData#setCondition(3520e46b33348bf6).(value.toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).());
431 }
432 } else if (col == 3) {
433 if (role == Qtcxx . . $ Qt/::EditRolecxx . . $ Qt/EditRole.) {
434 modifiedData = item.second;
435 modifiedData.setIgnoreCountcxx . . $ QScriptBreakpointData#setIgnoreCount(d4f767463ce0a6b3).(value.toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).());
436 }
437 }
438 if (!modifiedData.isValidcxx . . $ QScriptBreakpointData#isValid(50ce9a9e25b4a850).())
439 return false;
440 QScriptDebuggerJobcxx . . $ QScriptDebuggerJob# *job = new SetBreakpointDataJobcxx . . $ `$anonymous_namespace_src/scripttools/debugging/qscriptbreakpointsmodel.cpp`/SetBreakpointDataJob#(item.first, modifiedData, d->commandSchedulercxx . . $ QScriptBreakpointsModelPrivate#commandScheduler.);
441 d->jobSchedulercxx . . $ QScriptBreakpointsModelPrivate#jobScheduler.->scheduleJobcxx . . $ QScriptDebuggerJobSchedulerInterface#scheduleJob(40f7c20f23bab508).(job);
442 return true;
443 }
444
445 /*!
446 \reimp
447 */
448 QVariantcxx . . $ QVariant# QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::headerDatacxx . . $ QScriptBreakpointsModel#headerData(b8cfec0985494997).(int section, Qtcxx . . $ Qt/::Orientationcxx . . $ Qt/Orientation# orient, int role) const
449 {
450 if (orient == Qtcxx . . $ Qt/::Horizontalcxx . . $ Qt/Horizontal.) {
451 if (role == Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.) {
452 if (section == 0)
453 return QCoreApplicationcxx . . $ QVariant#QVariant(3520e46b33348bf6).::translatecxx . . $ QCoreApplication#translate(699330408c757f1b).("QScriptBreakpointsModel", "ID");
454 else if (section == 1)
455 return QCoreApplicationcxx . . $ QVariant#QVariant(3520e46b33348bf6).::translatecxx . . $ QCoreApplication#translate(699330408c757f1b).("QScriptBreakpointsModel", "Location");
456 else if (section == 2)
457 return QCoreApplicationcxx . . $ QVariant#QVariant(3520e46b33348bf6).::translatecxx . . $ QCoreApplication#translate(699330408c757f1b).("QScriptBreakpointsModel", "Condition");
458 else if (section == 3)
459 return QCoreApplicationcxx . . $ QVariant#QVariant(3520e46b33348bf6).::translatecxx . . $ QCoreApplication#translate(699330408c757f1b).("QScriptBreakpointsModel", "Ignore-count");
460 else if (section == 4)
461 return QCoreApplicationcxx . . $ QVariant#QVariant(3520e46b33348bf6).::translatecxx . . $ QCoreApplication#translate(699330408c757f1b).("QScriptBreakpointsModel", "Single-shot");
462 else if (section == 5)
463 return QCoreApplicationcxx . . $ QVariant#QVariant(3520e46b33348bf6).::translatecxx . . $ QCoreApplication#translate(699330408c757f1b).("QScriptBreakpointsModel", "Hit-count");
464 }
465 }
466 return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).();
467 }
468
469 /*!
470 \reimp
471 */
472 Qtcxx . . $ Qt/::ItemFlagscxx . . $ Qt/ItemFlags# QScriptBreakpointsModelcxx . . $ QScriptBreakpointsModel#::flagscxx . . $ QScriptBreakpointsModel#flags(36b38c1b3d3f7b45).(const QModelIndexcxx . . $ QModelIndex# &index) const
473 {
474 if (!index.isValidcxx . . $ QModelIndex#isValid(3482b152b9333168).())
475 return {};
476 Qtcxx . . $ Qt/::ItemFlagscxx . . $ Qt/ItemFlags# ret = QAbstractItemModel::flags(index);
477 switch (index.columncxx . . $ QModelIndex#column(ea6fe5115c70a13f).()) {
478 case 0:
479 ret |= Qtcxx . . $ Qt/::ItemIsUserCheckablecxx . . $ Qt/ItemIsUserCheckable.;
480 break;
481 case 1:
482 break;
483 case 2:
484 ret |= Qtcxx . . $ Qt/::ItemIsEditablecxx . . $ Qt/ItemIsEditable.;
485 break;
486 case 3:
487 ret |= Qtcxx . . $ Qt/::ItemIsEditablecxx . . $ Qt/ItemIsEditable.;
488 break;
489 case 4:
490 ret |= Qtcxx . . $ Qt/::ItemIsUserCheckablecxx . . $ Qt/ItemIsUserCheckable.;
491 break;
492 }
493 return ret;
494 }
495
496 QT_END_NAMESPACEcxx . . $ `<external>/15045578679651060896/qglobal.h:149:10`!