#include "transmitdetailwidget.h"
#include "ui_transmitdetailwidget.h"
#include "FrameLessHelper/frame_less_helper.h"
TransmitDetailWidget::TransmitDetailWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::TransmitDetailWidget)
{
ui->setupUi(this);
FrameLessHelper *pHelper = new FrameLessHelper(this);
pHelper->activate_on(this); //激活当前窗体
pHelper->set_title_height(20); //设置窗体的标题栏高度
pHelper->set_widget_movable(true); //设置窗体可移动
pHelper->set_widget_resizable(true); //设置窗体可缩放
pHelper->set_rubber_band_on_move(false); //设置橡皮筋效果-可移动
pHelper->set_rubber_band_on_resize(false); //设置橡皮筋效果-可缩放
init_layout();
init_window_style();
init_models();
test_view_data();
}
TransmitDetailWidget::~TransmitDetailWidget()
{
m_history_speed_curve->deleteLater();
delete ui;
}
void TransmitDetailWidget::init_window_style()
{
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint);
this->setMouseTracking(true);
return;
}
void TransmitDetailWidget::init_layout()
{
this->layout()->setSpacing(0);
this->layout()->setMargin(0);
ui->widget->layout()->setMargin(5);
ui->widget->layout()->setSpacing(0);
ui->widget_2->layout()->setMargin(0);
ui->widget_2->layout()->setSpacing(0);
m_corner_widget = new QWidget();
m_corner_widget_layout = new QHBoxLayout();
m_close_pushButton = new QPushButton();
m_close_pushButton->setFixedSize(14, 14);
m_show_detail_pushButton = new QPushButton();
m_show_detail_pushButton->setFixedSize(14, 14);
m_corner_widget_layout->addWidget(m_show_detail_pushButton);
QWidget *spacing_widget = new QWidget();
spacing_widget->setFixedSize(10,35);
m_corner_widget_layout->addWidget(spacing_widget);
m_corner_widget_layout->addWidget(m_close_pushButton);
m_corner_widget_layout->setMargin(0);
m_corner_widget_layout->setSpacing(0);
m_corner_widget->setLayout(m_corner_widget_layout);
ui->tabWidget->setCornerWidget(m_corner_widget, Qt::TopRightCorner);
ui->tabWidget->setTabText(0, tr("完成"));
ui->tabWidget->setTabText(1, tr("失败"));
ui->tabWidget->setStyleSheet("QTabBar::tab \
{\
min-width: 170px;\
font-family: 'microsoft YaHei';\
font-size: 14px;\
min-height: 30px;\
margin: 0px;\
border-style:none;\
}"
"QTabBar::tab:selected, QTabBar::tab:hover {\
border-style:none none solid none;\
border-width: 0px 0px 5px 2px;\
border-color:#e6e6e6 #e6e6e6 #66ccff #e6e6e6;\
}"
"QTabBar{border-style:none;}"
"QTabWidget{border-style:none;}"
"QTabWidget::pane {border: none;}"
);
ui->tab->layout()->setMargin(0);
ui->tab->layout()->setSpacing(0);
connect(m_close_pushButton, SIGNAL(clicked()), this, SLOT(close_pushButton_clicked_slot()));
m_history_speed_curve = new HistorySpeedCurve();
m_history_speed_curve->hide_window();
connect(m_show_detail_pushButton, SIGNAL(clicked()), m_history_speed_curve, SLOT(show_window()));
m_close_pushButton->setStyleSheet("QPushButton:hover{border-image:url(:/btn_close_hover.png);}"
"QPushButton{border-image: url(:/btn_close.png);}");
m_show_detail_pushButton->setStyleSheet("QPushButton:hover{border-image:url(:/btn_history_hover.png);}"
"QPushButton{border-image: url(:/btn_history.png);}");
return;
}
#include <QScrollBar>
void TransmitDetailWidget::init_models()
{
m_transmit_files_model = new TableModel(this);
ui->completed_files_tableView->setModel(m_transmit_files_model);
QStringList transmit_files_model_header;
transmit_files_model_header << tr("文件名") << tr("大小") << tr("进度") << tr("开始时间") << tr("结束时间");
m_transmit_files_model->setHorizontalHeaderList(transmit_files_model_header);
m_transmit_files_model->setModalDatas(&m_transmit_files_grid_data_list);
m_transmit_files_model->refrushModel();
ui->completed_files_tableView->horizontalHeader()->setSectionResizeMode(transmit_files_model_header.size() - 1, QHeaderView::Stretch);
ui->completed_files_tableView->verticalHeader()->hide();
QFont font = ui->completed_files_tableView->horizontalHeader()->font();
font.setBold(true);
ui->completed_files_tableView->setItemDelegate(new NoFocusDelegate());
ui->completed_files_tableView->horizontalHeader()->setFont(font);
ui->completed_files_tableView->setShowGrid(false);
ui->completed_files_tableView->setFrameShape(QFrame::NoFrame);
ui->completed_files_tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->completed_files_tableView->setSelectionMode(QAbstractItemView::ExtendedSelection);
ui->completed_files_tableView->horizontalScrollBar()->setStyleSheet("QScrollBar{background:transparent; height:10px;}"
"QScrollBar::handle{background:lightgray; border:2px solid transparent; border-radius:5px;}"
"QScrollBar::handle:hover{background:gray;}"
"QScrollBar::sub-line{background:transparent;}"
"QScrollBar::add-line{background:transparent;}");
ui->completed_files_tableView->verticalScrollBar()->setStyleSheet("QScrollBar{background:transparent; width: 10px;}"
"QScrollBar::handle{background:lightgray; border:2px solid transparent; border-radius:5px;}"
"QScrollBar::handle:hover{background:gray;}"
"QScrollBar::sub-line{background:transparent;}"
"QScrollBar::add-line{background:transparent;}");
ui->completed_files_tableView->setStyleSheet("selection-background-color:lightblue;");
ui->completed_files_tableView->horizontalHeader()->setStyleSheet("QHeaderView::section {\
padding: 6px 0px;\
margin: 0px;\
color: #272727;\
border: none;\
border-right-width: 1px;\
border-right-color: #eeeeee;\
border-right-style: solid;\
background: #ffffff;\
font-weight:bold;\
}");
m_failed_files_model = new TableModel(this);
ui->failed_files_tableView->setModel(m_failed_files_model);
QStringList failed_files_model_header;
failed_files_model_header << tr("文件名") << tr("本地路径") << tr("云端路径") << tr("失败原因");
m_failed_files_model->setHorizontalHeaderList(failed_files_model_header);
m_failed_files_model->setModalDatas(&m_failed_files_grid_data_list);
m_failed_files_model->refrushModel();
ui->failed_files_tableView->horizontalHeader()->setSectionResizeMode(failed_files_model_header.size() - 1, QHeaderView::Stretch);
ui->failed_files_tableView->verticalHeader()->hide();
QFont font2 = ui->completed_files_tableView->horizontalHeader()->font();
font2.setBold(true);
ui->failed_files_tabl
渣渣soul
- 粉丝: 0
- 资源: 1
最新资源
- scrapy爬虫网站详细信息
- MATLAB代码:基于stackelberg博弈的光伏用户群优化定价模型 摘要:在由多主体组成的光伏用户群中,用户间存在光伏电量共享 然而,在现有的分布式光伏上网政策下,用户间的共享水平很低 为
- 基于JAVA的中小型企业采购招标系统的设计与实现源码 springboot、MySQL 本项目主要用来把传统的采购招标流程迁移到线上,线上采购招标系统目的在于摒弃传统采购招标复制繁琐的流程、改善现
- 一些个人信息的测试啊啊啊
- Agile Controller-DCN V300R001C20 产品文档
- C++、基于MFC的多线程虚拟示波器.zip
- 学习threejs,使用TrackballControls相机控制器
- C++、MFC图像处理系统,使用Opencv库,完成了图像的灰度变换、形态学操作、图像分割、图像滤波、边缘检测、人脸检测等功能 .zip
- Zynq-Utral MPSOC
- OpenAI.ChatGPT-Desktop-2025.108 OpenAI.ChatGPT-桌面版
- jdk-23-linux-x64-bin.tar.gz
- dts文件比较和全志Linux Tina-SDK开发完全手册
- springboot277流浪动物管理系统_0303174040.zip
- springboot278基于JavaWeb的鲜牛奶订购系统的设计与实现.zip
- springboot278基于JavaWeb的鲜牛奶订购系统的设计与实现_0303174040.zip
- I3C 规格书 I3C 硬件 协议工作原理
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