parent
1edf66f10e
commit
eb675bf030
@ -0,0 +1,59 @@
|
|||||||
|
#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);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
#ifndef TRENDSWIDGET_H
|
||||||
|
#define TRENDSWIDGET_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include "userdata.h"
|
||||||
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class TrendsWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
class TrendsWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit TrendsWidget(QWidget *parent = nullptr);
|
||||||
|
~TrendsWidget();
|
||||||
|
//临时使用,后续需要重新创建
|
||||||
|
void SetUserData();
|
||||||
|
void SetUserInfo(UserInfo user);
|
||||||
|
void LoadTrendsData();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::TrendsWidget *ui;
|
||||||
|
UserData m_UserData;
|
||||||
|
UserInfo m_UserInfo;
|
||||||
|
QStandardItemModel* model;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TRENDSWIDGET_H
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>TrendsWidget</class>
|
||||||
|
<widget class="QWidget" name="TrendsWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>983</width>
|
||||||
|
<height>647</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTableView" name="tableView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Loading…
Reference in new issue