一些功能添加与界面调整

This commit is contained in:
Lappland 2022-09-11 02:46:53 +08:00
parent 2a62e48a7f
commit 031615296a
36 changed files with 2263 additions and 1407 deletions

View File

@ -1,5 +1,8 @@
QT += core gui QT += core gui
QT += serialport QT += serialport
QT += core5compat
# QMAKE_LFLAGS += /MANIFESTUAC:\"level=\'requireAdministrator\' uiAccess=\'false\'\"
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11 CONFIG += c++11
@ -10,9 +13,11 @@ CONFIG += c++11
SOURCES += \ SOURCES += \
about.cpp \ about.cpp \
abstract/comboboxlistwidget.cpp \
adbprocess.cpp \ adbprocess.cpp \
animationwidget.cpp \ animationwidget.cpp \
basepage.cpp \ basepage.cpp \
devitem.cpp \
indexlistitem.cpp \ indexlistitem.cpp \
main.cpp \ main.cpp \
mainwindow.cpp \ mainwindow.cpp \
@ -52,9 +57,11 @@ SOURCES += \
HEADERS += \ HEADERS += \
about.h \ about.h \
abstract/comboboxlistwidget.h \
adbprocess.h \ adbprocess.h \
animationwidget.h \ animationwidget.h \
basepage.h \ basepage.h \
devitem.h \
indexlistitem.h \ indexlistitem.h \
mainwindow.h \ mainwindow.h \
monitor.h \ monitor.h \
@ -94,6 +101,7 @@ HEADERS += \
FORMS += \ FORMS += \
about.ui \ about.ui \
basepage.ui \ basepage.ui \
devitem.ui \
indexlistitem.ui \ indexlistitem.ui \
mainwindow.ui \ mainwindow.ui \
monitor.ui \ monitor.ui \
@ -134,6 +142,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target !isEmpty(target.path): INSTALLS += target
RESOURCES += \ RESOURCES += \
cfgs.qrc \
ico.qrc \ ico.qrc \
styles.qrc styles.qrc

View File

@ -30,12 +30,13 @@ about::about(QWidget *parent) :
shadowEffect_btn_money->setOffset(0,0); shadowEffect_btn_money->setOffset(0,0);
shadowEffect_btn_money->setColor(Qt::gray); shadowEffect_btn_money->setColor(Qt::gray);
shadowEffect_btn_money->setBlurRadius(5); shadowEffect_btn_money->setBlurRadius(5);
ui->btn_money->setGraphicsEffect(shadowEffect_btn_money); //ui->btn_money->setGraphicsEffect(shadowEffect_btn_money);
QGraphicsDropShadowEffect *shadowEffect_btn_money2 = new QGraphicsDropShadowEffect(this); QGraphicsDropShadowEffect *shadowEffect_btn_money2 = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_money2->setOffset(0,0); shadowEffect_btn_money2->setOffset(0,0);
shadowEffect_btn_money2->setColor(Qt::green); shadowEffect_btn_money2->setColor(QColorConstants::Svg::orange);
shadowEffect_btn_money2->setBlurRadius(5); shadowEffect_btn_money2->setBlurRadius(5);
ui->btn_money_2->setGraphicsEffect(shadowEffect_btn_money2); ui->btn_money_2->setGraphicsEffect(shadowEffect_btn_money2);/*
QGraphicsDropShadowEffect *shadowEffect_btn_money3 = new QGraphicsDropShadowEffect(this); QGraphicsDropShadowEffect *shadowEffect_btn_money3 = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_money3->setOffset(0,0); shadowEffect_btn_money3->setOffset(0,0);
shadowEffect_btn_money3->setColor(Qt::gray); shadowEffect_btn_money3->setColor(Qt::gray);
@ -45,7 +46,13 @@ about::about(QWidget *parent) :
shadowEffect_btn_money4->setOffset(0,0); shadowEffect_btn_money4->setOffset(0,0);
shadowEffect_btn_money4->setColor(Qt::gray); shadowEffect_btn_money4->setColor(Qt::gray);
shadowEffect_btn_money4->setBlurRadius(5); shadowEffect_btn_money4->setBlurRadius(5);
ui->btn_money_4->setGraphicsEffect(shadowEffect_btn_money4); ui->btn_money_4->setGraphicsEffect(shadowEffect_btn_money4);*/
QGraphicsDropShadowEffect *shadowEffect_btn_qq = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_qq->setOffset(0,0);
shadowEffect_btn_qq->setColor(Qt::gray);
shadowEffect_btn_qq->setBlurRadius(5);
ui->btn_qq_dis->setGraphicsEffect(shadowEffect_btn_qq);
QGraphicsDropShadowEffect *shadowEffect_btn_version = new QGraphicsDropShadowEffect(this); QGraphicsDropShadowEffect *shadowEffect_btn_version = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_version->setOffset(0,0); shadowEffect_btn_version->setOffset(0,0);
@ -55,15 +62,15 @@ about::about(QWidget *parent) :
QGraphicsDropShadowEffect *shadowEffect_btn_links = new QGraphicsDropShadowEffect(this); QGraphicsDropShadowEffect *shadowEffect_btn_links = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_links->setOffset(0,0); shadowEffect_btn_links->setOffset(0,0);
shadowEffect_btn_links->setColor(Qt::gray); shadowEffect_btn_links->setColor(QColorConstants::Svg::skyblue);
shadowEffect_btn_links->setBlurRadius(5); shadowEffect_btn_links->setBlurRadius(5);
ui->btn_links->setGraphicsEffect(shadowEffect_btn_links); ui->btn_links->setGraphicsEffect(shadowEffect_btn_links);
/*
ui->btn_money->hide(); ui->btn_money->hide();
ui->btn_money_3->hide(); ui->btn_money_3->hide();
ui->btn_money_4->hide(); ui->btn_money_4->hide();*/
//this->setStyleSheet("QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;}"); //this->setStyleSheet("QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;}");
//this->setStyleSheet("QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;}"); //this->setStyleSheet("QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;}");
} }
@ -98,7 +105,6 @@ void about::on_btn_money_2_clicked()
payPage->show(); payPage->show();
} }
void about::on_btn_links_clicked() void about::on_btn_links_clicked()
{ {
links *linksPage = new links(); links *linksPage = new links();
@ -111,3 +117,9 @@ void about::on_btn_version_clicked()
QDesktopServices::openUrl(QUrl("https://lapplandsp.github.io/QtAdb-Pages/qa/", QUrl::TolerantMode)); QDesktopServices::openUrl(QUrl("https://lapplandsp.github.io/QtAdb-Pages/qa/", QUrl::TolerantMode));
} }
void about::on_btn_qq_dis_clicked()
{
QDesktopServices::openUrl(QUrl("https://pd.qq.com/s/k96ej1", QUrl::TolerantMode));
}

View File

@ -34,6 +34,8 @@ private slots:
void on_btn_version_clicked(); void on_btn_version_clicked();
void on_btn_qq_dis_clicked();
private: private:
Ui::about *ui; Ui::about *ui;
}; };

View File

