MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / slotLoad

Method slotLoad

App/Client/FrmActive.cpp:198–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void CFrmActive::slotLoad()
199{
200 if(!m_pModel)
201 return;
202 m_pModel->removeRows(0, m_pModel->rowCount());
203 m_pAddToFavorite->setEnabled(m_Operates.size() > 0);
204 foreach(auto c, m_Operates) {
205 QList<QStandardItem*> lstItem;
206 QStandardItem* pName = new QStandardItem(c->Icon(), c->Name());
207 pName->setToolTip(c->Description());
208 lstItem << pName;
209 QStandardItem* pProtocol = new QStandardItem(c->Protocol());
210 lstItem << pProtocol;
211 QStandardItem* pType = new QStandardItem(c->GetTypeName());
212 lstItem << pType;
213 QStandardItem* pId = new QStandardItem(c->Id());
214 QVariant v;
215 v.setValue(c);
216 pId->setData(v);
217 lstItem << pId;
218 m_pModel->appendRow(lstItem);
219 }
220
221 //以下设置列宽函数必须要数据加载完成后使用,才能应用
222 //See: https://blog.csdn.net/qq_40450386/article/details/86083759
223 //m_pTableView->resizeColumnsToContents(); //设置所有列宽度自适应内容
224 m_pTableView->resizeColumnToContents(0); //设置第0列宽度自适应内容
225 //m_pTableView->resizeColumnToContents(m_nId); //设置第1列宽度自适应内容
226}
227
228void CFrmActive::slotViewChanged(const QWidget *pView)
229{

Callers 3

StartMethod · 0.80
foreachFunction · 0.80
slotUpdateNameMethod · 0.80

Calls 2

removeRowsMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected