更新搜索列表UI

This commit is contained in:
metanoia1989 2020-11-08 22:35:31 +08:00
parent 2ae6e80785
commit 8972425c7c
3 changed files with 342 additions and 281 deletions

View File

@ -11,6 +11,8 @@ CONFIG += c++11
#CONFIG += QT_APP_MODE #CONFIG += QT_APP_MODE
DEFINES += QT_APP_DEBUG DEFINES += QT_APP_DEBUG
QT += network
CONFIG += staticlib CONFIG += staticlib
TEMPLATE = lib TEMPLATE = lib
unix:TARGET = $$OUT_PWD/Lib/QtNetworkService unix:TARGET = $$OUT_PWD/Lib/QtNetworkService

View File

@ -715,7 +715,6 @@ void Widget::startRequest(QUrl url)
void Widget::searchApp(QString text) void Widget::searchApp(QString text)
{ {
qDebug() << "测试,我的输出是否被调用了,啊啊啊啊";
if(text.left(6)=="spk://"){ if(text.left(6)=="spk://"){
openUrl(text); openUrl(text);
}else { }else {
@ -727,7 +726,12 @@ void Widget::searchApp(QString text)
.header("content-type", "application/json") .header("content-type", "application/json")
.queryParam("keyword", text) .queryParam("keyword", text)
.onResponse([](QByteArray result) { .onResponse([](QByteArray result) {
qDebug() << "请求结果" << result; auto json = QJsonDocument::fromJson(result).array();
if (json.empty()) {
qDebug() << "搜索不到相关应用!";
return;
}
// TODO 展示应用
}) })
.onError([](QString errorStr) { .onError([](QString errorStr) {
qDebug() << "请求出错:" << errorStr; qDebug() << "请求出错:" << errorStr;

611
widget.ui
View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1053</width> <width>1053</width>
<height>674</height> <height>697</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -29,279 +29,26 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0" rowspan="4"> <item row="1" column="1">
<widget class="QWidget" name="widget_menuList" native="true"> <widget class="ProgressLoad" name="progressload" native="true">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>150</width> <width>0</width>
<height>0</height> <height>3</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>150</width> <width>16777215</width>
<height>16777215</height> <height>3</height>
</size> </size>
</property> </property>
<property name="font"> <property name="toolTipDuration">
<font> <number>-1</number>
<pointsize>11</pointsize>
</font>
</property>
<property name="accessibleDescription">
<string>background-color:#FFFFFF</string>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
</property> </property>
<layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<item row="6" column="0" colspan="6">
<widget class="QPushButton" name="menu_video">
<property name="text">
<string>Video</string>
</property>
</widget>
</item>
<item row="16" column="0" colspan="6">
<widget class="QPushButton" name="menu_download">
<property name="text">
<string>Download</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="6">
<widget class="QPushButton" name="menu_system">
<property name="text">
<string>Tools</string>
</property>
</widget>
</item>
<item row="13" column="0" colspan="6">
<widget class="QPushButton" name="menu_theme">
<property name="text">
<string>Beautify</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="6">
<widget class="QPushButton" name="menu_music">
<property name="text">
<string>Music</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="icon">
<property name="minimumSize">
<size>
<width>0</width>
<height>36</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>36</height>
</size>
</property>
<property name="text">
<string>icon</string>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="5">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>3</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="11" column="0" colspan="6">
<widget class="QPushButton" name="menu_dev">
<property name="text">
<string>Development</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="6">
<widget class="QPushButton" name="menu_office">
<property name="text">
<string>Office</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="pushButton_return">
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Back to category</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/icons/category_active.svg</normaloff>:/icons/icons/category_active.svg</iconset>
</property>
</widget>
</item>
<item row="17" column="0">
<spacer name="verticalSpacer">
<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 row="10" column="0" colspan="6">
<widget class="QPushButton" name="menu_read">
<property name="text">
<string>Reading</string>
</property>
</widget>
</item>
<item row="14" column="0" colspan="6">
<widget class="QPushButton" name="menu_other">
<property name="text">
<string>Others</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="6">
<widget class="QPushButton" name="menu_main">
<property name="styleSheet">
<string notr="true">font: 11pt &quot;Zeniq&quot;;</string>
</property>
<property name="text">
<string>Home</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="7" column="0" colspan="6">
<widget class="QPushButton" name="menu_photo">
<property name="text">
<string>Graphics</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="6">
<widget class="QPushButton" name="menu_game">
<property name="text">
<string>Games</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="6">
<widget class="QPushButton" name="menu_chat">
<property name="text">
<string>Chat</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="6">
<widget class="QPushButton" name="menu_network">
<property name="text">
<string>Network</string>
</property>
</widget>
</item>
<item row="15" column="0" colspan="6">
<widget class="QWidget" name="line1_widget" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>1</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>4</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color:#808080</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="pushButton_refresh">
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Reload</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/icons/refresh-page.svg</normaloff>:/icons/icons/refresh-page.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
@ -313,7 +60,7 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>4</number>
</property> </property>
<widget class="QWidget" name="page"> <widget class="QWidget" name="page">
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
@ -333,11 +80,11 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QWebEngineView" name="webEngineView"> <widget class="QWebEngineView" name="webEngineView" native="true">
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum> <enum>Qt::DefaultContextMenu</enum>
</property> </property>
<property name="url"> <property name="url" stdset="0">
<url> <url>
<string>about:blank</string> <string>about:blank</string>
</url> </url>
@ -457,8 +204,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>889</width> <width>886</width>
<height>849</height> <height>865</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_17"> <layout class="QVBoxLayout" name="verticalLayout_17">
@ -952,8 +699,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>851</width> <width>840</width>
<height>326</height> <height>318</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
@ -1082,8 +829,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>889</width> <width>886</width>
<height>812</height> <height>921</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_23"> <layout class="QVBoxLayout" name="verticalLayout_23">
@ -1354,6 +1101,61 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="applist_page">
<widget class="QStackedWidget" name="applist_stack">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>903</width>
<height>667</height>
</rect>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="tips_page">
<widget class="QLabel" name="listload_tips">
<property name="geometry">
<rect>
<x>250</x>
<y>210</y>
<width>231</width>
<height>121</height>
</rect>
</property>
<property name="text">
<string>Not found applist info!</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="widgets_page">
<widget class="QScrollArea" name="widgets_scrollarea">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>903</width>
<height>667</height>
</rect>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_4">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>901</width>
<height>665</height>
</rect>
</property>
</widget>
</widget>
</widget>
</widget>
</widget>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
@ -1366,30 +1168,283 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="0" column="0" rowspan="4">
<widget class="ProgressLoad" name="progressload" native="true"> <widget class="QWidget" name="widget_menuList" native="true">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="accessibleDescription">
<string>background-color:#FFFFFF</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<item row="1" column="0">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0" colspan="6">
<widget class="QPushButton" name="menu_music">
<property name="text">
<string>Music</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="6">
<widget class="QPushButton" name="menu_photo">
<property name="text">
<string>Graphics</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="6">
<widget class="QPushButton" name="menu_dev">
<property name="text">
<string>Development</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="icon">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>3</height> <height>36</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>3</height> <height>36</height>
</size> </size>
</property> </property>
<property name="toolTipDuration"> <property name="text">
<number>-1</number> <string>icon</string>
</property>
</widget>
</item>
<item row="0" column="5">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>3</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="12" column="0" colspan="6">
<widget class="QPushButton" name="menu_system">
<property name="text">
<string>Tools</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="6">
<widget class="QPushButton" name="menu_read">
<property name="text">
<string>Reading</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="6">
<widget class="QPushButton" name="menu_office">
<property name="text">
<string>Office</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="pushButton_refresh">
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Reload</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/icons/refresh-page.svg</normaloff>:/icons/icons/refresh-page.svg</iconset>
</property>
</widget>
</item>
<item row="4" column="0" colspan="6">
<widget class="QPushButton" name="menu_chat">
<property name="text">
<string>Chat</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="pushButton_return">
<property name="maximumSize">
<size>
<width>40</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Back to category</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/icons/category_active.svg</normaloff>:/icons/icons/category_active.svg</iconset>
</property>
</widget>
</item>
<item row="17" column="0">
<spacer name="verticalSpacer">
<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 row="13" column="0" colspan="6">
<widget class="QPushButton" name="menu_theme">
<property name="text">
<string>Beautify</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="6">
<widget class="QPushButton" name="menu_network">
<property name="text">
<string>Network</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="6">
<widget class="QPushButton" name="menu_game">
<property name="text">
<string>Games</string>
</property>
</widget>
</item>
<item row="14" column="0" colspan="6">
<widget class="QPushButton" name="menu_other">
<property name="text">
<string>Others</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="6">
<widget class="QPushButton" name="menu_main">
<property name="styleSheet">
<string notr="true">font: 11pt &quot;Zeniq&quot;;</string>
</property>
<property name="text">
<string>Home</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="16" column="0" colspan="6">
<widget class="QPushButton" name="menu_download">
<property name="text">
<string>Download</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="6">
<widget class="QPushButton" name="menu_video">
<property name="text">
<string>Video</string>
</property>
</widget>
</item>
<item row="15" column="0" colspan="6">
<widget class="QWidget" name="line1_widget" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>1</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>4</height>
</size>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true">background-color:#808080</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item>
</layout>
</widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>QWebEngineView</class> <class>QWebEngineView</class>