@ -6,14 +6,14 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>634</width> <width>833</width>
<height>465</height> <height>616</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -52,14 +52,162 @@ background-color: rgba(255, 255, 255, 0);</string>
<number>11</number> <number>11</number>
</property> </property>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="spacing">
<number>14</number>
</property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<item> <property name="spacing">
<number>10</number>
</property>
<item row="8" column="0">
<layout class="QHBoxLayout" name="horizontalLayout"/>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QPushButton" name="btn_qq_dis">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="font">
<font/>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string/>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}
QPushButton:hover{background-color:rgba(255,255,255,0.7);}
QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="ico.qrc">
<normaloff>:/ico/image/ico/QQ_tencent-qq.svg</normaloff>:/ico/image/ico/QQ_tencent-qq.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>QQ频道</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" 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="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="btn_coolapk">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="font">
<font/>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string/>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}
QPushButton:hover{background-color:rgba(255,255,255,0.7);}
QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="ico.qrc">
<normaloff>:/ico/image/ico/about/coolapklogo-b.png</normaloff>:/ico/image/ico/about/coolapklogo-b.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>酷安</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QPushButton" name="btn_version"> <widget class="QPushButton" name="btn_version">
@ -120,13 +268,79 @@ QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 11
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>测试版本beta-v1.3</string> <string>beta-v1.5</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item row="6" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="btn_money_2">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="font">
<font/>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string/>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px;}
QPushButton:hover{background-color:rgba(255,255,255,0.7);}
QPushButton:pressed{background-color:rgba(255,255,255,0.5);}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="ico.qrc">
<normaloff>:/ico/image/ico/about/cola.svg</normaloff>:/ico/image/ico/about/cola.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>捐赠: 请我喝快乐水</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QPushButton" name="btn_website"> <widget class="QPushButton" name="btn_website">
@ -186,79 +400,13 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>官方网站https://lapplandsp.github.io/QtAdb-Pages/</string> <string>官方网站</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="btn_coolapk">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="font">
<font/>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string/>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}
QPushButton:hover{background-color:rgba(255,255,255,0.7);}
QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="ico.qrc">
<normaloff>:/ico/image/ico/about/coolapklogo-b.png</normaloff>:/ico/image/ico/about/coolapklogo-b.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>酷安:@霍星</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<item> <item>
<widget class="QPushButton" name="btn_github"> <widget class="QPushButton" name="btn_github">
@ -318,13 +466,13 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Github LapplandSP</string> <string>Github</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QPushButton" name="btn_links"> <widget class="QPushButton" name="btn_links">
@ -350,9 +498,9 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
<cursorShape>PointingHandCursor</cursorShape> <cursorShape>PointingHandCursor</cursorShape>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;} <string notr="true">QPushButton{background-color:rgba(255,255,255,0.6);border-radius:4px;border:0px;}
QPushButton:hover{background-color:rgba(255,255,255,0.7);} QPushButton:hover{background-color:rgba(255,255,255,0.7);}
QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string> QPushButton:pressed{background-color:rgba(255,255,255,0.5);}</string>
</property> </property>
<property name="text"> <property name="text">
<string/> <string/>
@ -378,193 +526,6 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="btn_money">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="font">
<font/>
</property>
<property name="toolTip">
<string>请我吃东西</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}
QPushButton:hover{background-color:rgba(255,255,255,0.7);}
QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="ico.qrc">
<normaloff>:/ico/image/ico/about/heart-line.svg</normaloff>:/ico/image/ico/about/heart-line.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_money_2">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="font">
<font/>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string/>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}
QPushButton:hover{background-color:rgba(255,255,255,0.7);}
QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="ico.qrc">
<normaloff>:/ico/image/ico/about/cola.svg</normaloff>:/ico/image/ico/about/cola.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_money_3">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="font">
<font/>
</property>
<property name="toolTip">
<string>请我吃鸡腿5元</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}
QPushButton:hover{background-color:rgba(255,255,255,0.7);}
QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="ico.qrc">
<normaloff>:/ico/image/ico/about/chiken.svg</normaloff>:/ico/image/ico/about/chiken.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_money_4">
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="font">
<font/>
</property>
<property name="toolTip">
<string>请我吃面条10元</string>
</property>
<property name="styleSheet">
<string notr="true">QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}
QPushButton:hover{background-color:rgba(255,255,255,0.7);}
QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="ico.qrc">
<normaloff>:/ico/image/ico/about/noodles.svg</normaloff>:/ico/image/ico/about/noodles.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>捐赠:请我喝快乐水</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<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>
<layout class="QHBoxLayout" name="horizontalLayout"/>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

View File

@ -0,0 +1,112 @@
#include "comboboxlistwidget.h"
comboboxListWidget::comboboxListWidget(QWidget *parent)
: QListWidget{parent}
{
explainer = new textExplainer();
nameList[0] = name;
nameList[1] = addr;
//this->setModelColumn(count);
this->setResizeMode(QListView::Adjust);
this->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
QFile file_qss("://qss/scrollbar.qss");
file_qss.open(QFile::ReadOnly);
this->verticalScrollBar()->setStyleSheet(file_qss.readAll());
this->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
/*
file = new QFile(":/cfgs/cfg/name.cfg");
file->open(QFile::ReadWrite);*/
}
comboboxListWidget::~comboboxListWidget()
{
}
void comboboxListWidget::setUpList(QList<device> devList, QList<int> off)
{
/*
QFile file(":/cfgs/cfg/name.cfg");
file.open(QFile::ReadOnly);
QString names = file.readAll();
names = explainer->get_words_before(explainer->get_words_after(names,"###NAME###"),"###ENDNAME###");
QStringList tmpList = names.split("\n");*/
//qDebug() << tmpList;
/*
for(int i = 0 ;i < tmpList.size() ; i++)
{
nameList[0].append(explainer->get_words_after(tmpList[i],":"));
nameList[1].append(explainer->get_words_before(tmpList[i],":"));
}*/
for (int i = 0 ; i < devList.size() ; i++ )
{
devItem *wgt = new devItem(this);
wgt->setAddr(devList[i].addr);
wgt->setDevice(devList[i].device_product);
wgt->setDevModel(devList[i].model);
wgt->setStat(devList[i].state);
qDebug() << "nameList[1] (addr)" << nameList[1];
qDebug() << "devList[i].addr" << devList[i].addr;
if(nameList[1].contains(devList[i].addr))
{
wgt->setName(nameList[0][nameList[1].indexOf(devList[i].addr)]);
//qDebug() << nameList[0][nameList[1].indexOf(devList[i].addr)];
}
else
{
wgt->setName(explainer->get_words_after(devList[i].model,":"));
}
QListWidgetItem *item = new QListWidgetItem(this);
this->addItem(item);
this->setItemWidget(item, wgt);
connect(wgt,SIGNAL(addName(QString,QString)),this,SLOT(addName(QString,QString)));
}
/*
file.close();*/
qDebug() << "closed";
//file.deleteLater();
}
void comboboxListWidget::addName(QString addr,QString name)
{/*
addr = explainer->get_words_after(addr, ": ");
qDebug() << "addr:" << addr << "name:" << name;
if(nameList[1].contains(addr))
{
nameList[0][nameList[1].indexOf(addr)] = name;
}
else
{
nameList[0].append(name);
nameList[1].append(addr);
}
QString text = "###NAME###\n";
for(int i = 0 ;i < nameList->size() ; i++)
{
text.append(nameList[1][i]).append(":").append(nameList[0][i]).append("\n");
}
text.append("###ENDNAME###");
//file.open(QFile::ReadWrite);
//file.close();
QFile file(":/cfgs/cfg/name.cfg");
file.setPermissions(QFile::WriteUser);
file.open(QIODevice::Truncate | QIODevice::WriteOnly);
qDebug() << file.isWritable();
file.write(text.toUtf8());
file.close();
file.deleteLater();*/
}

View File

@ -0,0 +1,41 @@
#ifndef COMBOBOXLISTWIDGET_H
#define COMBOBOXLISTWIDGET_H
#include <QObject>
#include <QWidget>
#include <QListWidget>
#include <QListView>
#include <QHeaderView>
#include <QFile>
#include <QList>
#include "../devitem.h"
#include "../textexplainer.h"
#include "qstandarditemmodel.h"
#include "qscrollbar.h"
class comboboxListWidget : public QListWidget
{
Q_OBJECT
public:
explicit comboboxListWidget(QWidget *parent = nullptr);
~comboboxListWidget();
void setUpList(QList<device>, QList<int> off);
QStringList nameList[2];
QStringList name;
QStringList addr;
signals:
private slots:
void addName(QString addr,QString name);
private:
textExplainer *explainer;
//QFile *file;
};
#endif // COMBOBOXLISTWIDGET_H

View File

