mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refs #303 Simulator table view
* Simulator component * Name / variant pair object / view / model
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "simulatorcomponent.h"
|
||||
#include "ui_simulatorcomponent.h"
|
||||
#include "blackmisc/iconlist.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -18,11 +19,33 @@ namespace BlackGui
|
||||
QTabWidget(parent), ui(new Ui::CSimulatorComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->ui->tvp_LiveData->setIconMode(true);
|
||||
this->addOrUpdateByName("info", "no data yet", CIcons::StandardIconWarning16);
|
||||
}
|
||||
|
||||
CSimulatorComponent::~CSimulatorComponent()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void CSimulatorComponent::addOrUpdateByName(const QString &name, const QString &value, const CIcon &icon)
|
||||
{
|
||||
this->ui->tvp_LiveData->addOrUpdateByName(name, value, icon);
|
||||
}
|
||||
|
||||
void CSimulatorComponent::addOrUpdateByName(const QString &name, const QString &value, CIcons::IconIndexes iconIndex)
|
||||
{
|
||||
this->addOrUpdateByName(name, value, CIconList::iconForIndex(iconIndex));
|
||||
}
|
||||
|
||||
int CSimulatorComponent::rowCount() const
|
||||
{
|
||||
return this->ui->tvp_LiveData->rowCount();
|
||||
}
|
||||
|
||||
void CSimulatorComponent::clear()
|
||||
{
|
||||
this->ui->tvp_LiveData->clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define BLACKGUI_SIMULATORCOMPONENT_H
|
||||
|
||||
#include "runtimebasedcomponent.h"
|
||||
#include "blackmisc/icon.h"
|
||||
#include <QTabWidget>
|
||||
|
||||
namespace Ui { class CSimulatorComponent; }
|
||||
@@ -34,6 +35,18 @@ namespace BlackGui
|
||||
//! Destructor
|
||||
~CSimulatorComponent();
|
||||
|
||||
//! Simple add or update name / value pair
|
||||
void addOrUpdateByName(const QString &name, const QString &value, const BlackMisc::CIcon &icon);
|
||||
|
||||
//! Simple add or update name / value pair
|
||||
void addOrUpdateByName(const QString &name, const QString &value, BlackMisc::CIcons::IconIndexes iconIndex);
|
||||
|
||||
//! Number of entries
|
||||
int rowCount() const;
|
||||
|
||||
//! Clear
|
||||
void clear();
|
||||
|
||||
private:
|
||||
Ui::CSimulatorComponent *ui;
|
||||
};
|
||||
|
||||
@@ -37,7 +37,11 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Views::CNameVariantPairView" name="tvp_LiveData"/>
|
||||
<widget class="BlackGui::Views::CNameVariantPairView" name="tvp_LiveData">
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user