添加下载列表为空时的提示

This commit is contained in:
2022-12-11 00:29:51 +08:00
parent e171904a34
commit 0817901a59
2 changed files with 53 additions and 1 deletions

View File

@@ -12,7 +12,8 @@ DownloadListWidget::DownloadListWidget(QWidget *parent) :
this->setAttribute(Qt::WA_Hover,true); this->setAttribute(Qt::WA_Hover,true);
setFocus(); setFocus();
setFixedSize(500,400); setFixedSize(500,400);
ui->listWidget->hide();
ui->widget->show();
// 计算显示下载速度 // 计算显示下载速度
download_speed.setInterval(1000); download_speed.setInterval(1000);
download_speed.start(); download_speed.start();
@@ -104,6 +105,7 @@ QList<DownloadItem *> DownloadListWidget::getDIList()
void DownloadListWidget::startRequest(QUrl url, QString fileName) void DownloadListWidget::startRequest(QUrl url, QString fileName)
{ {
ui->listWidget->show(); ui->listWidget->show();
ui->widget->hide();
isBusy = true; isBusy = true;
isdownload = true; isdownload = true;
downloaditemlist[allDownload - 1]->free = false; downloaditemlist[allDownload - 1]->free = false;

View File

@@ -14,6 +14,56 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>The list is currently empty. Go and download some softwares!</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>56</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="SmoothListWidget" name="listWidget"> <widget class="SmoothListWidget" name="listWidget">
<property name="minimumSize"> <property name="minimumSize">