1 #include "mainwindow.h"
4 #include "apitracecall.h"
5 #include "apicalldelegate.h"
6 #include "apitracemodel.h"
7 #include "apitracefilter.h"
8 #include "imageviewer.h"
9 #include "jumpwidget.h"
11 #include "searchwidget.h"
12 #include "settingsdialog.h"
13 #include "shaderssourcewidget.h"
14 #include "tracedialog.h"
15 #include "traceprocess.h"
16 #include "ui_retracerdialog.h"
17 #include "vertexdatainterpreter.h"
21 #include <QDesktopServices>
23 #include <QFileDialog>
25 #include <QMessageBox>
26 #include <QProgressBar>
30 #include <QVBoxLayout>
35 MainWindow::MainWindow()
45 void MainWindow::createTrace()
49 if (!m_traceProcess->canTrace()) {
53 tr("Current configuration doesn't support tracing."));
57 if (dialog.exec() == QDialog::Accepted) {
58 qDebug()<< "App : " <<dialog.applicationPath();
59 qDebug()<< " Arguments: "<<dialog.arguments();
60 m_traceProcess->setExecutablePath(dialog.applicationPath());
61 m_traceProcess->setArguments(dialog.arguments());
62 m_traceProcess->start();
66 void MainWindow::openTrace()
69 QFileDialog::getOpenFileName(
73 tr("Trace Files (*.trace)"));
75 qDebug()<< "File name : " <<fileName;
77 newTraceFile(fileName);
80 void MainWindow::loadTrace(const QString &fileName)
82 if (!QFile::exists(fileName)) {
83 QMessageBox::warning(this, tr("File Missing"),
84 tr("File '%1' doesn't exist.").arg(fileName));
87 qDebug()<< "Loading : " <<fileName;
89 m_progressBar->setValue(0);
90 newTraceFile(fileName);
93 void MainWindow::callItemSelected(const QModelIndex &index)
95 ApiTraceEvent *event =
96 index.data(ApiTraceModel::EventRole).value<ApiTraceEvent*>();
98 if (event && event->type() == ApiTraceEvent::Call) {
99 ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
100 m_ui.detailsWebView->setHtml(call->toHtml());
101 m_ui.detailsDock->show();
102 if (call->hasBinaryData()) {
104 call->argValues[call->binaryDataIndex()].toByteArray();
105 m_vdataInterpreter->setData(data);
107 for (int i = 0; i < call->argNames.count(); ++i) {
108 QString name = call->argNames[i];
109 if (name == QLatin1String("stride")) {
110 int stride = call->argValues[i].toInt();
111 m_ui.vertexStrideSB->setValue(stride);
112 } else if (name == QLatin1String("size")) {
113 int components = call->argValues[i].toInt();
114 m_ui.vertexComponentsSB->setValue(components);
115 } else if (name == QLatin1String("type")) {
116 QString val = call->argValues[i].toString();
117 int textIndex = m_ui.vertexTypeCB->findText(val);
119 m_ui.vertexTypeCB->setCurrentIndex(textIndex);
123 m_ui.vertexDataDock->setVisible(call->hasBinaryData());
124 m_selectedEvent = call;
126 if (event && event->type() == ApiTraceEvent::Frame) {
127 m_selectedEvent = static_cast<ApiTraceFrame*>(event);
130 m_ui.detailsDock->hide();
131 m_ui.vertexDataDock->hide();
133 if (m_selectedEvent && !m_selectedEvent->state().isEmpty()) {
136 m_ui.stateDock->hide();
139 void MainWindow::replayStart()
142 Ui_RetracerDialog dlgUi;
145 dlgUi.doubleBufferingCB->setChecked(
146 m_retracer->isDoubleBuffered());
147 dlgUi.benchmarkCB->setChecked(
148 m_retracer->isBenchmarking());
150 if (dlg.exec() == QDialog::Accepted) {
151 m_retracer->setDoubleBuffered(
152 dlgUi.doubleBufferingCB->isChecked());
153 m_retracer->setBenchmarking(
154 dlgUi.benchmarkCB->isChecked());
159 void MainWindow::replayStop()
162 m_ui.actionStop->setEnabled(false);
163 m_ui.actionReplay->setEnabled(true);
164 m_ui.actionLookupState->setEnabled(true);
167 void MainWindow::newTraceFile(const QString &fileName)
169 m_traceFileName = fileName;
170 m_trace->setFileName(fileName);
172 if (m_traceFileName.isEmpty()) {
173 m_ui.actionReplay->setEnabled(false);
174 m_ui.actionLookupState->setEnabled(false);
175 setWindowTitle(tr("QApiTrace"));
177 QFileInfo info(fileName);
178 m_ui.actionReplay->setEnabled(true);
179 m_ui.actionLookupState->setEnabled(true);
181 tr("QApiTrace - %1").arg(info.fileName()));
185 void MainWindow::replayFinished(const QString &output)
187 m_ui.actionStop->setEnabled(false);
188 m_ui.actionReplay->setEnabled(true);
189 m_ui.actionLookupState->setEnabled(true);
191 m_progressBar->hide();
192 if (output.length() < 80) {
193 statusBar()->showMessage(output);
196 statusBar()->showMessage(
197 tr("Replaying finished!"), 2000);
200 void MainWindow::replayError(const QString &message)
202 m_ui.actionStop->setEnabled(false);
203 m_ui.actionReplay->setEnabled(true);
204 m_ui.actionLookupState->setEnabled(true);
207 m_progressBar->hide();
208 statusBar()->showMessage(
209 tr("Replaying unsuccessful."), 2000);
210 QMessageBox::warning(
211 this, tr("Replay Failed"), message);
214 void MainWindow::startedLoadingTrace()
217 m_progressBar->show();
218 QFileInfo info(m_trace->fileName());
219 statusBar()->showMessage(
220 tr("Loading %1...").arg(info.fileName()));
223 void MainWindow::finishedLoadingTrace()
225 m_progressBar->hide();
229 QFileInfo info(m_trace->fileName());
230 statusBar()->showMessage(
231 tr("Loaded %1").arg(info.fileName()), 3000);
234 void MainWindow::replayTrace(bool dumpState)
236 if (m_traceFileName.isEmpty())
239 m_retracer->setFileName(m_traceFileName);
240 m_retracer->setCaptureState(dumpState);
241 if (m_retracer->captureState() && m_selectedEvent) {
243 if (m_selectedEvent->type() == ApiTraceEvent::Call) {
244 index = static_cast<ApiTraceCall*>(m_selectedEvent)->index;
245 } else if (m_selectedEvent->type() == ApiTraceEvent::Frame) {
246 ApiTraceFrame *frame =
247 static_cast<ApiTraceFrame*>(m_selectedEvent);
248 if (frame->calls.isEmpty()) {
249 //XXX i guess we could still get the current state
250 qDebug()<<"tried to get a state for an empty frame";
253 index = frame->calls.first()->index;
255 qDebug()<<"Unknown event type";
258 m_retracer->setCaptureAtCallNumber(index);
262 m_ui.actionStop->setEnabled(true);
263 m_progressBar->show();
265 statusBar()->showMessage(
266 tr("Looking up the state..."));
268 statusBar()->showMessage(
269 tr("Replaying the trace file..."));
272 void MainWindow::lookupState()
274 if (!m_selectedEvent) {
275 QMessageBox::warning(
276 this, tr("Unknown Event"),
277 tr("To inspect the state select an event in the event list."));
280 m_stateEvent = m_selectedEvent;
284 MainWindow::~MainWindow()
289 variantToString(const QVariant &var, QString &str)
291 if (var.type() == QVariant::List) {
292 QVariantList lst = var.toList();
293 str += QLatin1String("[");
294 for (int i = 0; i < lst.count(); ++i) {
295 QVariant val = lst[i];
296 variantToString(val, str);
297 if (i < lst.count() - 1)
298 str += QLatin1String(", ");
300 str += QLatin1String("]");
301 } else if (var.type() == QVariant::Map) {
302 Q_ASSERT(!"unsupported state type");
303 } else if (var.type() == QVariant::Hash) {
304 Q_ASSERT(!"unsupported state type");
306 str += var.toString();
310 static QTreeWidgetItem *
311 variantToItem(const QString &key, const QVariant &var, const QVariant &defaultVar);
314 variantMapToItems(const QVariantMap &map, const QVariantMap &defaultMap, QList<QTreeWidgetItem *> &items)
316 QVariantMap::const_iterator itr;
317 for (itr = map.constBegin(); itr != map.constEnd(); ++itr) {
318 QString key = itr.key();
319 QVariant var = itr.value();
320 QVariant defaultVar = defaultMap[key];
322 QTreeWidgetItem *item = variantToItem(key, var, defaultVar);
330 variantListToItems(const QVariantList &lst, const QVariantList &defaultLst, QList<QTreeWidgetItem *> &items)
332 for (int i = 0; i < lst.count(); ++i) {
333 QString key = QString::number(i);
334 QVariant var = lst[i];
337 if (i < defaultLst.count()) {
338 defaultVar = defaultLst[i];
341 QTreeWidgetItem *item = variantToItem(key, var, defaultVar);
349 isVariantDeep(const QVariant &var)
351 if (var.type() == QVariant::List) {
352 QVariantList lst = var.toList();
353 for (int i = 0; i < lst.count(); ++i) {
354 if (isVariantDeep(lst[i])) {
359 } else if (var.type() == QVariant::Map) {
361 } else if (var.type() == QVariant::Hash) {
368 static QTreeWidgetItem *
369 variantToItem(const QString &key, const QVariant &var, const QVariant &defaultVar)
371 if (var == defaultVar) {
377 bool deep = isVariantDeep(var);
379 variantToString(var, val);
382 //qDebug()<<"key = "<<key;
383 //qDebug()<<"val = "<<val;
388 QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidgetItem *)0, lst);
391 QList<QTreeWidgetItem *> children;
392 if (var.type() == QVariant::Map) {
393 QVariantMap map = var.toMap();
394 QVariantMap defaultMap = defaultVar.toMap();
395 variantMapToItems(map, defaultMap, children);
397 if (var.type() == QVariant::List) {
398 QVariantList lst = var.toList();
399 QVariantList defaultLst = defaultVar.toList();
400 variantListToItems(lst, defaultLst, children);
402 item->addChildren(children);
408 void MainWindow::fillStateForFrame()
412 if (!m_selectedEvent || m_selectedEvent->state().isEmpty())
415 bool nonDefaults = m_ui.nonDefaultsCB->isChecked();
416 QVariantMap defaultParams;
418 ApiTraceState defaultState = m_trace->defaultState();
419 defaultParams = defaultState.parameters();
422 const ApiTraceState &state = m_selectedEvent->state();
423 m_ui.stateTreeWidget->clear();
424 params = state.parameters();
425 QList<QTreeWidgetItem *> items;
426 variantMapToItems(params, defaultParams, items);
427 m_ui.stateTreeWidget->insertTopLevelItems(0, items);
429 QMap<QString, QString> shaderSources = state.shaderSources();
430 if (shaderSources.isEmpty()) {
431 m_sourcesWidget->setShaders(shaderSources);
433 m_sourcesWidget->setShaders(shaderSources);
436 const QList<ApiTexture> &textures =
438 const QList<ApiFramebuffer> &fbos =
439 state.framebuffers();
441 m_ui.surfacesTreeWidget->clear();
442 if (textures.isEmpty() && fbos.isEmpty()) {
443 m_ui.surfacesTab->setDisabled(false);
445 m_ui.surfacesTreeWidget->setIconSize(QSize(64, 64));
446 if (!textures.isEmpty()) {
447 QTreeWidgetItem *textureItem =
448 new QTreeWidgetItem(m_ui.surfacesTreeWidget);
449 textureItem->setText(0, tr("Textures"));
450 if (textures.count() <= 6)
451 textureItem->setExpanded(true);
453 for (int i = 0; i < textures.count(); ++i) {
454 const ApiTexture &texture =
456 QIcon icon(QPixmap::fromImage(texture.thumb()));
457 QTreeWidgetItem *item = new QTreeWidgetItem(textureItem);
458 item->setIcon(0, icon);
459 int width = texture.size().width();
460 int height = texture.size().height();
462 QString::fromLatin1("%1, %2 x %3")
463 .arg(texture.target())
466 item->setText(1, descr);
468 item->setData(0, Qt::UserRole,
472 if (!fbos.isEmpty()) {
473 QTreeWidgetItem *fboItem =
474 new QTreeWidgetItem(m_ui.surfacesTreeWidget);
475 fboItem->setText(0, tr("Framebuffers"));
476 if (fbos.count() <= 6)
477 fboItem->setExpanded(true);
479 for (int i = 0; i < fbos.count(); ++i) {
480 const ApiFramebuffer &fbo =
482 QIcon icon(QPixmap::fromImage(fbo.thumb()));
483 QTreeWidgetItem *item = new QTreeWidgetItem(fboItem);
484 item->setIcon(0, icon);
485 int width = fbo.size().width();
486 int height = fbo.size().height();
488 QString::fromLatin1("%1, %2 x %3")
492 item->setText(1, descr);
494 item->setData(0, Qt::UserRole,
498 m_ui.surfacesTab->setEnabled(true);
500 m_ui.stateDock->show();
503 void MainWindow::showSettings()
505 SettingsDialog dialog;
506 dialog.setFilterModel(m_proxyModel);
511 void MainWindow::openHelp(const QUrl &url)
513 QDesktopServices::openUrl(url);
516 void MainWindow::showSurfacesMenu(const QPoint &pos)
518 QTreeWidget *tree = m_ui.surfacesTreeWidget;
519 QTreeWidgetItem *item = tree->itemAt(pos);
523 QMenu menu(tr("Surfaces"), this);
525 QAction *act = menu.addAction(tr("View Image"));
526 act->setStatusTip(tr("View the currently selected surface"));
527 connect(act, SIGNAL(triggered()),
528 SLOT(showSelectedSurface()));
530 menu.exec(tree->viewport()->mapToGlobal(pos));
533 void MainWindow::showSelectedSurface()
535 QTreeWidgetItem *item =
536 m_ui.surfacesTreeWidget->currentItem();
541 QVariant var = item->data(0, Qt::UserRole);
542 m_imageViewer->setImage(var.value<QImage>());
543 m_imageViewer->show();
544 m_imageViewer->raise();
545 m_imageViewer->activateWindow();
548 void MainWindow::initObjects()
550 m_ui.stateTreeWidget->sortByColumn(0, Qt::AscendingOrder);
552 m_sourcesWidget = new ShadersSourceWidget(m_ui.shadersTab);
553 QVBoxLayout *layout = new QVBoxLayout;
554 layout->addWidget(m_sourcesWidget);
555 m_ui.shadersTab->setLayout(layout);
557 m_trace = new ApiTrace();
558 m_retracer = new Retracer(this);
560 m_vdataInterpreter = new VertexDataInterpreter(this);
561 m_vdataInterpreter->setListWidget(m_ui.vertexDataListWidget);
562 m_vdataInterpreter->setStride(
563 m_ui.vertexStrideSB->value());
564 m_vdataInterpreter->setComponents(
565 m_ui.vertexComponentsSB->value());
566 m_vdataInterpreter->setStartingOffset(
567 m_ui.startingOffsetSB->value());
568 m_vdataInterpreter->setTypeFromString(
569 m_ui.vertexTypeCB->currentText());
571 m_imageViewer = new ImageViewer(this);
573 m_model = new ApiTraceModel();
574 m_model->setApiTrace(m_trace);
575 m_proxyModel = new ApiTraceFilter();
576 m_proxyModel->setSourceModel(m_model);
577 m_ui.callView->setModel(m_proxyModel);
578 m_ui.callView->setItemDelegate(new ApiCallDelegate);
579 m_ui.callView->resizeColumnToContents(0);
580 m_ui.callView->header()->swapSections(0, 1);
581 m_ui.callView->setColumnWidth(1, 42);
583 m_progressBar = new QProgressBar();
584 m_progressBar->setRange(0, 0);
585 statusBar()->addPermanentWidget(m_progressBar);
586 m_progressBar->hide();
588 m_ui.detailsDock->hide();
589 m_ui.vertexDataDock->hide();
590 m_ui.stateDock->hide();
591 setDockOptions(dockOptions() | QMainWindow::ForceTabbedDocks);
593 tabifyDockWidget(m_ui.stateDock, m_ui.vertexDataDock);
595 m_ui.surfacesTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
597 m_ui.detailsWebView->page()->setLinkDelegationPolicy(
598 QWebPage::DelegateExternalLinks);
600 m_jumpWidget = new JumpWidget(this);
601 m_ui.centralLayout->addWidget(m_jumpWidget);
602 m_jumpWidget->hide();
604 m_searchWidget = new SearchWidget(this);
605 m_ui.centralLayout->addWidget(m_searchWidget);
606 m_searchWidget->hide();
608 m_traceProcess = new TraceProcess(this);
610 new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_G),
611 this, SLOT(slotGoTo()));
612 new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F),
613 this, SLOT(slotSearch()));
616 void MainWindow::initConnections()
618 connect(m_trace, SIGNAL(startedLoadingTrace()),
619 this, SLOT(startedLoadingTrace()));
620 connect(m_trace, SIGNAL(finishedLoadingTrace()),
621 this, SLOT(finishedLoadingTrace()));
623 connect(m_retracer, SIGNAL(finished(const QString&)),
624 this, SLOT(replayFinished(const QString&)));
625 connect(m_retracer, SIGNAL(error(const QString&)),
626 this, SLOT(replayError(const QString&)));
627 connect(m_retracer, SIGNAL(foundState(const ApiTraceState&)),
628 this, SLOT(replayStateFound(const ApiTraceState&)));
630 connect(m_ui.vertexInterpretButton, SIGNAL(clicked()),
631 m_vdataInterpreter, SLOT(interpretData()));
632 connect(m_ui.vertexTypeCB, SIGNAL(currentIndexChanged(const QString&)),
633 m_vdataInterpreter, SLOT(setTypeFromString(const QString&)));
634 connect(m_ui.vertexStrideSB, SIGNAL(valueChanged(int)),
635 m_vdataInterpreter, SLOT(setStride(int)));
636 connect(m_ui.vertexComponentsSB, SIGNAL(valueChanged(int)),
637 m_vdataInterpreter, SLOT(setComponents(int)));
638 connect(m_ui.startingOffsetSB, SIGNAL(valueChanged(int)),
639 m_vdataInterpreter, SLOT(setStartingOffset(int)));
642 connect(m_ui.actionNew, SIGNAL(triggered()),
643 this, SLOT(createTrace()));
644 connect(m_ui.actionOpen, SIGNAL(triggered()),
645 this, SLOT(openTrace()));
646 connect(m_ui.actionQuit, SIGNAL(triggered()),
647 this, SLOT(close()));
649 connect(m_ui.actionReplay, SIGNAL(triggered()),
650 this, SLOT(replayStart()));
651 connect(m_ui.actionStop, SIGNAL(triggered()),
652 this, SLOT(replayStop()));
653 connect(m_ui.actionLookupState, SIGNAL(triggered()),
654 this, SLOT(lookupState()));
655 connect(m_ui.actionOptions, SIGNAL(triggered()),
656 this, SLOT(showSettings()));
658 connect(m_ui.callView, SIGNAL(activated(const QModelIndex &)),
659 this, SLOT(callItemSelected(const QModelIndex &)));
661 connect(m_ui.surfacesTreeWidget,
662 SIGNAL(customContextMenuRequested(const QPoint &)),
663 SLOT(showSurfacesMenu(const QPoint &)));
664 connect(m_ui.surfacesTreeWidget,
665 SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),
666 SLOT(showSelectedSurface()));
668 connect(m_ui.detailsWebView, SIGNAL(linkClicked(const QUrl&)),
669 this, SLOT(openHelp(const QUrl&)));
671 connect(m_ui.nonDefaultsCB, SIGNAL(toggled(bool)),
672 this, SLOT(fillState(bool)));
674 connect(m_jumpWidget, SIGNAL(jumpTo(int)),
675 SLOT(slotJumpTo(int)));
677 connect(m_searchWidget,
678 SIGNAL(searchNext(const QString&, Qt::CaseSensitivity)),
679 SLOT(slotSearchNext(const QString&, Qt::CaseSensitivity)));
680 connect(m_searchWidget,
681 SIGNAL(searchPrev(const QString&, Qt::CaseSensitivity)),
682 SLOT(slotSearchPrev(const QString&, Qt::CaseSensitivity)));
684 connect(m_traceProcess, SIGNAL(tracedFile(const QString&)),
685 SLOT(createdTrace(const QString&)));
686 connect(m_traceProcess, SIGNAL(error(const QString&)),
687 SLOT(traceError(const QString&)));
690 void MainWindow::replayStateFound(const ApiTraceState &state)
692 m_stateEvent->setState(state);
693 m_model->stateSetOnEvent(m_stateEvent);
694 if (m_selectedEvent == m_stateEvent) {
697 m_ui.stateDock->hide();
701 void MainWindow::slotGoTo()
703 m_searchWidget->hide();
704 m_jumpWidget->show();
707 void MainWindow::slotJumpTo(int callNum)
709 QModelIndex index = m_proxyModel->callIndex(callNum);
710 if (index.isValid()) {
711 m_ui.callView->setCurrentIndex(index);
715 void MainWindow::createdTrace(const QString &path)
717 qDebug()<<"Done tracing "<<path;
721 void MainWindow::traceError(const QString &msg)
723 QMessageBox::warning(
729 void MainWindow::slotSearch()
731 m_jumpWidget->hide();
732 m_searchWidget->show();
735 void MainWindow::slotSearchNext(const QString &str, Qt::CaseSensitivity sensitivity)
737 QModelIndex index = m_ui.callView->currentIndex();
738 ApiTraceEvent *event = 0;
741 if (!index.isValid()) {
742 index = m_proxyModel->index(0, 0, QModelIndex());
743 if (!index.isValid()) {
744 qDebug()<<"no currently valid index";
745 m_searchWidget->setFound(false);
750 event = index.data(ApiTraceModel::EventRole).value<ApiTraceEvent*>();
751 ApiTraceCall *call = 0;
753 if (event->type() == ApiTraceCall::Call)
754 call = static_cast<ApiTraceCall*>(event);
756 Q_ASSERT(event->type() == ApiTraceCall::Frame);
757 ApiTraceFrame *frame = static_cast<ApiTraceFrame*>(event);
758 call = frame->calls.value(0);
762 m_searchWidget->setFound(false);
765 const QList<ApiTraceCall*> &calls = m_trace->calls();
766 int callNum = calls.indexOf(call);
768 for (int i = callNum + 1; i < calls.count(); ++i) {
769 ApiTraceCall *testCall = calls[i];
770 QString txt = testCall->filterText();
771 if (txt.contains(str, sensitivity)) {
772 QModelIndex index = m_proxyModel->indexForCall(testCall);
773 /* if it's not valid it means that the proxy model has already
775 if (index.isValid()) {
776 m_ui.callView->setCurrentIndex(index);
777 m_searchWidget->setFound(true);
782 m_searchWidget->setFound(false);
785 void MainWindow::slotSearchPrev(const QString &str, Qt::CaseSensitivity sensitivity)
787 QModelIndex index = m_ui.callView->currentIndex();
788 ApiTraceEvent *event = 0;
791 if (!index.isValid()) {
792 index = m_proxyModel->index(0, 0, QModelIndex());
793 if (!index.isValid()) {
794 qDebug()<<"no currently valid index";
795 m_searchWidget->setFound(false);
800 event = index.data(ApiTraceModel::EventRole).value<ApiTraceEvent*>();
801 ApiTraceCall *call = 0;
803 if (event->type() == ApiTraceCall::Call)
804 call = static_cast<ApiTraceCall*>(event);
806 Q_ASSERT(event->type() == ApiTraceCall::Frame);
807 ApiTraceFrame *frame = static_cast<ApiTraceFrame*>(event);
808 call = frame->calls.value(0);
812 m_searchWidget->setFound(false);
815 const QList<ApiTraceCall*> &calls = m_trace->calls();
816 int callNum = calls.indexOf(call);
818 for (int i = callNum - 1; i >= 0; --i) {
819 ApiTraceCall *testCall = calls[i];
820 QString txt = testCall->filterText();
821 if (txt.contains(str, sensitivity)) {
822 QModelIndex index = m_proxyModel->indexForCall(testCall);
823 /* if it's not valid it means that the proxy model has already
825 if (index.isValid()) {
826 m_ui.callView->setCurrentIndex(index);
827 m_searchWidget->setFound(true);
832 m_searchWidget->setFound(false);
835 void MainWindow::fillState(bool nonDefaults)
838 ApiTraceState defaultState = m_trace->defaultState();
839 if (defaultState.isEmpty()) {
840 m_ui.nonDefaultsCB->blockSignals(true);
841 m_ui.nonDefaultsCB->setChecked(false);
842 m_ui.nonDefaultsCB->blockSignals(false);
843 int ret = QMessageBox::question(
844 this, tr("Empty Default State"),
845 tr("The applcation needs to figure out the "
846 "default state for the current trace. "
847 "This only has to be done once and "
848 "afterwards you will be able to enable "
849 "displaying of non default state for all calls."
850 "\nDo you want to lookup the default state now?"),
851 QMessageBox::Yes | QMessageBox::No);
852 if (ret != QMessageBox::Yes)
854 ApiTraceFrame *firstFrame =
856 ApiTraceEvent *oldSelected = m_selectedEvent;
859 m_selectedEvent = firstFrame;
861 m_selectedEvent = oldSelected;
867 #include "mainwindow.moc"