本文整理汇总了C++中ApiTraceFrame::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ ApiTraceFrame::isEmpty方法的具体用法?C++ ApiTraceFrame::isEmpty怎么用?C++ ApiTraceFrame::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiTraceFrame
的用法示例。
在下文中一共展示了ApiTraceFrame::isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: replayTrace
void MainWindow::replayTrace(bool dumpState, bool dumpThumbnails)
{
if (m_trace->fileName().isEmpty()) {
return;
}
m_retracer->setFileName(m_trace->fileName());
m_retracer->setAPI(m_api);
m_retracer->setCaptureState(dumpState);
m_retracer->setCaptureThumbnails(dumpThumbnails);
if (m_retracer->captureState() && m_selectedEvent) {
int index = 0;
if (m_selectedEvent->type() == ApiTraceEvent::Call) {
index = static_cast<ApiTraceCall*>(m_selectedEvent)->index();
} else if (m_selectedEvent->type() == ApiTraceEvent::Frame) {
ApiTraceFrame *frame =
static_cast<ApiTraceFrame*>(m_selectedEvent);
if (frame->isEmpty()) {
//XXX i guess we could still get the current state
qDebug()<<"tried to get a state for an empty frame";
return;
}
index = frame->lastCallIndex();
} else {
qDebug()<<"Unknown event type";
return;
}
m_retracer->setCaptureAtCallNumber(index);
}
m_retracer->start();
m_ui.actionStop->setEnabled(true);
m_progressBar->show();
if (dumpState || dumpThumbnails) {
if (dumpState && dumpThumbnails) {
statusBar()->showMessage(
tr("Looking up the state and capturing thumbnails..."));
} else if (dumpState) {
statusBar()->showMessage(
tr("Looking up the state..."));
} else if (dumpThumbnails) {
statusBar()->showMessage(
tr("Capturing thumbnails..."));
}
} else if (m_retracer->isProfiling()) {
statusBar()->showMessage(
tr("Profiling draw calls in trace file..."));
} else {
statusBar()->showMessage(
tr("Replaying the trace file..."));
}
}
示例2: hasChildren
bool ApiTraceModel::hasChildren(const QModelIndex &parent) const
{
if (parent.isValid()) {
ApiTraceEvent *event = item(parent);
if (event && event->type() == ApiTraceEvent::Frame) {
ApiTraceFrame *frame = static_cast<ApiTraceFrame*>(event);
return !frame->isEmpty();
} else
return false;
} else {
return (rowCount() > 0);
}
}
示例3: hasChildren
bool ApiTraceModel::hasChildren(const QModelIndex &parent) const
{
if (parent.isValid()) {
ApiTraceEvent *event = item(parent);
if (!event)
return false;
if (event->type() == ApiTraceEvent::Frame) {
ApiTraceFrame *frame = static_cast<ApiTraceFrame*>(event);
return !frame->isEmpty();
} else {
Q_ASSERT(event->type() == ApiTraceEvent::Call);
ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
return call->numChildren() != 0;
}
} else {
return (rowCount() > 0);
}
}