@ -80,6 +80,7 @@ QString adbProcess::run(QString command) //Adb 命令解析 -
QString adbProcess::run(QString command, device dev) //Adb 命令解析 - 对指定设备发送单条命令 QString adbProcess::run(QString command, device dev) //Adb 命令解析 - 对指定设备发送单条命令
{ {
//qDebug() << "adbprocess dev = " << dev.addr;
if(thread) if(thread)
{ {
explainer->thread = true; explainer->thread = true;

View File

@ -12,17 +12,17 @@ void animationWidget::playLoadAnimation()
{ {
animation->setDuration(750); animation->setDuration(750);
//animation->setEndValue(QPoint(301,117)); //animation->setEndValue(QPoint(301,117));
qDebug() << "wgtHeight = " << wgtHeight; //qDebug() << "wgtHeight = " << wgtHeight;
if(parent->width() <= 600) if(parent->width() <= 600)
{ {
animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, 600,wgtHeight)); animation->setEndValue(QRect(301 - 29, 117 - 6 - 11, 600,wgtHeight));
} }
else else
{ {
animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, parent->width(),wgtHeight)); animation->setEndValue(QRect(301 - 29, 117 - 6 - 11, parent->width(),wgtHeight));
} }
//animation->setStartValue(QPoint(301 + 50,117)); //animation->setStartValue(QPoint(301 + 50,117));
animation->setStartValue(QRect(301 + 50 - 30, 117 - 6 - 11, parent->width()-50,wgtHeight)); animation->setStartValue(QRect(301 + 50 - 29, 117 - 6 - 11, parent->width()-50,wgtHeight));
animation->setEasingCurve(QEasingCurve::OutQuart); animation->setEasingCurve(QEasingCurve::OutQuart);
@ -38,14 +38,14 @@ void animationWidget::playLoadAnimation(int h)
//qDebug() << "wgtHeight = " << wgtHeight; //qDebug() << "wgtHeight = " << wgtHeight;
if(parent->width() <= 600) if(parent->width() <= 600)
{ {
animation->setEndValue(QRect(301 - 30, 117 - 6 -11, 600,h)); animation->setEndValue(QRect(301 - 29, 117 - 6 -11, 600,h));
} }
else else
{ {
animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, parent->width(),h)); animation->setEndValue(QRect(301 - 29, 117 - 6 - 11, parent->width(),h));
} }
//animation->setStartValue(QPoint(301 + 50,117)); //animation->setStartValue(QPoint(301 + 50,117));
animation->setStartValue(QRect(301 + 50 - 30, 117 - 6 - 11, parent->width()-50,h)); animation->setStartValue(QRect(301 + 50 - 29, 117 - 6 - 11, parent->width()-50,h));
animation->setEasingCurve(QEasingCurve::OutQuart); animation->setEasingCurve(QEasingCurve::OutQuart);
@ -59,7 +59,7 @@ void animationWidget::playLoadAnimation_sp(int h)
{ {
animation->setDuration(500); animation->setDuration(500);
//animation->setEndValue(QPoint(301,117)); //animation->setEndValue(QPoint(301,117));
qDebug() << "wgtHeight = " << wgtHeight; //qDebug() << "wgtHeight = " << wgtHeight;
if(parent->width() <= 600) if(parent->width() <= 600)
{ {
animation->setEndValue(QRect(0,0, parent->width(),h)); animation->setEndValue(QRect(0,0, parent->width(),h));
@ -82,17 +82,17 @@ void animationWidget::playLoadAnimation_bp(int h)
{ {
animation->setDuration(500); animation->setDuration(500);
//animation->setEndValue(QPoint(301,117)); //animation->setEndValue(QPoint(301,117));
qDebug() << "wgtHeight = " << wgtHeight; //qDebug() << "wgtHeight = " << wgtHeight;
if(parent->width() <= 600) if(parent->width() <= 600)
{ {
animation->setEndValue(QRect(301 - 30, 117 - 6 -11, 600,h)); animation->setEndValue(QRect(301 - 29, 117 - 6 -11, 600,h));
} }
else else
{ {
animation->setEndValue(QRect(301 - 30, 117 - 6 - 11, parent->width(),h)); animation->setEndValue(QRect(301 - 29, 117 - 6 - 11, parent->width(),h));
} }
//animation->setStartValue(QPoint(301 + 50,117)); //animation->setStartValue(QPoint(301 + 50,117));
animation->setStartValue(QRect(301 - 30, 117 - 6 - 11 + 10, parent->width(),h)); animation->setStartValue(QRect(301 - 29, 117 - 6 - 11 + 10, parent->width(),h));
animation->setEasingCurve(QEasingCurve::OutQuart); animation->setEasingCurve(QEasingCurve::OutQuart);
@ -105,18 +105,18 @@ void animationWidget::playExitAnimation()
{ {
animation->setDuration(300); animation->setDuration(300);
//animation->setEndValue(QPoint(301,117)); //animation->setEndValue(QPoint(301,117));
qDebug() << "wgtHeight = " << wgtHeight; //qDebug() << "wgtHeight = " << wgtHeight;
if(parent->width() <= 600) if(parent->width() <= 600)
{ {
animation->setEndValue(QRect(301 - 30, 117 - 6 - 11 + 50, parent->width(),wgtHeight)); animation->setEndValue(QRect(301 - 29, 117 - 6 - 11 + 50, parent->width(),wgtHeight));
} }
else else
{ {
animation->setEndValue(QRect(301 - 30, 117 - 6 - 11 + 50, parent->width(),wgtHeight)); animation->setEndValue(QRect(301 - 29, 117 - 6 - 11 + 50, parent->width(),wgtHeight));
} }
//animation->setStartValue(QPoint(301 + 50,117)); //animation->setStartValue(QPoint(301 + 50,117));
//animation->setStartValue(QRect(301 + 50 - 30, 117 - 6 - 11, parent->width()-50,wgtHeight)); //animation->setStartValue(QRect(301 + 50 - 30, 117 - 6 - 11, parent->width()-50,wgtHeight));
animation->setStartValue(QRect(301 - 30, 117 - 6 - 11, parent->width(),wgtHeight)); animation->setStartValue(QRect(301 - 29, 117 - 6 - 11, parent->width(),wgtHeight));
animation->setEasingCurve(QEasingCurve::OutQuart); animation->setEasingCurve(QEasingCurve::OutQuart);
@ -129,7 +129,7 @@ void animationWidget::playExitAnimation_sp()
{ {
animation->setDuration(500); animation->setDuration(500);
//animation->setEndValue(QPoint(301,117)); //animation->setEndValue(QPoint(301,117));
qDebug() << "wgtHeight = " << wgtHeight; //qDebug() << "wgtHeight = " << wgtHeight;
if(parent->width() <= 600) if(parent->width() <= 600)
{ {
animation->setEndValue(QRect(0,-11, parent->width(),wgtHeight)); animation->setEndValue(QRect(0,-11, parent->width(),wgtHeight));

3
QtAdb/cfg/name.cfg Normal file
View File

@ -0,0 +1,3 @@
###NAME###
CB512EJM8C:test
###ENDNAME###

5
QtAdb/cfgs.qrc Normal file
View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/cfgs">
<file>cfg/name.cfg</file>
</qresource>
</RCC>

53
QtAdb/devitem.cpp Normal file
View File

@ -0,0 +1,53 @@
#include "devitem.h"
#include "ui_devitem.h"
devItem::devItem(QWidget *parent) :
QWidget(parent),
ui(new Ui::devItem)
{
ui->setupUi(this);
explainer = new textExplainer();
QGraphicsDropShadowEffect *shadowEffect_wgt = new QGraphicsDropShadowEffect(this);
shadowEffect_wgt->setOffset(0,0);
shadowEffect_wgt->setColor(Qt::gray);
shadowEffect_wgt->setBlurRadius(5);
ui->widget_phone->setGraphicsEffect(shadowEffect_wgt);
ui->widget_2->setStyleSheet("QToolTip{border:1px solid #BDBDBD; background-color: #ffffff; color:rgba(117, 117, 117, 0.9);font-family: MiSans Medium; font-size:12px;border-radius:4px;}");
ui->lineEdit->hide();
}
devItem::~devItem()
{
delete ui;
}
void devItem::setAddr(QString s)
{
ui->label_addr_info->setText("序列号\n" + s);
}
void devItem::setDevModel(QString s)
{
ui->label_model_info->setText("型号\n" + explainer->get_words_after(s, ":"));
}
void devItem::setDevice(QString s)
{
ui->label_device_info->setText("设备代号\n" + explainer->get_words_after(s, ":"));
}
void devItem::setName(QString s)
{
ui->lineEdit->setText(s);
}
void devItem::setStat(QString s)
{
ui->label_stat_info->setText(s);
}
void devItem::on_lineEdit_editingFinished()
{
emit addName(ui->label_addr_info->text(),ui->lineEdit->text());
}

39
QtAdb/devitem.h Normal file
View File

@ -0,0 +1,39 @@
#ifndef DEVITEM_H
#define DEVITEM_H
#include <QWidget>
#include <QGraphicsDropShadowEffect>
//#include "abstract/comboboxlistwidget.h"
#include "textexplainer.h"
namespace Ui {
class devItem;
}
class devItem : public QWidget
{
Q_OBJECT
public:
explicit devItem(QWidget *parent = nullptr);
~devItem();
void setAddr(QString);
void setDevModel(QString);
void setDevice(QString);
void setName(QString);
void setStat(QString);
textExplainer *explainer;
private slots:
void on_lineEdit_editingFinished();
private:
Ui::devItem *ui;
signals:
void addName(QString,QString);
};
#endif // DEVITEM_H

318
QtAdb/devitem.ui Normal file
View File

@ -0,0 +1,318 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>devItem</class>
<widget class="QWidget" name="devItem">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>232</width>
<height>317</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">border:0px;
border-radius:8px;
background-color: rgba(255, 255, 255, 255);</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>30</number>
</property>
<property name="rightMargin">
<number>30</number>
</property>
<item>
<widget class="QWidget" name="widget_2" native="true">
<property name="toolTip">
<string>点击选择此设备</string>
</property>
<property name="styleSheet">
<string notr="true">/*background-color: rgb(255, 255, 255);*/
border:0px solid #BDBDBD;border-radius:8px;background-color: rgba(0, 0, 0, 0.4);</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="widget_phone" native="true">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string/>
</property>
<property name="styleSheet">
<string notr="true">/*background-color: rgb(255, 255, 255);*/
border:0px solid #BDBDBD;border-radius:8px;background-color: rgba(0, 0, 0, 0.4);</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">/*background-color: rgb(255, 255, 255);*/
border:0px solid #BDBDBD;
border-radius:8px;
background-color:white;</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>5</number>
</property>
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>10</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>10</number>
</property>
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0,0,0,0.1);
border:0px solid #BDBDBD;
border-radius:15px;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_model_info">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0,0,0,0.1);
border:0px solid #BDBDBD;
border-radius:15px;</string>
</property>
<property name="text">
<string>型号</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_addr_info">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0,0,0,0.1);
border:0px solid #BDBDBD;
border-radius:15px;</string>
</property>
<property name="text">
<string>序列号</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_device_info">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0,0,0,0.1);
border:0px solid #BDBDBD;
border-radius:15px;</string>
</property>
<property name="text">
<string>设备代号</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_stat_info">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>30</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0,0,0,0.1);
border:0px solid #BDBDBD;
border-radius:15px;</string>
</property>
<property name="text">
<string>状态未知</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>8</width>
<height>8</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>8</width>
<height>8</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">/*background-color: rgb(255, 255, 255);*/
border:0px solid #BDBDBD;
border-radius:4px;
background-color:white;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -78,6 +78,9 @@
<file>image/ico/donut-chart-line.svg</file> <file>image/ico/donut-chart-line.svg</file>
<file>image/ico/layout-top-2-line.svg</file> <file>image/ico/layout-top-2-line.svg</file>
<file>image/ico/stack-line.svg</file> <file>image/ico/stack-line.svg</file>
<file>image/ico/edit-line.svg</file>
<file>image/ico/devices.svg</file>
<file>image/ico/QQ_tencent-qq.svg</file>
</qresource> </qresource>
<qresource prefix="/test"> <qresource prefix="/test">
<file>image/test/back.png</file> <file>image/test/back.png</file>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M23.7927 44.5178C20.1344 44.5178 16.7762 43.2933 14.6142 41.4646C13.5161 41.7927 12.1115 42.3204 11.2254 42.9751C10.4664 43.535 10.5613 44.1059 10.6979 44.3362C11.298 45.3491 20.9938 44.9831 23.7927 44.6678V44.5178ZM23.7927 44.5178C27.4516 44.5178 30.8095 43.2933 32.9718 41.4646C34.0693 41.7927 35.4742 42.3204 36.3606 42.9751C37.119 43.535 37.0244 44.1059 36.8875 44.3362C36.2874 45.3491 26.5919 44.9831 23.7927 44.6678V44.5178Z" fill="#333"/><path fill-rule="evenodd" clip-rule="evenodd" d="M36.3386 20.9326C34.6979 21.3809 29.856 22.5505 23.8144 22.5914H23.7698C17.5753 22.5491 12.6423 21.3214 11.1274 20.8999C10.816 20.8129 10.6458 20.6334 10.6458 20.6334C10.644 20.5785 10.6207 19.6503 10.6207 19.171C10.6207 11.1055 14.4284 3.00029 23.7922 3C33.1561 3.00029 36.9635 11.1052 36.9635 19.1713C36.9635 19.65 36.9402 20.5785 36.9387 20.6337C36.9387 20.6337 36.7297 20.8255 36.3386 20.9326ZM38.8284 25.3504C39.3462 26.7001 39.8573 28.1055 40.2318 29.3107C42.0176 35.0578 41.4388 37.4364 40.9986 37.4898C40.0532 37.6039 37.3187 33.1634 37.3187 33.1634C37.3187 37.6757 33.2448 44.604 23.916 44.6677H23.6685C14.3394 44.604 10.2655 37.6757 10.2655 33.1634C10.2655 33.1634 7.53131 37.6039 6.58588 37.4895C6.14542 37.4364 5.5666 35.0581 7.35268 29.3107C7.72717 28.1058 8.23827 26.7001 8.75609 25.3504C8.75609 25.3504 9.10519 25.3285 9.28207 25.3795C10.7319 25.798 12.2762 26.1689 13.8447 26.4792C13.5776 28.1343 13.4249 30.1827 13.5692 32.6021C13.9533 39.0363 17.7745 43.081 23.6727 43.1394H23.9121C29.8106 43.081 33.6314 39.0363 34.0161 32.6021C34.1604 30.1823 34.0075 28.1345 33.7402 26.4793C35.3363 26.1633 36.9076 25.7848 38.3798 25.3571C38.5307 25.3136 38.8284 25.3504 38.8284 25.3504ZM33.7402 26.4793C30.3004 27.1601 26.7448 27.5502 23.8144 27.5147H23.7698C20.8396 27.5498 17.2841 27.1598 13.8447 26.4792C13.8586 26.3929 13.8728 26.3076 13.8874 26.2234C17.3136 26.8989 20.8513 27.2853 23.769 27.2503H23.8137L23.814 27.25C26.7323 27.2856 30.2709 26.8989 33.6974 26.2231C33.712 26.3074 33.7262 26.3928 33.7402 26.4793ZM18.0376 11.6868C18.1059 13.5266 19.1912 14.9735 20.4615 14.916C21.7309 14.8594 22.7044 13.3208 22.6349 11.4802C22.566 9.6398 21.4811 8.19348 20.2122 8.2504C18.9419 8.30791 17.9687 9.84646 18.0376 11.6868ZM27.1253 14.916C28.3957 14.9735 29.4809 13.5263 29.5489 11.6868C29.6181 9.84646 28.6449 8.30791 27.3746 8.2504C26.1055 8.19378 25.0208 9.64009 24.9519 11.4805C24.8825 13.3208 25.8556 14.8591 27.1253 14.916ZM23.8148 15.9248C28.0469 15.9248 31.4658 16.7625 31.805 17.5141V17.5144C31.821 17.5477 31.8295 17.5841 31.8298 17.621C31.8294 17.6731 31.8131 17.7238 31.7831 17.7663C31.497 18.1835 27.701 20.2436 23.8148 20.2436H23.7692C19.8827 20.2436 16.0867 18.1829 15.8006 17.7663C15.7708 17.7239 15.7545 17.6734 15.7539 17.6216C15.7542 17.5845 15.7627 17.5479 15.7787 17.5144C16.1182 16.7625 19.5368 15.9248 23.7692 15.9248H23.8148Z" fill="#333"/><path d="M22.0218 11.7142C22.0799 12.441 21.6812 13.0867 21.1327 13.157C20.5831 13.2277 20.0912 12.6958 20.0329 11.969C19.9754 11.2416 20.3735 10.596 20.9211 10.5259C21.4716 10.4547 21.9643 10.9871 22.0218 11.7139V11.7142ZM25.5117 11.9571C25.624 11.7559 26.3885 10.6984 27.9714 11.0834C28.3874 11.1847 28.5797 11.3336 28.6203 11.392C28.6801 11.4784 28.6968 11.6015 28.6358 11.7673C28.5155 12.096 28.2671 12.087 28.1296 12.0227C28.0406 11.9813 26.9381 11.2463 25.9223 12.3429C25.8523 12.418 25.7274 12.4439 25.6091 12.3546C25.4903 12.2647 25.4416 12.0832 25.5117 11.9571Z" fill="#333"/><path d="M15.5039 26.7117V33.0437C15.5039 33.0437 18.4044 33.6286 21.3105 33.2235V27.383C19.4695 27.2788 17.4841 27.0468 15.5039 26.7117Z" fill="#333"/><path d="M36.9385 20.6337C36.9385 20.6337 31.2962 22.4148 23.8142 22.4653H23.7695C16.2998 22.4151 10.6648 20.6395 10.6456 20.6337L8.75586 25.35C13.4824 26.775 19.3401 27.6933 23.7695 27.6399H23.8142C28.2436 27.6933 34.101 26.775 38.8282 25.35L36.9385 20.6337Z" fill="#333"/></svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M23 43H43V5H14V15" stroke="#333" stroke-width="2" stroke-linejoin="round"/><path d="M5 15H23V43H5L5 15Z" fill="none" stroke="#333" stroke-width="2" stroke-linejoin="round"/><path d="M13 37H15" stroke="#333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M28 37H30" stroke="#333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 519 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M6.414 16L16.556 5.858l-1.414-1.414L5 14.586V16h1.414zm.829 2H3v-4.243L14.435 2.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 18zM3 20h18v2H3v-2z"/></svg>

After

Width:  |  Height:  |  Size: 295 B

View File

@ -13,6 +13,8 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("GB2312"));
QApplication a(argc, argv); QApplication a(argc, argv);
QFont font; QFont font;

View File

@ -15,6 +15,7 @@ MainWindow::MainWindow(QWidget *parent)
, ui(new Ui::MainWindow) , ui(new Ui::MainWindow)
{ {
ui->setupUi(this); ui->setupUi(this);
initEnvironmentPATH(); initEnvironmentPATH();
/*加载动画GIF*/ /*加载动画GIF*/
@ -26,7 +27,8 @@ MainWindow::MainWindow(QWidget *parent)
/*devList 中的当前设备索引*/ /*devList 中的当前设备索引*/
current_device = 0; current_device = 0;
ui->comboBox->setPlaceholderText("点击此处选择设备"); ui->dynamic_island->setText("请先选择设备");
//ui->comboBox->setPlaceholderText("点击此处选择设备");
/*连接信号与槽*/ /*连接信号与槽*/
connect(this->ui->comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(setCurrentDevice(int))); //更改当前设备 connect(this->ui->comboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(setCurrentDevice(int))); //更改当前设备
@ -36,6 +38,9 @@ MainWindow::MainWindow(QWidget *parent)
/*设置界面*/ /*设置界面*/
addIndexItems(); //设置左侧目录 addIndexItems(); //设置左侧目录
setStyles(); //设置样式 setStyles(); //设置样式
view = new comboboxListWidget(ui->comboBox);
ui->comboBox->setModel(view->model());
ui->comboBox->setView(view);
/*初始化对象*/ /*初始化对象*/
process = new adbProcess(); process = new adbProcess();
@ -43,8 +48,6 @@ MainWindow::MainWindow(QWidget *parent)
maker = new pageMaker(); maker = new pageMaker();
listener = new usb_listener(); listener = new usb_listener();
//connect(listener, SIGNAL(DevicePlugIn()),this,SLOT(DevicePlugIn()));
//connect(listener, SIGNAL(DevicePlugOut()),this,SLOT(DevicePlugOut()));
connect(listener, SIGNAL(DeviceChanged()),this,SLOT(refreshDevListLater())); connect(listener, SIGNAL(DeviceChanged()),this,SLOT(refreshDevListLater()));
connect(this, SIGNAL(adbDeviceChanged()),this,SLOT(DeviceChanged())); connect(this, SIGNAL(adbDeviceChanged()),this,SLOT(DeviceChanged()));
@ -80,33 +83,76 @@ MainWindow::~MainWindow()
void MainWindow::initEnvironmentPATH() //方法:设置环境变量 void MainWindow::initEnvironmentPATH() //方法:设置环境变量
{ {
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF_8"));
/*
QString envPath = qgetenv("PATH"); //获取当前环境变量 QString envPath = qgetenv("PATH"); //获取当前环境变量
QString appDirPath = QApplication::applicationDirPath(); //获取程序所在位置 QString appDirPath = QApplication::applicationDirPath(); //获取程序所在位置
QString userPath = appDirPath + "\\platform-tools"; //向字符串中添加ADB环境 QString userPath = appDirPath + "\\platform-tools"; //向字符串中添加ADB环境
envPath += QDir::toNativeSeparators(userPath).prepend(';'); envPath += QDir::toNativeSeparators(userPath).prepend(';');
qputenv("PATH",envPath.toStdString().c_str()); //更改环境变量 qputenv("PATH",envPath.toStdString().c_str());*/ //更改环境变量
//qDebug() << envPath.toStdString().c_str(); //qDebug() << envPath.toStdString().c_str();
//QTextCodec *code = QTextCodec::codecForName("UTF_8");
QString envPath = qgetenv("PATH"); //获取当前环境变量
//qDebug() << "envpath" << envPath;
//QMessageBox::warning(NULL, "nvpath",envPath);
QString appDirPath = QApplication::applicationDirPath(); //获取程序所在位置
//qDebug() << "appDirPath" << appDirPath;
if(appDirPath.contains(QRegularExpression("[\u4e00-\u9fa5]")))
{
//qDebug() << "-------------------" << appDirPath.contains(QRegularExpression("[\\x4e00-\\x9fa5]+"));
//qDebug() << "\\x4e00" ;
//qDebug() << "\\x9fa5" ;
QMessageBox::warning(NULL, "路径问题","请将程序置于纯英文路径下否则将无法正确设置ADB环境\n"
"您当前的路径为:\n"
+ appDirPath);
}
#ifdef Q_OS_WIN32
QString userPath = appDirPath + "\\platform-tools"; //向字符串中添加ADB环境
#endif
#ifdef Q_OS_OSX
QString userPath = appDirPath + "\\platform-tools-OSX"; //向字符串中添加ADB环境
#endif
#ifdef Q_OS_LINUX
QString userPath = appDirPath + "\\platform-tools-linux"; //向字符串中添加ADB环境
#endif
//QString userPath = appDirPath + "\\platform-tools"; //向字符串中添加ADB环境
//qDebug() << "userPath" << userPath;
//QMessageBox::warning(NULL, "userPath",userPath);
envPath += QDir::toNativeSeparators(userPath).prepend(';');
//qDebug() << "envPath" << envPath;
//QMessageBox::warning(NULL, "envPath",envPath);
qputenv("PATH",envPath.toStdString().c_str()); //更改环境变量
} }
void MainWindow::refreshDevList() //方法:刷新设备列表 void MainWindow::refreshDevList() //方法:刷新设备列表
{ {
//ui->comboBox->clear(); //ui->comboBox->clear();
/*DEBUG*/ /*DEBUG*/
bool changed = false; bool changed = false; //这个是判断列表有没有变化用的
//qDebug() << "******************一次调用*********************"; //qDebug() << "******************一次调用*********************";
//qDebug() << "refreshDevList devList is empty? " << devList.isEmpty() << QTime::currentTime(); //qDebug() << "refreshDevList devList is empty? " << devList.isEmpty() << QTime::currentTime();
//qDebug() << "devList.size()" << devList.size(); //qDebug() << "devList.size()" << devList.size();
/*
for(int i = 0; i < devList.size();i++) for(int i = 0; i < devList.size();i++)
{ {
//qDebug() << "devList[" << i << "] is :" << devList[i].addr; //qDebug() << "devList[" << i << "] is :" << devList[i].addr;
} }
*/
/*DEBUG_END*/ /*DEBUG_END*/
//qDebug() << "shit 0"; //qDebug() << "shit 0";
bool devList_is_empty = devList.isEmpty(); bool devList_is_empty = devList.isEmpty();
QList<device> tmpList; QList<device> tmpList; //暂时的list存储刷新前的devlist用来与之后的devlist对比以确认设备是否有改变
/*给tmpList赋值*/ /*给tmpList赋值*/
if(!devList_is_empty) if(!devList_is_empty)
@ -188,8 +234,10 @@ void MainWindow::refreshDevList() //方法:刷新设备列
QStringList l; QStringList l;
l.clear(); l.clear();
/*一条一条添加*/
for (int i = 0 ; i < devList.size() ; i++ ) for (int i = 0 ; i < devList.size() ; i++ )
{ {
/*原来的*/
QString devItem = devList[i].state + " " + explainer->get_words_after(devList[i].model, ":") + " " + devList[i].addr; QString devItem = devList[i].state + " " + explainer->get_words_after(devList[i].model, ":") + " " + devList[i].addr;
l.append(devItem); l.append(devItem);
//qDebug() << "l[" << i << "] = " << l[i]; //qDebug() << "l[" << i << "] = " << l[i];
@ -201,40 +249,58 @@ void MainWindow::refreshDevList() //方法:刷新设备列
ui->comboBox->setItemData(i, v, Qt::UserRole - 1); ui->comboBox->setItemData(i, v, Qt::UserRole - 1);
*/ */
} }
/*原来的END*/
/*新的*/
if(changed) //changed为true则设备列表有所变化此时才更新
{
//qDebug() <<"changed so clear";
ui->comboBox->clear();
view->setUpList(devList, off);
qDebug() << "1";
}
/*新的END*/
} }
if(changed) /*出意外弄回来
if(changed) //changed为true则设备列表有所变化此时才更新
{ {
//qDebug() <<"changed so clear"; //qDebug() <<"changed so clear";
ui->comboBox->clear(); ui->comboBox->clear();
ui->comboBox->addItems(l); ui->comboBox->addItems(l);
} }*/
if(!liangYi) if(!liangYi) //
{ {
//qDebug() <<"liangYi so clear";
ui->comboBox->clear(); ui->comboBox->clear();
ui->comboBox->addItems(l); view->setUpList(devList, off);
} }
liangYi = false; liangYi = false;
/*将离线设备设为不可选*/
for(int i = 0; i < off.count();i++) for(int i = 0; i < off.count();i++)
{ {
QVariant v(0); QVariant v(0);
ui->comboBox->setItemData(off[i], v, Qt::UserRole - 1); ui->comboBox->setItemData(off[i], v, Qt::UserRole - 1);
} }
/*若没有设备,重置*/
if(devList.isEmpty()) if(devList.isEmpty())
{ {
current_device = -1; //重设当前设备 current_device = -1; //重设当前设备
ui->dynamic_island->setText("请先选择设备");
} }
else else
{ {
current_device = 0; current_device = 0;
ui->dynamic_island->setText(devList[current_device].addr);
} }
liangYi = false; liangYi = false; //重置两仪
//qDebug() << "******************一次调用结束*********************"; //qDebug() << "******************一次调用结束*********************";
} }
@ -271,36 +337,38 @@ void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮
void MainWindow::setCurrentDevice(int index) //槽:改变所选设备 void MainWindow::setCurrentDevice(int index) //槽:改变所选设备
{ {
qDebug() <<"MainWindow:if"; //qDebug() <<"MainWindow:if" << "index = " << index;
if(thread_mon != NULL && siXiangTimer != NULL) if(thread_mon != NULL && siXiangTimer != NULL)
{ {
qDebug() <<"stop"; //qDebug() <<"stop";
//siXiangTimer->stop(); //siXiangTimer->stop();
qDebug() <<"delete"; //qDebug() <<"delete";
siXiangTimer->deleteLater(); siXiangTimer->deleteLater();
qDebug() <<"=NULL"; //qDebug() <<"=NULL";
siXiangTimer = NULL; siXiangTimer = NULL;
qDebug() <<"thread_mon != NULL"; //qDebug() <<"thread_mon != NULL";
qDebug() <<"disconnect"; //qDebug() <<"disconnect";
thread_mon->disconnect(); thread_mon->disconnect();
qDebug() <<"exit()"; //qDebug() <<"exit()";
thread_mon->quit(); thread_mon->quit();
qDebug() <<"deleteLater()"; //qDebug() <<"deleteLater()";
thread_mon->deleteLater(); thread_mon->deleteLater();
} }
//ui->widget_height->layout()->addWidget(ui->comboBox.it)
if(index >= 0) if(index >= 0)
{ {
qDebug() <<"NEW"; //qDebug() <<"NEW";
siXiangTimer = new QTimer(); siXiangTimer = new QTimer();
thread_mon = new thread_monitor(devList[current_device]); thread_mon = new thread_monitor(devList[current_device]);
qDebug() <<"CONNECT"; //qDebug() <<"devList[current_device]:" << "current_device=" << current_device << "dev:" << devList[current_device].addr;
//qDebug() <<"CONNECT";
connect(siXiangTimer,SIGNAL(timeout()),thread_mon,SLOT(getInfo())); connect(siXiangTimer,SIGNAL(timeout()),thread_mon,SLOT(getInfo()));
connect(thread_mon,SIGNAL(signal_monitor(float,float)),this,SLOT(slot_update_monitor(float,float))); connect(thread_mon,SIGNAL(signal_monitor(float,float)),this,SLOT(slot_update_monitor(float,float)));
qDebug() <<"START"; //qDebug() <<"START";
thread_mon->start(); thread_mon->start();
siXiangTimer->start(2000); siXiangTimer->start(2000);
ui->progressBar_CPU->setRange(0,100); ui->progressBar_CPU->setRange(0,100);
@ -333,6 +401,8 @@ void MainWindow::setCurrentDevice(int index) //槽:改变所选设备
//qDebug() << "setCurrentRow"; //qDebug() << "setCurrentRow";
ui->indexList->setCurrentRow(0); ui->indexList->setCurrentRow(0);
} }
ui->dynamic_island->setText(explainer->get_words_after(devList[current_device].model,":"));
} }
unlock(); unlock();
} }
@ -477,12 +547,12 @@ void MainWindow::setStyles() //方法:设置样式
"QListView::item{height:35px;}" "QListView::item{height:35px;}"
); );
ui->comboBox->setStyleSheet("QComboBox{color:black; border:0px; border-bottom:1px solid #BDBDBD; border-radius:0px; background-color:transparent;}" ui->comboBox->setStyleSheet("QComboBox{color:black; border:0px solid #BDBDBD; border-radius:4px; background-color:rgba(255,255,255,0.9);image:url(:/ico/image/ico/devices.svg);background-color:rgba(255,255,255,0.9);}"
"QComboBox::drop-down{border: 0px solid rgba(255,255,255,0);background-color:rgba(255,255,255,0);border-bottom-right-radius: 0px;}" "QComboBox::drop-down{border: 0px solid rgba(255,255,255,0);background-color:rgba(255,255,255,0);border-radius: 8px;}"
"QComboBox QAbstractItemView{border:1px solid #BDBDBD;border-radius:0px 0px 0px 0px;outline: 0px;}" "QComboBox QAbstractItemView{border:1px solid #BDBDBD;border-radius:0px 0px 0px 0px;outline: 0px;background-color:rgba(255,255,255,0);}"
"QComboBox QAbstractItemView::item{height:30px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;}" "QComboBox QAbstractItemView::item{height:300px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;background-color:rgba(255,255,255,255);}"//height:30px;
"QComboBox QAbstractItemView::item:hover{height:30px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;color:black}" "QComboBox QAbstractItemView::item:hover{height:300px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;color:black;background-color:rgba(255,255,255,255);}"
"QComboBox QAbstractItemView::item:selected{height:30px;border:1px solid #BDBDBD;border-radius:0px 0px 0px 0px;color:black}" "QComboBox QAbstractItemView::item:selected{height:300px;border:0px solid #BDBDBD;border-radius:0px 0px 0px 0px;color:black;background-color:rgba(255,255,255,255);}"
); );
/* /*
@ -517,18 +587,40 @@ void MainWindow::setStyles() //方法:设置样式
shadowEffect_cmdBtn->setColor(Qt::gray); shadowEffect_cmdBtn->setColor(Qt::gray);
shadowEffect_cmdBtn->setBlurRadius(5); shadowEffect_cmdBtn->setBlurRadius(5);
/* QGraphicsDropShadowEffect *shadowEffect_island = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_monitor = new QGraphicsDropShadowEffect(this); shadowEffect_island->setOffset(0,0);
shadowEffect_monitor->setOffset(0,0); shadowEffect_island->setColor(Qt::gray);
shadowEffect_monitor->setColor(Qt::gray); shadowEffect_island->setBlurRadius(5);
shadowEffect_monitor->setBlurRadius(5);*/
QGraphicsDropShadowEffect *shadowEffect_combo = new QGraphicsDropShadowEffect(this);
shadowEffect_combo->setOffset(0,0);
shadowEffect_combo->setColor(Qt::gray);
shadowEffect_combo->setBlurRadius(5);
QGraphicsDropShadowEffect *shadowEffect_CPU = new QGraphicsDropShadowEffect(this);
shadowEffect_CPU->setOffset(0,0);
shadowEffect_CPU->setColor(Qt::gray);
shadowEffect_CPU->setBlurRadius(5);
QGraphicsDropShadowEffect *shadowEffect_RAM = new QGraphicsDropShadowEffect(this);
shadowEffect_RAM->setOffset(0,0);
shadowEffect_RAM->setColor(Qt::gray);
shadowEffect_RAM->setBlurRadius(5);
ui->refreshButton->setGraphicsEffect(shadowEffect_refreshButton); ui->refreshButton->setGraphicsEffect(shadowEffect_refreshButton);
ui->adbKillerBtn->setGraphicsEffect(shadowEffect_killAdbBtn); ui->adbKillerBtn->setGraphicsEffect(shadowEffect_killAdbBtn);
ui->WIFIBtn->setGraphicsEffect(shadowEffect_testBtn); ui->WIFIBtn->setGraphicsEffect(shadowEffect_testBtn);
ui->WSABtn->setGraphicsEffect(shadowEffect_WSABtn); ui->WSABtn->setGraphicsEffect(shadowEffect_WSABtn);
ui->cmdBtn->setGraphicsEffect(shadowEffect_cmdBtn); ui->cmdBtn->setGraphicsEffect(shadowEffect_cmdBtn);
//ui->widget_monitor->setGraphicsEffect(shadowEffect_monitor); ui->dynamic_island->setGraphicsEffect(shadowEffect_island);
ui->comboBox->setGraphicsEffect(shadowEffect_combo);
ui->widget_mon_CPU->setGraphicsEffect(shadowEffect_CPU);
ui->widget_mon_RAM->setGraphicsEffect(shadowEffect_RAM);
ui->comboBox->setMaxVisibleItems(1);
ui->comboBox->view()->window()->setWindowFlags(Qt::Popup | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint);
ui->comboBox->view()->window()->setAttribute(Qt::WA_TranslucentBackground);
QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
} }
void MainWindow::initSonPage(int key) //槽:生成子页面 void MainWindow::initSonPage(int key) //槽:生成子页面
@ -774,7 +866,7 @@ void MainWindow::slot_refreshDevList()
void MainWindow::refreshDevListLater() void MainWindow::refreshDevListLater()
{ {
//qDebug() << ">>>>>>>>>>>>>>>>>>>>>>refreshDevListLater"; qDebug() << ">>>>>>>>>>>>>>>>>>>>>>refreshDevListLater";
QTimer *timer = new QTimer(); QTimer *timer = new QTimer();
connect(timer, SIGNAL(timeout()), this, SLOT(slot_refreshDevList())); connect(timer, SIGNAL(timeout()), this, SLOT(slot_refreshDevList()));
timer->setSingleShot(true); timer->setSingleShot(true);

View File

@ -1,9 +1,5 @@
#ifndef MAINWINDOW_H #ifndef MAINWINDOW_H
#define MAINWINDOW_H #define MAINWINDOW_H
/*
#define 布尔 bool
#define 为 =
#define 真 true*/
#include <QMainWindow> #include <QMainWindow>
#include <QDir> #include <QDir>
@ -13,6 +9,8 @@
#include <QScroller> #include <QScroller>
#include <QLineEdit> #include <QLineEdit>
#include <QMouseEvent> #include <QMouseEvent>
#include <QTextCodec>
#include <QRegExp>
#include "adbprocess.h" #include "adbprocess.h"
#include "textexplainer.h" #include "textexplainer.h"
#include "indexlistitem.h" #include "indexlistitem.h"
@ -21,6 +19,8 @@
#include "about.h" #include "about.h"
#include "usb_listener.h" #include "usb_listener.h"
#include "threads/thread_monitor.h" #include "threads/thread_monitor.h"
#include "devitem.h"
#include "abstract/comboboxlistwidget.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QStringList> #include <QStringList>
@ -87,12 +87,11 @@ private:
void setStyles(); void setStyles();
bool taiChi = true; //界面锁定定时器 bool taiChi = true; //界面锁定定时器
bool liangYi = false; //判断刷新按钮槽函数是被谁调用falseclick调用 true 自行connect bool liangYi = false; //判断刷新按钮槽函数是被谁调用false刷新按钮 click调用 true 热插拔相关
bool bagua = true; //忘了是干啥的了 bool bagua = true; //忘了是干啥的了
//布尔 太极 为 真; //布尔 太极 为 真;
bool firstBoot = true; bool firstBoot = true;
QTimer *taiChiTimer; QTimer *taiChiTimer;
QTimer *baguaTimer; QTimer *baguaTimer;
@ -105,13 +104,14 @@ private:
thread_monitor *thread_mon = NULL; thread_monitor *thread_mon = NULL;
comboboxListWidget *view;
public slots: public slots:
void DevicePlugIn(); void DevicePlugIn();
void DevicePlugOut(); void DevicePlugOut();
void DeviceChanged(); void DeviceChanged();
void slot_refreshDevList(); void slot_refreshDevList(); //如下
void refreshDevListLater(); void refreshDevListLater(); //与信号 usb_listener 连接的槽在设备热插拔后启动定时器超时1s后调用slot_refreshDevList();
void slot_update_monitor(float,float); void slot_update_monitor(float,float);
void reset_monitorBars(); void reset_monitorBars();
}; };

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>954</width> <width>954</width>
<height>567</height> <height>562</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -18,7 +18,10 @@
/*background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(238, 154, 229, 255), stop:1 rgba(89, 97, 249, 255));*/</string> /*background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1, stop:0 rgba(238, 154, 229, 255), stop:1 rgba(89, 97, 249, 255));*/</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="leftMargin">
<number>11</number>
</property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -28,203 +31,50 @@
<string notr="true"/> <string notr="true"/>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>11</number> <number>11</number>
</property> </property>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,10"> <widget class="QWidget" name="widget_left" native="true">
<property name="topMargin"> <property name="minimumSize">
<number>5</number> <size>
<width>260</width>
<height>0</height>
</size>
</property> </property>
<item> <property name="maximumSize">
<widget class="QWidget" name="widget_monitor" native="true"> <size>
<property name="minimumSize"> <width>260</width>
<size> <height>16777215</height>
<width>250</width> </size>
<height>100</height> </property>
</size> <property name="styleSheet">
</property> <string notr="true">background-color:rgba(255,255,255,0);border-radius:0px;border:0px;</string>
<property name="maximumSize"> </property>
<size> <layout class="QVBoxLayout" name="verticalLayout_5">
<width>250</width> <property name="leftMargin">
<height>100</height> <number>5</number>
</size> </property>
</property> <property name="topMargin">
<property name="styleSheet"> <number>0</number>
<string notr="true">background-color:rgba(255,255,255,0.9);border-radius:4px;border:1px solid #BDBDBD;</string> </property>
</property> <property name="rightMargin">
<layout class="QVBoxLayout" name="verticalLayout_7"> <number>5</number>
<property name="leftMargin"> </property>
<number>14</number> <property name="bottomMargin">
<number>5</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,10">
<property name="spacing">
<number>8</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<property name="rightMargin">
<number>14</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="spacing">
<number>3</number>
</property>
<item>
<widget class="QLabel" name="label_CPU">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);border:0px;</string>
</property>
<property name="text">
<string>CPU</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_RAM">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);border:0px;</string>
</property>
<property name="text">
<string>RAM</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>3</number>
</property>
<item>
<widget class="QProgressBar" name="progressBar_CPU">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
<pointsize>9</pointsize>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QProgressBar{
font:9pt;
border-radius:4px;
text-align:center;
/*border:1px solid #E8EDF2;*/
border:0px solid #E8EDF2;
background-color: #E0E0E0;
}
QProgressBar:chunk{
border-radius:4px;
background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #38ef7d, stop:1 #11998e);
}
</string>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>50</number>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar_RAM">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
<pointsize>9</pointsize>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QProgressBar{
font:9pt;
border-radius:4px;
text-align:center;
/*border:1px solid #E8EDF2;*/
border:0px solid #E8EDF2;
background-color: #E0E0E0;
}
QProgressBar:chunk{
border-radius:4px;
background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #38ef7d, stop:1 #11998e);
}
</string>
</property>
<property name="value">
<number>50</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing"> <property name="spacing">
@ -235,13 +85,13 @@ QProgressBar:chunk{
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>30</height> <height>28</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>210</width> <width>16777215</width>
<height>30</height> <height>28</height>
</size> </size>
</property> </property>
<property name="cursor"> <property name="cursor">
@ -253,14 +103,14 @@ QProgressBar:chunk{
<widget class="QPushButton" name="refreshButton"> <widget class="QPushButton" name="refreshButton">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>30</width> <width>28</width>
<height>30</height> <height>28</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>30</width> <width>28</width>
<height>30</height> <height>28</height>
</size> </size>
</property> </property>
<property name="cursor"> <property name="cursor">
@ -291,32 +141,76 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QLabel" name="dynamic_island">
<property name="minimumSize">
<size>
<width>0</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="maximumSize">
<size>
<width>14</width>
<height>14</height>
</size>
</property>
<property name="baseSize">
<size>
<width>14</width>
<height>14</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="indexList">
<property name="minimumSize">
<size>
<width>250</width>
<height>300</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<height>16777215</height>
</size>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
</item>
</layout> </layout>
</widget> </item>
</item> </layout>
<item> </widget>
<widget class="QListWidget" name="indexList">
<property name="minimumSize">
<size>
<width>250</width>
<height>300</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<height>16777215</height>
</size>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="fakeSpacer"> <widget class="QLabel" name="fakeSpacer">
@ -341,6 +235,9 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0"> <layout class="QVBoxLayout" name="verticalLayout_4" stretch="0,0">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>9</number>
</property>
<property name="leftMargin"> <property name="leftMargin">
<number>11</number> <number>11</number>
</property> </property>
@ -528,6 +425,234 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="spacing">
<number>8</number>
</property>
<item>
<widget class="QWidget" name="widget_mon_CPU" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
<number>10</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_CPU">
<property name="minimumSize">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);border:0px;</string>
</property>
<property name="text">
<string>CPU</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar_CPU">
<property name="minimumSize">
<size>
<width>0</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
<pointsize>9</pointsize>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QProgressBar{
font:9pt;
border-radius:4px;
text-align:center;
/*border:1px solid #E8EDF2;*/
border:0px solid #E8EDF2;
background-color: rgba(255, 255, 255, 0);
}
QProgressBar:chunk{
border-radius:4px;
background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #38ef7d, stop:1 #11998e);
}
</string>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>50</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_mon_RAM" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="spacing">
<number>10</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_RAM">
<property name="minimumSize">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);border:0px;</string>
</property>
<property name="text">
<string>RAM</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar_RAM">
<property name="minimumSize">
<size>
<width>0</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>28</height>
</size>
</property>
<property name="font">
<font>
<family>MiSans Medium</family>
<pointsize>9</pointsize>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QProgressBar{
font:9pt;
border-radius:4px;
text-align:center;
/*border:1px solid #E8EDF2;*/
border:0px solid #E8EDF2;
background-color: rgba(255, 255, 255, 0);
}
QProgressBar:chunk{
border-radius:4px;
background-color:qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #38ef7d, stop:1 #11998e);
}
</string>
</property>
<property name="value">
<number>50</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item> <item>
<spacer name="horizontalSpacer_2"> <spacer name="horizontalSpacer_2">
<property name="orientation"> <property name="orientation">

View File

@ -14,6 +14,12 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="styleSheet"> <property name="styleSheet">
@ -198,7 +204,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset> <iconset resource="../../ico.qrc">
<normaloff>:/ico/image/ico/arrow-left-line.svg</normaloff>:/ico/image/ico/arrow-left-line.svg</iconset> <normaloff>:/ico/image/ico/arrow-left-line.svg</normaloff>:/ico/image/ico/arrow-left-line.svg</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
@ -238,7 +244,7 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
<string/> <string/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset> <iconset resource="../../ico.qrc">
<normaloff>:/ico/image/ico/refresh-line.svg</normaloff>:/ico/image/ico/refresh-line.svg</iconset> <normaloff>:/ico/image/ico/refresh-line.svg</normaloff>:/ico/image/ico/refresh-line.svg</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
@ -258,6 +264,8 @@ QPushButton:pressed{background-color:rgba(255,255,255,0.6);}</string>
</item> </item>
</layout> </layout>
</widget> </widget>
<resources/> <resources>
<include location="../../ico.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -22,6 +22,12 @@
<string notr="true">background-color: rgb(255, 255, 255);</string> <string notr="true">background-color: rgb(255, 255, 255);</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="styleSheet"> <property name="styleSheet">

View File

@ -29,9 +29,6 @@ sp_scales::sp_scales(QWidget *parent) :
ui->lineEdit_transition->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"))); ui->lineEdit_transition->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$")));
ui->lineEdit_animator->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"))); ui->lineEdit_animator->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$")));
ui->lineEdit_window->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$"))); ui->lineEdit_window->setValidator(new QRegularExpressionValidator(QRegularExpression("^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$")));
} }
sp_scales::~sp_scales() sp_scales::~sp_scales()

