2025-03-24 18:13:06 +08:00
|
|
|
#include "attributeView.h"
|
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
2025-03-25 17:58:48 +08:00
|
|
|
AttributeView::AttributeView(const ModelAttributeGroup& modelAttributeGroup, QWidget* parent, const QString& connection, const QString& tableName)
|
2025-03-24 18:13:06 +08:00
|
|
|
: QWidget(parent)
|
|
|
|
|
, m_connection(connection)
|
|
|
|
|
, m_attributeTable(tableName)
|
2025-03-25 17:58:48 +08:00
|
|
|
, m_modelAttributeGroup(modelAttributeGroup)
|
2025-03-24 18:13:06 +08:00
|
|
|
{
|
|
|
|
|
m_tableView = new QTableView(this);
|
2025-03-25 17:58:48 +08:00
|
|
|
m_attributeTableModel = new AttributeTableModel(m_modelAttributeGroup, this, m_connection, m_attributeTable);
|
2025-03-24 18:13:06 +08:00
|
|
|
m_tableView->setModel(m_attributeTableModel);
|
|
|
|
|
|
|
|
|
|
m_vLayout = new QVBoxLayout(this);
|
|
|
|
|
m_vLayout->setSpacing(0);
|
|
|
|
|
m_vLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
|
|
m_vLayout->addWidget(m_tableView);
|
|
|
|
|
this->setLayout(m_vLayout);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AttributeView::~AttributeView()
|
|
|
|
|
{}
|
2025-03-25 17:58:48 +08:00
|
|
|
|
|
|
|
|
void AttributeView::active()
|
|
|
|
|
{
|
2025-03-25 20:53:15 +08:00
|
|
|
m_attributeTableModel->triggerSyncSignal();
|
2025-03-25 17:58:48 +08:00
|
|
|
}
|