-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmainwindow5.cpp
More file actions
72 lines (61 loc) · 1.8 KB
/
mainwindow5.cpp
File metadata and controls
72 lines (61 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "mainwindow5.h"
#include "ui_mainwindow5.h"
#include "mainwindow2.h"
#include "mainwindow.h"
#include "QMessageBox"
MainWindow5::MainWindow5(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow5)
{
ui->setupUi(this);
QIcon icon("C:/Users/12234/Desktop/s.jpg");
setWindowIcon(icon);
setWindowTitle(QStringLiteral("家电信息管理系统"));
// ui->listView->setTextColor(Qt::red);
QStringList theStrList;
QString fp="C:/Users/12234/Documents/01/sum_info/";
fp=fp+now_username+"/fix_goods_info.txt";
QFile f(fp);
if(!f.open(QIODevice::ReadOnly | QIODevice::Text))
{
//qDebug()<<fp;
QMessageBox::about(NULL, "提示", "文件异常");
return;
}
while (!f.atEnd())
{
QStringList list;
QByteArray line = f.readLine();
QString s(line);
QList<QString>lst;
lst.clear();
lst =s.split(',');
//QString a="sssss";
QString name=lst[0];
QString goods_num=lst[1];
QString fix_data = lst[2];
QString money = lst[3];
theStrList<<"待处理: 姓名:"+name+" 订单编号:"+goods_num+" 维修日期:"+fix_data+" 预估费用"+money<<"\r\n";
}
theModel=new QStringListModel(this);
theModel->setStringList(theStrList);
ui->listView->setModel(theModel);
ui->listView->setEditTriggers(QAbstractItemView::DoubleClicked|QAbstractItemView::SelectedClicked);
}
MainWindow5::~MainWindow5()
{
delete ui;
}
void MainWindow5::on_pushButton_clicked()
{
w4.show();
this->hide();
}
void MainWindow5::ask_result()
{
}
void MainWindow5::on_pushButton_2_clicked()
{
(new MainWindow2())->show();
this->hide();
}