-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
83 lines (64 loc) · 2.17 KB
/
Copy pathmainwindow.cpp
File metadata and controls
83 lines (64 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include "mtkscatter.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->partitionsTree->setColumnCount(3);
ui->partitionsTree->setHeaderLabels(QStringList() << "Partition" << "Key" << "Value" );
MTKScatter scatter;
Q_ASSERT(scatter.loadFromFile("/home/rush/opt/Hammer/MP_mt6732_m316b_blueplus_nyx_cc_128-16_kk_lte_3m-fdd-cs_mul_sw_20150530-133115_songlixin_PC/MT6752_Android_scatter.txt"));
foreach(MTKPartition::Pointer partition, scatter.partitions) {
if (!partition) continue;
QTreeWidgetItem* node = new QTreeWidgetItem(ui->partitionsTree, QStringList(partition->partition_name()));
ui->partitionsTree->addTopLevelItem(node);
foreach(QByteArray key, partition->dynamicPropertyNames()) {
QTreeWidgetItem* pair = new QTreeWidgetItem(node, QStringList() << "" << QString(key) << partition->property(key.data()).toString() );
}
//QTreeWidgetItem* pair = new QTreeWidgetItem(node, QStringList() << );
}
}
MainWindow::~MainWindow()
{
delete ui;
}
/*
ScatterModel::ScatterModel(QObject *parent) :
QAbstractItemModel(parent)
{
QHash<int, QByteArray> roles;
roles[NameRole] = "name";
roles[SizeRole] = "size";
setRoleNames(roles);
}
QModelIndex ScatterModel::index(int row, int column, const QModelIndex &parent) const
{
return QModelIndex();
}
QModelIndex ScatterModel::parent(const QModelIndex &child) const
{
return QModelIndex();
}
int ScatterModel::rowCount(const QModelIndex &parent) const
{
return 1;
}
int ScatterModel::columnCount(const QModelIndex &parent) const
{
return 2;
}
QVariant ScatterModel::data(const QModelIndex &index, int role) const
{
return QVariant();
}
bool ScatterModel::loadFromFile(const QString &filename)
{
bool result = false;
if (scatter.loadFromFile("/home/rush/opt/Hammer/MP_mt6732_m316b_blueplus_nyx_cc_128-16_kk_lte_3m-fdd-cs_mul_sw_20150530-133115_songlixin_PC/MT6752_Android_scatter.txt")) {
//emit dataChanged( QModelIndex(0, 0, this), QModelIndex(0, 0, this));
}
return result;
}
*/