View File

@ -17,6 +17,15 @@
<string notr="true">background-color: rgb(255, 255, 255);</string> <string notr="true">background-color: rgb(255, 255, 255);</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="styleSheet"> <property name="styleSheet">

View File

@ -14,9 +14,15 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="styleSheet"> <property name="styleSheet">

View File

@ -14,9 +14,15 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="styleSheet"> <property name="styleSheet">

View File

@ -14,9 +14,15 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="styleSheet"> <property name="styleSheet">

View File

@ -14,9 +14,15 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="styleSheet"> <property name="styleSheet">

View File

@ -14,9 +14,15 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="styleSheet"> <property name="styleSheet">

View File

@ -14,9 +14,15 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="styleSheet"> <property name="styleSheet">

View File

@ -14,6 +14,15 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="styleSheet"> <property name="styleSheet">

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@ QList<device> textExplainer::getDevList(QString tmpStr)
for(int i = 1; i < tmpList.size() ; i++) for(int i = 1; i < tmpList.size() ; i++)
{ {
qDebug() << "fuckQt1";
//qDebug() << "tmplist[" << i << "]\n"; //qDebug() << "tmplist[" << i << "]\n";
tmpList[i] = tmpList[i].simplified(); tmpList[i] = tmpList[i].simplified();
@ -89,6 +89,11 @@ QList<device> textExplainer::getDevList_windows(QString tmpStr)
if(dev.state == "[未响应]") if(dev.state == "[未响应]")
{ {
dev.transport_id = tmp[2]; dev.transport_id = tmp[2];
dev.device_product = "unknown";
dev.model = "unknown";
dev.device_debug = "unknown";
devList.append(dev); devList.append(dev);
continue; continue;
} }
@ -98,6 +103,7 @@ QList<device> textExplainer::getDevList_windows(QString tmpStr)
dev.model = tmp[3]; dev.model = tmp[3];
dev.device_debug = tmp[4]; dev.device_debug = tmp[4];
dev.transport_id = tmp[5]; dev.transport_id = tmp[5];
devList.append(dev); devList.append(dev);
} }
//qDebug() << "**tmplist[" << i << "] =" << tmpList[i]; //qDebug() << "**tmplist[" << i << "] =" << tmpList[i];

