添加应用详情页下载量显示

This commit is contained in:
2022-12-11 02:05:34 +08:00
parent 8a54dd92a3
commit 333a1168d4
5 changed files with 85 additions and 1 deletions

View File

@@ -9,6 +9,12 @@ AppIntoPage::AppIntoPage(QWidget *parent) :
ui->listWidget->setMovement(QListView::Static);
ui->listWidget->setMaximumHeight(200);
ui->listWidget->setFlow(QListView::TopToBottom);
api1=new SparkAPI(this);
connect(api1,&SparkAPI::finishedRAW,[=](QString download_times){
download_times.remove(QRegExp("\\n"));
ui->download_times->setText(download_times);
qDebug()<<"Download Times:"+download_times;
});
clear();
}
@@ -179,6 +185,7 @@ void AppIntoPage::openUrl(QUrl url)
api->deleteLater();
});
api->getAppInfo(url);
api1->getAppDownloadTimes(url);
}
void AppIntoPage::isDownloading()

View File

@@ -35,6 +35,7 @@ private slots:
void on_updateButton_clicked();
private:
SparkAPI *api1;
QJsonObject info;
QPixmap iconpixmap;
QUrl spk;

View File

@@ -302,7 +302,65 @@
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<property name="topMargin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="spacing">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="download_times">
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Download Times</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_9">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>