#include "header.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "logindialog.h"
#include "borrowdialog.h"
#include "newbookdialog.h"
#include "bookmanagedialog.h"
#include"dialogfine.h"
#include <QDesktopWidget>
//外部使用的变量
extern User current_user;
QString temp_picsrc;
extern QDate last_date;
extern QString manager_code;
extern QString logfile_name;
extern QString theme;
extern int time_length;
extern int seqinday;
/**
* @brief 构造函数
* @param date 当前日期
*/
MainWindow::MainWindow(QDate date, QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
current_date = date;
ui->setupUi(this);
this->setWindowFlags(Qt::FramelessWindowHint);
ui->stackedWidget_function->setCurrentIndex(0);//默认现实借阅信息模块
ui->tab_condition->setCurrentIndex(0);
ui->label_date->setText("当前系统时间为:"+ QString::number(last_date.daysInYear(),10) +"年 "+QString::number(last_date.month(),10) + "月 "+QString::number(last_date.day(),10)+"日");
QDesktopWidget* desktop = QApplication::desktop(); //
move((desktop->width() - this->width())/2, (desktop->height() - this->height())/2);
/**
*顶部信息展示栏
*/
if (current_user.get_picsrc() != "")
{
QPixmap pix(current_user.get_picsrc());
ui->label_pic->setPixmap(pix);
ui->label_pic->setScaledContents(true);
ui->label_pic->show();
}
ui->label_user->setText(current_user.get_username());
ui->label_credit->setText(QString::number(current_user.get_credit()));
ui->label_gender->setText(current_user.gender);
ui->label_number->setText(current_user.number);
ui->label_identify->setText(current_user.get_identity());
ui->label_class->setText(current_user.apartment);
//更改对应的标签
if (current_user.get_identity() != "学生"){
ui->label_apartment_head->setText("部门");
ui->label_num_head->setText("工号");
}
//功能按钮部分
if (current_user.get_identity() == "学生")
{
ui->Button_bookmanage->setDisabled(true);
ui->Button_newbook->setDisabled(true);//管理员功能不可用
}
/***************借阅图书信息展示模块***************/
ui->borrowed_list->clear();
ui->borrowed_list->setColumnCount(4);
QStringList borrowlist_header;
borrowlist_header << "编号" << "标题" << "应还日期" << "操作";
ui->borrowed_list->setHorizontalHeaderLabels(borrowlist_header);//设置表头
ui->borrowed_list->horizontalHeader()->setStyleSheet("QHeaderView::section{background:#c4e2fc}");
ui->borrowed_list->horizontalHeader()->setHighlightSections(false);
ui->borrowed_list->verticalHeader()->setVisible(false);
//设置每个列的参数
ui->borrowed_list->setColumnWidth(0, 130);
ui->borrowed_list->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Interactive);
ui->borrowed_list->setColumnWidth(1, 160);
ui->borrowed_list->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Interactive);
ui->borrowed_list->setColumnWidth(2, 140);
ui->borrowed_list->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Interactive);
ui->borrowed_list->setColumnWidth(3, 130);
ui->borrowed_list->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Interactive);
ui->borrowed_list->horizontalHeader()->setStretchLastSection(true);
ui->borrowed_list->setSelectionBehavior(QAbstractItemView::SelectRows);
//填充借阅数据
QList<BorrowRecord> borrow_record_current = current_user.getBorrowRecord();
int borrow_row_count = borrow_record_current.size();
if (borrow_row_count != 0)
{
ui->borrowed_list->setRowCount(borrow_row_count);
for (int i = 0; i < borrow_row_count; i++)
{
//col 0 : specific index
QTableWidgetItem * item_spec_index = new QTableWidgetItem();
item_spec_index->setText(borrow_record_current[i].get_spec_index());
item_spec_index->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
ui->borrowed_list->setItem(i, 0, item_spec_index);
//col 1 : title
QTableWidgetItem * item_title = new QTableWidgetItem();
QString title = borrow_record_current[i].get_bookfile_name().split("#")[1];
item_title->setText(title);
item_title->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
ui->borrowed_list->setItem(i, 1, item_title);
//col 2 : return date
QDate return_date = QDate::fromString(borrow_record_current[i].get_return_date(), "yyyy MM dd");
qDebug()<<return_date;
QString return_date_text = return_date.toString("yyyy/MM/dd");
QTableWidgetItem * item_return_date = new QTableWidgetItem();
item_return_date->setText(return_date_text);
item_return_date->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
ui->borrowed_list->setItem(i, 2, item_return_date);
//col 3 : operations
QTableWidgetItem * item_operation = new QTableWidgetItem();
item_operation->setText("还书");
QFont font = item_operation->font();
font.setUnderline(true);
item_operation->setFont(font);
item_operation->setTextColor(Qt::blue);
item_operation->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
ui->borrowed_list->setItem(i, 3, item_operation);
}
}
/*************图书预定管理模块*************/
ui->ordered_list->clear();
ui->ordered_list->setColumnCount(4);
QStringList orderlist_header;
orderlist_header << "编号" << "标题" << "可借时间" << "操作";
ui->ordered_list->setHorizontalHeaderLabels(orderlist_header);
ui->ordered_list->horizontalHeader()->setStyleSheet("QHeaderView::section{background:#c4e2fc}");
ui->ordered_list->horizontalHeader()->setHighlightSections(false);
ui->ordered_list->verticalHeader()->setVisible(false);
//列设置
ui->ordered_list->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Interactive);
ui->ordered_list->setColumnWidth(0, 161);
ui->ordered_list->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Interactive);
ui->ordered_list->setColumnWidth(1, 161);
ui->ordered_list->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Interactive);
ui->ordered_list->setColumnWidth(2, 161);
ui->ordered_list->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Interactive);
ui->ordered_list->setColumnWidth(3, 161);
ui->ordered_list->horizontalHeader()->setStretchLastSection(true);
ui->ordered_list->setSelectionBehavior(QAbstractItemView::SelectRows);
//载入预定数据
QList<OrderRecord> order_record_current = current_user.getOrderRecord();
int order_row_count = order_record_current.size();
if (order_row_count != 0)
{
ui->ordered_list->setRowCount(order_row_count);
for (int i = 0; i < order_row_count; ++i)
{
//col 0 : specific index
QString spec_index;
QTableWidgetItem * item_spec_index = new QTableWidgetItem();
spec_index = order_record_current[i].get_spec_index();
item_spec_index->setText(spec_index);
item_spec_index->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
ui->ordered_list->setItem(i, 0, item_spec_index);
//col 1 : title
QTableWidgetItem * item_title = new QTableWidgetItem();
QString title = order_record_current[i].get_bookfile_name().split("#")[1];
item_title->setText(title);
item_title->setTextAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
ui->ordered_list->setItem(i, 1, item_title);
//col 2 : available date & col 3 : operations
QDate available_date = QDate::fromStri
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 1、该资源包括项目的全部源码,下载可以直接使用! 2、本项目适合作为计算机、数学、电子信息等专业的课程设计、期末大作业和毕设项目,作为参考资料学习借鉴。 3、本资源作为“参考资料”如果需要实现其他功能,需要能看懂代码,并且热爱钻研,自行调试。 基于C++的图书管理系统源码+项目说明(高分课设).zip
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 99 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/5f1f13827a6b4d429d03fbd9927aeaaf_baidu_33164415.jpg!1)
土豆片片
- 粉丝: 1573
- 资源: 5636
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- CnWizards delphi插件 变量高亮 delphi工具
- 用K210进行垃圾识别,通过串口发送不同信号给stm32,控制步进电机进行分类,并且语音播报.zip
- 基于Matlab 实现单径瑞利信道下,交织与卷积编码对误码率影响仿真
- 基于PCL的平面点云格网可视化程序代码
- DataSphereStudio是一个一站式数据应用程序开发和管理门户,涵盖数据交换、脱敏/清理、分析/挖掘、质量测量、可视化等
- python对mysql的操作
- 基于python opencv实现的图像上色源码+项目说明.7z
- 智能车相关外设模块,包含寻迹传感器、编码器、电机驱动、舵机、TFT彩屏、按键、蜂鸣器、无线通讯八个模块
- 可以使用的jdk8 离线镜像安装
- HBase总结.xmind
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)