| 67 | }; |
| 68 | |
| 69 | ProfileDialog::ProfileDialog(QWidget *parent) |
| 70 | : QDialog(parent), |
| 71 | m_profile(0) |
| 72 | { |
| 73 | setupUi(this); |
| 74 | g_profileDialog = this; |
| 75 | |
| 76 | /* Gradients for call duration histograms */ |
| 77 | QLinearGradient cpuGradient; |
| 78 | cpuGradient.setColorAt(0.9, QColor(0, 0, 210)); |
| 79 | cpuGradient.setColorAt(0.0, QColor(130, 130, 255)); |
| 80 | |
| 81 | QLinearGradient gpuGradient; |
| 82 | gpuGradient.setColorAt(0.9, QColor(210, 0, 0)); |
| 83 | gpuGradient.setColorAt(0.0, QColor(255, 130, 130)); |
| 84 | |
| 85 | |
| 86 | /* Setup heatmap timeline */ |
| 87 | m_timeline->setLabel(new GraphLabelWidget("Frames ", m_timeline)); |
| 88 | m_timeline->label()->setFlags(Qt::AlignVCenter | Qt::AlignRight); |
| 89 | |
| 90 | m_timeline->setView(new HeatmapView(m_timeline)); |
| 91 | |
| 92 | m_timeline->setAxis(GraphWidget::AxisTop, new FrameAxisWidget(m_timeline)); |
| 93 | m_timeline->setAxis(GraphWidget::AxisLeft, new HeatmapVerticalAxisWidget(m_timeline)); |
| 94 | m_timeline->axis(GraphWidget::AxisLeft)->resize(80, 0); |
| 95 | |
| 96 | m_timeline->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
| 97 | m_timeline->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); |
| 98 | |
| 99 | |
| 100 | /* Setup Cpu call duration histogram */ |
| 101 | m_cpuGraph->setLabel(new GraphLabelWidget("CPU", m_cpuGraph)); |
| 102 | |
| 103 | m_cpuGraph->setAxis(GraphWidget::AxisTop, new FrameAxisWidget(m_cpuGraph)); |
| 104 | m_cpuGraph->setAxis(GraphWidget::AxisLeft, new TimeAxisWidget(m_cpuGraph)); |
| 105 | m_cpuGraph->axis(GraphWidget::AxisLeft)->resize(80, 0); |
| 106 | |
| 107 | HistogramView* cpuView = new HistogramView(m_cpuGraph); |
| 108 | cpuView->setSelectedGradient(cpuGradient); |
| 109 | m_cpuGraph->setView(cpuView); |
| 110 | |
| 111 | |
| 112 | /* Setup Gpu call duration histogram */ |
| 113 | m_gpuGraph->setLabel(new GraphLabelWidget("GPU", m_gpuGraph)); |
| 114 | |
| 115 | m_gpuGraph->setAxis(GraphWidget::AxisTop, new FrameAxisWidget(m_gpuGraph)); |
| 116 | m_gpuGraph->setAxis(GraphWidget::AxisLeft, new TimeAxisWidget(m_gpuGraph)); |
| 117 | m_gpuGraph->axis(GraphWidget::AxisLeft)->resize(80, 0); |
| 118 | |
| 119 | HistogramView* gpuView = new HistogramView(m_gpuGraph); |
| 120 | gpuView->setSelectedGradient(gpuGradient); |
| 121 | m_gpuGraph->setView(gpuView); |
| 122 | |
| 123 | |
| 124 | /* Synchronise selections */ |
| 125 | connect(m_timeline, SIGNAL(selectionChanged(SelectionState)), m_cpuGraph, SLOT(setSelection(SelectionState))); |
| 126 | connect(m_timeline, SIGNAL(selectionChanged(SelectionState)), m_gpuGraph, SLOT(setSelection(SelectionState))); |
nothing calls this directly
no test coverage detected