View File

@ -1,9 +1,11 @@
#include "thread_monitor.h" #include "thread_monitor.h"
thread_monitor::thread_monitor(device dev) thread_monitor::thread_monitor(device d)
{ {
qDebug() << "******************************************" << dev.addr;
process = new adbProcess(); process = new adbProcess();
explainer = new textExplainer(); explainer = new textExplainer();
dev = d;
//timer = new QTimer(this); //timer = new QTimer(this);
//connect(timer,SIGNAL(timeout()),this,SLOT(getInfo())); //connect(timer,SIGNAL(timeout()),this,SLOT(getInfo()));
//adb shell cat /proc/meminfo //adb shell cat /proc/meminfo
@ -58,13 +60,13 @@ void thread_monitor::getInfo()
int MemTotal = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[0] , "MemTotal:") , "kB").simplified().simplified().toInt(); int MemTotal = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[0] , "MemTotal:") , "kB").simplified().simplified().toInt();
//int MemFree = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[1] , "MemFree:") , "kB").simplified().simplified().toInt(); //int MemFree = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[1] , "MemFree:") , "kB").simplified().simplified().toInt();
int MemAvailable = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[2] , "MemAvailable:") , "kB").simplified().simplified().toInt(); int MemAvailable = explainer->get_words_before(explainer->get_words_after(mem.split("\n")[2] , "MemAvailable:") , "kB").simplified().simplified().toInt();
qDebug() << "Mem = " << mem; //qDebug() << "Mem = " << mem;
qDebug() << "MemTotal = " << MemTotal; //qDebug() << "MemTotal = " << MemTotal;
//qDebug() << "MemFree = " << MemFree; //qDebug() << "MemFree = " << MemFree;
//float mem_use = (float)(MemTotal - MemFree) / (float)MemTotal; //float mem_use = (float)(MemTotal - MemFree) / (float)MemTotal;
float mem_use = (float)(MemTotal - MemAvailable) / (float)MemTotal; float mem_use = (float)(MemTotal - MemAvailable) / (float)MemTotal;
qDebug() << "mem_use = " << mem_use; //qDebug() << "mem_use = " << mem_use;
mem = ""; mem = "";
emit signal_monitor(cpu_use, mem_use); emit signal_monitor(cpu_use, mem_use);

View File

@ -242,3 +242,5 @@ Android 系统的可玩性在 adb 的加成下变得更加丰富,由此涌现
- Telegram@[LapplandSP](https://t.me/LapplandSP) - Telegram@[LapplandSP](https://t.me/LapplandSP)
- QQ频道 [点击加入](https://pd.qq.com/s/k96ej1)