mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
refs #303 Simulator table view
* Simulator component * Name / variant pair object / view / model
This commit is contained in:
@@ -19,7 +19,7 @@ namespace BlackGui
|
||||
{
|
||||
CNameVariantPairView::CNameVariantPairView(QWidget *parent) : CViewBase(parent)
|
||||
{
|
||||
this->m_model = new CNameVariantPairModel(this);
|
||||
this->m_model = new CNameVariantPairModel(true, this);
|
||||
this->setModel(this->m_model); // via QTableView
|
||||
this->m_model->setSortColumnByPropertyIndex(BlackMisc::CNameVariantPair::IndexName);
|
||||
if (this->m_model->hasValidSortColumn())
|
||||
@@ -28,5 +28,26 @@ namespace BlackGui
|
||||
this->m_model->getSortOrder());
|
||||
this->horizontalHeader()->setStretchLastSection(true);
|
||||
}
|
||||
|
||||
void CNameVariantPairView::setIconMode(bool withIcon)
|
||||
{
|
||||
Q_ASSERT(this->m_model);
|
||||
this->m_model->setIconMode(withIcon);
|
||||
}
|
||||
|
||||
void CNameVariantPairView::addOrUpdateByName(const QString &name, const QString &value, const CIcon &icon)
|
||||
{
|
||||
Q_ASSERT(this->m_model);
|
||||
this->m_model->addOrUpdateByName(name, value, icon);
|
||||
this->resizeColumnsToContents();
|
||||
this->resizeRowsToContents();
|
||||
}
|
||||
|
||||
void CNameVariantPairView::removeByName(const QString &name)
|
||||
{
|
||||
this->m_model->removeByName(name);
|
||||
this->resizeColumnsToContents();
|
||||
this->resizeRowsToContents();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user