1
1
#include " diffviewwidget.h"
2
2
3
3
#include < QAction>
4
+ #include < QDoubleSpinBox>
4
5
#include < QLabel>
5
6
#include < QMenu>
6
7
#include < QProgressBar>
7
8
8
9
#include < kddockwidgets/DockWidget.h>
9
10
#include < kddockwidgets/MainWindow.h>
10
11
12
+ #include " diffviewproxy.h"
11
13
#include " dockwidgetsetup.h"
12
14
#include " filterandzoomstack.h"
13
15
#include " models/treemodel.h"
@@ -31,11 +33,13 @@ DiffViewWidget::DiffViewWidget(QWidget* parent)
31
33
, m_timelineA(new TimeLineWidget(m_parserA, m_filterMenu, m_filterAndZoomStackA, this ))
32
34
, m_timelineB(new TimeLineWidget(m_parserB, m_filterMenu, m_filterAndZoomStackB, this ))
33
35
{
36
+ auto diffProxy = new DiffViewProxy (this );
37
+ diffProxy->setSourceModel (m_model);
38
+
34
39
ui->setupUi (this );
35
- ui->diffTreeView ->setModel (m_model);
36
- ui->bottomUpVerticalLayout ->addWidget (m_contents);
37
40
38
- ResultsUtil::setupTreeView (ui->diffTreeView , ui->diffSearch , m_model);
41
+ ResultsUtil::setupTreeView (ui->diffTreeView , ui->diffSearch , diffProxy, DiffViewModel::InitialSortColumn,
42
+ DiffViewModel::SortRole);
39
43
ResultsUtil::setupCostDelegate<DiffViewModel>(m_model, ui->diffTreeView );
40
44
41
45
auto dockify = [](QWidget* widget, const QString& id, const QString& title, const QString& shortcut) {
@@ -51,6 +55,20 @@ DiffViewWidget::DiffViewWidget(QWidget* parent)
51
55
m_timelineDockB = dockify (m_timelineB, QStringLiteral (" timelineb" ), tr (" Timeline B" ), tr (" Ctrl+B" ));
52
56
m_timelineDockA->addDockWidgetAsTab (m_timelineDockB);
53
57
58
+ auto costThreshold = new QDoubleSpinBox (this );
59
+ costThreshold->setDecimals (2 );
60
+ costThreshold->setMinimum (0 );
61
+ costThreshold->setMaximum (99.90 );
62
+ costThreshold->setPrefix (tr (" Cost Threshold: " ));
63
+ costThreshold->setSuffix (QStringLiteral (" %" ));
64
+ costThreshold->setValue (0.01 );
65
+ costThreshold->setSingleStep (0.01 );
66
+ connect (costThreshold, static_cast <void (QDoubleSpinBox::*)(double )>(&QDoubleSpinBox::valueChanged), this ,
67
+ [diffProxy](double threshold) { diffProxy->setThreshhold (threshold); });
68
+
69
+ ui->bottomUpVerticalLayout ->addWidget (costThreshold);
70
+ ui->bottomUpVerticalLayout ->addWidget (m_contents);
71
+
54
72
auto repositionFilterBusyIndicator = [this ] {
55
73
auto geometry = m_filterBusyIndicator->geometry ();
56
74
geometry.setWidth (width () / 2 );
0 commit comments