-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved firmware meta data to its own window
- Loading branch information
1 parent
c644431
commit 340f6a3
Showing
10 changed files
with
124 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "firmwaremetadata.h" | ||
|
||
|
||
FirmwareMetaData::FirmwareMetaData(QWidget *parent) : QWidget(parent) | ||
{ | ||
ui.setupUi(this); | ||
ui.tableWidget->setColumnCount(2); | ||
ui.tableWidget->setColumnWidth(0,200); | ||
ui.tableWidget->setColumnWidth(1,400); | ||
ui.tableWidget->horizontalHeader()->hide(); | ||
ui.tableWidget->verticalHeader()->hide(); | ||
|
||
} | ||
|
||
FirmwareMetaData::~FirmwareMetaData() | ||
{ | ||
} | ||
void FirmwareMetaData::setInterrogationData(QMap<QString,QString> datamap) | ||
{ | ||
for (QMap<QString,QString>::const_iterator i=datamap.constBegin();i!=datamap.constEnd();i++) | ||
{ | ||
for (int j=0;j<ui.tableWidget->rowCount();j++) | ||
{ | ||
if (ui.tableWidget->item(j,0)->text() == i.key()) | ||
{ | ||
ui.tableWidget->item(j,1)->setText(i.value()); | ||
return; | ||
} | ||
} | ||
ui.tableWidget->setRowCount(ui.tableWidget->rowCount()+1); | ||
ui.tableWidget->setItem(ui.tableWidget->rowCount()-1,0,new QTableWidgetItem(i.key())); | ||
ui.tableWidget->setItem(ui.tableWidget->rowCount()-1,1,new QTableWidgetItem(i.value())); | ||
} | ||
} | ||
|
||
void FirmwareMetaData::closeEvent(QCloseEvent *event) | ||
{ | ||
event->ignore(); | ||
((QMdiSubWindow*)this->parent())->hide(); | ||
emit windowHiding((QMdiSubWindow*)this->parent()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef FIRMWAREMETADATA_H | ||
#define FIRMWAREMETADATA_H | ||
|
||
#include <QWidget> | ||
#include <QMdiSubWindow> | ||
#include <QCloseEvent> | ||
#include "ui_firmwaremetadata.h" | ||
|
||
|
||
class FirmwareMetaData : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit FirmwareMetaData(QWidget *parent = 0); | ||
~FirmwareMetaData(); | ||
void setInterrogationData(QMap<QString,QString> datamap); | ||
protected: | ||
void closeEvent(QCloseEvent *event); | ||
private: | ||
Ui::FirmwareMetaData ui; | ||
signals: | ||
void windowHiding(QMdiSubWindow *parent); | ||
}; | ||
|
||
#endif // FIRMWAREMETADATA_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>FirmwareMetaData</class> | ||
<widget class="QWidget" name="FirmwareMetaData"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>712</width> | ||
<height>331</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Firmware Metadata</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QTableWidget" name="tableWidget"/> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters