You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.5 KiB
60 lines
1.5 KiB
|
3 years ago
|
#include "trendswidget.h"
|
||
|
|
#include "ui_trendswidget.h"
|
||
|
|
#include <QDebug>
|
||
|
|
|
||
|
|
TrendsWidget::TrendsWidget(QWidget *parent) :
|
||
|
|
QWidget(parent),
|
||
|
|
ui(new Ui::TrendsWidget)
|
||
|
|
{
|
||
|
|
ui->setupUi(this);
|
||
|
|
m_UserData.SetManagerType(ManagerType::Ruoyi);
|
||
|
|
model = new QStandardItemModel;
|
||
|
|
ui->tableView->setModel(model);
|
||
|
|
}
|
||
|
|
|
||
|
|
TrendsWidget::~TrendsWidget()
|
||
|
|
{
|
||
|
|
delete ui;
|
||
|
|
}
|
||
|
|
|
||
|
|
void TrendsWidget::SetUserData()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void TrendsWidget::SetUserInfo(UserInfo user)
|
||
|
|
{
|
||
|
|
m_UserInfo = user;
|
||
|
|
}
|
||
|
|
|
||
|
|
void TrendsWidget::LoadTrendsData()
|
||
|
|
{
|
||
|
|
// QList<QList<QString> > trends = m_UserData.GetTrends(QDate(),m_UserInfo.token);
|
||
|
|
// int rowCount = trends.count();
|
||
|
|
// int columnCount = 0;
|
||
|
|
// //更新到tableview中
|
||
|
|
// if(rowCount > 2)
|
||
|
|
// {
|
||
|
|
// model->insertRow(0);
|
||
|
|
// QList<QString> columns = trends[0];
|
||
|
|
// columnCount = columns.count();
|
||
|
|
// for (int column = 0; column < columnCount; ++column) {
|
||
|
|
// QStandardItem *item = new QStandardItem(columns[column]);
|
||
|
|
// model->setItem(0, column, item);
|
||
|
|
// }
|
||
|
|
// }
|
||
|
|
// rowCount = trends[1].count();
|
||
|
|
// QList<QString> row1List = trends[1];
|
||
|
|
// qDebug() << __FUNCTION__ << trends[1];
|
||
|
|
// for(int row = 1 ; row < rowCount; row++)
|
||
|
|
// {
|
||
|
|
// model->insertRow(row);
|
||
|
|
// for(int col = 0; col < columnCount; col++)
|
||
|
|
// {
|
||
|
|
// qDebug() << __FUNCTION__ << trends[row][col];
|
||
|
|
// QStandardItem *item = new QStandardItem(trends[row][col]);
|
||
|
|
// model->setItem(col, row, item);
|
||
|
|
// }
|
||
|
|
// }
|
||
|
|
}
|