更新appitem的样式

This commit is contained in:
metanoia1989 2020-11-29 22:25:20 +08:00
parent a73a4416fc
commit 736ede0742
3 changed files with 32 additions and 7 deletions

@ -43,6 +43,7 @@ void AppItem::setUrl(QString url)
void AppItem::mousePressEvent(QMouseEvent *event)
{
Q_UNUSED(event);
emit clicked(QUrl(m_url));
}
@ -62,6 +63,7 @@ void AppItem::downloadIcon(QString icon)
reqManager->deleteLater();
QPixmap pixmap;
pixmap.loadFromData(reply->readAll());
pixmap = pixmap.scaled(78, 78, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
if (reply->error() == QNetworkReply::NoError) {
QMetaObject::invokeMethod(this, "loadIcon", Qt::QueuedConnection,
Q_ARG(QPixmap, pixmap));

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>300</width>
<height>100</height>
</rect>
</property>
<property name="windowTitle">
@ -16,6 +16,17 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lbl_icon">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">width: 78px;
height: 70px;
padding: 10px;</string>
</property>
<property name="text">
<string/>
</property>
@ -25,6 +36,12 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="lbl_title">
<property name="minimumSize">
<size>
<width>200</width>
<height>50</height>
</size>
</property>
<property name="text">
<string/>
</property>
@ -32,6 +49,12 @@
</item>
<item>
<widget class="QLabel" name="lbl_desc">
<property name="minimumSize">
<size>
<width>200</width>
<height>50</height>
</size>
</property>
<property name="text">
<string/>
</property>

@ -345,7 +345,7 @@
<number>0</number>
</property>
<property name="currentIndex">
<number>4</number>
<number>3</number>
</property>
<widget class="QWidget" name="page">
<layout class="QVBoxLayout" name="verticalLayout_4">
@ -489,7 +489,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>655</width>
<width>886</width>
<height>865</height>
</rect>
</property>
@ -984,7 +984,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>609</width>
<width>840</width>
<height>318</height>
</rect>
</property>
@ -1114,8 +1114,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>808</width>
<height>941</height>
<width>886</width>
<height>921</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23">