MCPcopy Create free account
hub / github.com/KDAB/GammaRay / PaintAnalyzerWidget

Method PaintAnalyzerWidget

ui/paintanalyzerwidget.cpp:38–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36using namespace GammaRay;
37
38PaintAnalyzerWidget::PaintAnalyzerWidget(QWidget *parent)
39 : QWidget(parent)
40 , ui(new Ui::PaintAnalyzerWidget)
41 , m_iface(nullptr)
42{
43 ui->setupUi(this);
44 ui->commandView->header()->setObjectName("commandViewHeader");
45 ui->commandView->setItemDelegate(new PropertyEditorDelegate(this));
46 ui->commandView->setStretchLastSection(false);
47 ui->commandView->setDeferredResizeMode(0, QHeaderView::ResizeToContents);
48 ui->commandView->setDeferredResizeMode(1, QHeaderView::Stretch);
49 ui->commandView->setDeferredResizeMode(2, QHeaderView::ResizeToContents);
50
51 ui->argumentView->setItemDelegate(new PropertyEditorDelegate(this));
52 ui->argumentView->header()->setObjectName("argumentViewHeader");
53 ui->stackTraceView->setItemDelegate(new PropertyEditorDelegate(this));
54 ui->stackTraceView->header()->setObjectName("stackTraceViewHeader");
55
56 auto toolbar = new QToolBar;
57 // Our icons are 16x16 and support hidpi, so let force iconSize on every styles
58 toolbar->setIconSize(QSize(16, 16));
59 toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
60 ui->replayContainer->setMenuBar(toolbar);
61
62 foreach (auto action, ui->replayWidget->interactionModeActions()->actions())
63 toolbar->addAction(action);
64 toolbar->addSeparator();
65
66 toolbar->addAction(ui->replayWidget->zoomOutAction());
67 auto zoom = new QComboBox;
68 zoom->setModel(ui->replayWidget->zoomLevelModel());
69 toolbar->addWidget(zoom);
70 toolbar->addAction(ui->replayWidget->zoomInAction());
71 toolbar->addSeparator();
72 toolbar->addAction(ui->actionShowClipArea);
73
74 ui->replayWidget->setSupportedInteractionModes(
75 RemoteViewWidget::ViewInteraction | RemoteViewWidget::Measuring | RemoteViewWidget::ColorPicking);
76
77 ui->paintAnalyzerSplitter->setStretchFactor(0, 1);
78 ui->paintAnalyzerSplitter->setStretchFactor(1, 2);
79
80 connect(zoom, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
81 ui->replayWidget, &RemoteViewWidget::setZoomLevel);
82 connect(ui->replayWidget, &RemoteViewWidget::zoomLevelChanged, zoom, &QComboBox::setCurrentIndex);
83 zoom->setCurrentIndex(ui->replayWidget->zoomLevelIndex());
84
85 ui->actionShowClipArea->setIcon(UIResources::themedIcon(QLatin1String("visualize-clipping.png")));
86 connect(ui->actionShowClipArea, &QAction::toggled, ui->replayWidget, &PaintAnalyzerReplayView::setShowClipArea);
87 ui->actionShowClipArea->setChecked(ui->replayWidget->showClipArea());
88
89 connect(ui->commandView, &QWidget::customContextMenuRequested, this, &PaintAnalyzerWidget::commandContextMenu);
90 connect(ui->stackTraceView, &QWidget::customContextMenuRequested, this, &PaintAnalyzerWidget::stackTraceContextMenu);
91}
92
93PaintAnalyzerWidget::~PaintAnalyzerWidget() = default;
94

Callers

nothing calls this directly

Calls 11

QSizeClass · 0.85
setStretchLastSectionMethod · 0.80
setDeferredResizeModeMethod · 0.80
zoomOutActionMethod · 0.80
zoomLevelModelMethod · 0.80
zoomInActionMethod · 0.80
setCurrentIndexMethod · 0.80
zoomLevelIndexMethod · 0.80
showClipAreaMethod · 0.80
setModelMethod · 0.45

Tested by

no test coverage detected