dev commit

pull/2/head
wh201906 5 years ago
parent 164656a7bc
commit d651d2788d

@ -14,6 +14,36 @@ MainWindow::MainWindow(QWidget *parent)
{ {
ui->portBox->addItem(port); ui->portBox->addItem(port);
} }
dataModel=new QStandardItemModel;
dataModel->setColumnCount(3);
dataModel->setRowCount(64);
dataModel->setHorizontalHeaderItem(0,new QStandardItem("Sector"));
dataModel->setHorizontalHeaderItem(1,new QStandardItem("Block"));
dataModel->setHorizontalHeaderItem(2,new QStandardItem("Data"));
for(int i=0;i<64;i++)
dataModel->setItem(i,1,new QStandardItem(QString::number(i)));
for(int i=0;i<16;i++)
dataModel->setItem(i*4,0,new QStandardItem(QString::number(i)));
ui->dataView->setModel(dataModel);
ui->dataView->verticalHeader()->setVisible(false);
ui->dataView->setColumnWidth(0,50);
ui->dataView->setColumnWidth(1,40);
ui->dataView->setColumnWidth(2,400);
keyModel=new QStandardItemModel;
keyModel->setColumnCount(3);
keyModel->setRowCount(16);
keyModel->setHorizontalHeaderItem(0,new QStandardItem("Sector"));
keyModel->setHorizontalHeaderItem(1,new QStandardItem("KeyA"));
keyModel->setHorizontalHeaderItem(2,new QStandardItem("KeyB"));
for(int i=0;i<16;i++)
keyModel->setItem(i,0,new QStandardItem(QString::number(i)));
ui->keyView->setModel(keyModel);
ui->keyView->verticalHeader()->setVisible(false);
ui->keyView->setColumnWidth(0,50);
ui->keyView->setColumnWidth(1,200);
ui->keyView->setColumnWidth(2,200);
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()

@ -5,6 +5,7 @@
#include <QProcess> #include <QProcess>
#include <QDebug> #include <QDebug>
#include <QMessageBox> #include <QMessageBox>
#include <QStandardItemModel>
#include "pm3process.h" #include "pm3process.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -34,5 +35,7 @@ private slots:
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
PM3Process* pm3; PM3Process* pm3;
QStandardItemModel* dataModel;
QStandardItemModel* keyModel;
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>450</width> <width>1038</width>
<height>310</height> <height>758</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
@ -74,13 +74,51 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="mifareTab">
<attribute name="title"> <attribute name="title">
<string>Tab 1</string> <string>Mifare</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QTableView" name="dataView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="verticalHeaderMinimumSectionSize">
<number>20</number>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>20</number>
</attribute>
</widget>
</item>
<item>
<widget class="QTableView" name="keyView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="verticalHeaderMinimumSectionSize">
<number>20</number>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>20</number>
</attribute> </attribute>
</widget> </widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="rawTab"> <widget class="QWidget" name="rawTab">
<attribute name="title"> <attribute name="title">
<string>RawCommand</string> <string>RawCommand</string>
@ -134,7 +172,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>450</width> <width>1038</width>
<height>22</height> <height>22</height>
</rect> </rect>
</property> </property>

Loading…
Cancel
Save