本文整理汇总了C++中ApiTraceCall::parentFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ ApiTraceCall::parentFrame方法的具体用法?C++ ApiTraceCall::parentFrame怎么用?C++ ApiTraceCall::parentFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiTraceCall
的用法示例。
在下文中一共展示了ApiTraceCall::parentFrame方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: callItemSelected
void MainWindow::callItemSelected(const QModelIndex &index)
{
ApiTraceEvent *event =
index.data(ApiTraceModel::EventRole).value<ApiTraceEvent*>();
if (event && event->type() == ApiTraceEvent::Call) {
ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
m_ui.detailsDock->setWindowTitle(
tr("Details View. Frame %1, Call %2")
.arg(call->parentFrame() ? call->parentFrame()->number : 0)
.arg(call->index()));
m_ui.detailsWebView->setHtml(call->toHtml());
m_ui.detailsDock->show();
m_ui.callView->scrollTo(index);
if (call->hasBinaryData()) {
QByteArray data =
call->arguments()[call->binaryDataIndex()].toByteArray();
m_vdataInterpreter->setData(data);
QVector<QVariant> args = call->arguments();
for (int i = 0; i < call->argNames().count(); ++i) {
QString name = call->argNames()[i];
if (name == QLatin1String("stride")) {
int stride = args[i].toInt();
m_ui.vertexStrideSB->setValue(stride);
} else if (name == QLatin1String("size")) {
int components = args[i].toInt();
m_ui.vertexComponentsSB->setValue(components);
} else if (name == QLatin1String("type")) {
QString val = args[i].toString();
int textIndex = m_ui.vertexTypeCB->findText(val);
if (textIndex >= 0) {
m_ui.vertexTypeCB->setCurrentIndex(textIndex);
}
}
}
}
m_ui.backtraceBrowser->setText(call->backtrace());
m_ui.backtraceDock->setVisible(!call->backtrace().isNull());
m_ui.vertexDataDock->setVisible(call->hasBinaryData());
m_selectedEvent = call;
} else {
if (event && event->type() == ApiTraceEvent::Frame) {
m_selectedEvent = static_cast<ApiTraceFrame*>(event);
} else {
m_selectedEvent = 0;
}
m_ui.detailsDock->hide();
m_ui.backtraceDock->hide();
m_ui.vertexDataDock->hide();
}
if (m_selectedEvent && m_selectedEvent->hasState()) {
fillStateForFrame();
} else {
m_ui.stateDock->hide();
}
}
示例2: parent
QModelIndex ApiTraceModel::parent(const QModelIndex &index) const
{
if (!index.isValid())
return QModelIndex();
ApiTraceEvent *event = item(index);
if (event && event->type() == ApiTraceEvent::Call) {
ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
Q_ASSERT(call->parentFrame());
return createIndex(call->parentFrame()->number,
0, call->parentFrame());
}
return QModelIndex();
}
示例3: slotGoFrameEnd
void MainWindow::slotGoFrameEnd()
{
ApiTraceFrame *frame = currentFrame();
ApiTraceCall *call = currentCall();
if (!frame && call) {
frame = call->parentFrame();
}
m_trace->findFrameEnd(frame);
}
示例4: parent
QModelIndex ApiTraceModel::parent(const QModelIndex &index) const
{
if (!index.isValid())
return QModelIndex();
ApiTraceEvent *event = item(index);
if (event->type() == ApiTraceEvent::Call) {
ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
if (call->parentCall()) {
ApiTraceCall *parentCall = call->parentCall();
ApiTraceEvent *topEvent = parentCall->parentEvent();
return createIndex(topEvent->callIndex(parentCall), 0, parentCall);
} else {
Q_ASSERT(call->parentFrame());
return createIndex(call->parentFrame()->number,
0, call->parentFrame());
}
}
return QModelIndex();
}
示例5:
ApiTraceFrame * MainWindow::selectedFrame() const
{
if (m_selectedEvent) {
if (m_selectedEvent->type() == ApiTraceEvent::Frame) {
return static_cast<ApiTraceFrame*>(m_selectedEvent);
} else {
Q_ASSERT(m_selectedEvent->type() == ApiTraceEvent::Call);
ApiTraceCall *call = static_cast<ApiTraceCall*>(m_selectedEvent);
return call->parentFrame();
}
}
return NULL;
}
示例6: slotSearchPrev
void MainWindow::slotSearchPrev(const QString &str,
Qt::CaseSensitivity sensitivity)
{
ApiTraceCall *call = currentCall();
ApiTraceFrame *frame = currentFrame();
Q_ASSERT(call || frame);
if (!frame) {
frame = call->parentFrame();
}
Q_ASSERT(frame);
m_trace->findPrev(frame, call, str, sensitivity);
}
示例7: stateSetOnEvent
void ApiTraceModel::stateSetOnEvent(ApiTraceEvent *event)
{
if (!event)
return;
if (event->type() == ApiTraceEvent::Call) {
ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
ApiTraceFrame *frame = call->parentFrame();
int row = frame->callIndex(call);
QModelIndex index = createIndex(row, 0, call);
emit dataChanged(index, index);
} else if (event->type() == ApiTraceEvent::Frame) {
ApiTraceFrame *frame = static_cast<ApiTraceFrame*>(event);
const QList<ApiTraceFrame*> frames = m_trace->frames();
int row = frames.indexOf(frame);
QModelIndex index = createIndex(row, 0, frame);
emit dataChanged(index, index);
}
}