精简与规范代码

This commit is contained in:
Lappland 2022-08-12 03:03:08 +08:00
parent 484a77eaa5
commit 15ffb4fd7d
19 changed files with 106 additions and 273 deletions

View File

@ -9,46 +9,46 @@ about::about(QWidget *parent) :
self_castrate();
QGraphicsDropShadowEffect *shadowEffect_btn_website = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_website = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_website->setOffset(0,0);
shadowEffect_btn_website->setColor(Qt::gray);
shadowEffect_btn_website->setBlurRadius(5);
ui->btn_website->setGraphicsEffect(shadowEffect_btn_website);
QGraphicsDropShadowEffect *shadowEffect_btn_coolapk = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_coolapk = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_coolapk->setOffset(0,0);
shadowEffect_btn_coolapk->setColor(Qt::gray);
shadowEffect_btn_coolapk->setBlurRadius(5);
ui->btn_coolapk->setGraphicsEffect(shadowEffect_btn_coolapk);
QGraphicsDropShadowEffect *shadowEffect_btn_github = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_github = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_github->setOffset(0,0);
shadowEffect_btn_github->setColor(Qt::gray);
shadowEffect_btn_github->setBlurRadius(5);
ui->btn_github->setGraphicsEffect(shadowEffect_btn_github);
QGraphicsDropShadowEffect *shadowEffect_btn_money = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_money = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_money->setOffset(0,0);
shadowEffect_btn_money->setColor(Qt::gray);
shadowEffect_btn_money->setBlurRadius(5);
ui->btn_money->setGraphicsEffect(shadowEffect_btn_money);
QGraphicsDropShadowEffect *shadowEffect_btn_money2 = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_money2 = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_money2->setOffset(0,0);
shadowEffect_btn_money2->setColor(Qt::gray);
shadowEffect_btn_money2->setBlurRadius(5);
ui->btn_money_2->setGraphicsEffect(shadowEffect_btn_money2);
QGraphicsDropShadowEffect *shadowEffect_btn_money3 = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_money3 = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_money3->setOffset(0,0);
shadowEffect_btn_money3->setColor(Qt::gray);
shadowEffect_btn_money3->setBlurRadius(5);
ui->btn_money_3->setGraphicsEffect(shadowEffect_btn_money3);
QGraphicsDropShadowEffect *shadowEffect_btn_money4 = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_money4 = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_money4->setOffset(0,0);
shadowEffect_btn_money4->setColor(Qt::gray);
shadowEffect_btn_money4->setBlurRadius(5);
ui->btn_money_4->setGraphicsEffect(shadowEffect_btn_money4);
QGraphicsDropShadowEffect *shadowEffect_btn_version = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_version = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_version->setOffset(0,0);
shadowEffect_btn_version->setColor(Qt::gray);
shadowEffect_btn_version->setBlurRadius(5);

View File

@ -4,7 +4,6 @@ adbProcess::adbProcess()
{
explainer = new textExplainer;
connect(this , SIGNAL(readyReadStandardError()) , this , SLOT(on_readerror()));
}
QString adbProcess::run(QString command) //Adb 命令解析 - 单条命令
@ -392,6 +391,7 @@ adbProcess::~adbProcess()
run("adb kill-server");
terminate();
waitForFinished();
delete explainer;
}
void adbProcess::on_readerror()

View File

@ -2,49 +2,15 @@
animationWidget::animationWidget(QWidget *p)
{
/*
graphicsOpacityEffect = new QGraphicsOpacityEffect(this);
graphicsOpacityEffect->setOpacity(1.0);
this->setGraphicsEffect(graphicsOpacityEffect);*/
animation = new QPropertyAnimation(this,"geometry");
setParent(p);
parent = p;
this->hide();
/*
animation->setDuration(500);
animation->setStartValue(QRect(this->geometry().x() + this->width()/2, this->geometry().y() + this->height()/2, this->width(),this->height()));
animation->setEndValue(this->geometry());*/
//animation->setEndValue(QRect(this->width(), 0, this->width(), this->height()));
/*
QPropertyAnimation *animation1= new QPropertyAnimation(this->centralWidget(),"geometry");
animation1->setDuration(500);
animation1->setStartValue(QRect(-this->centralWidget()->width(), 0, this->centralWidget()->width(), this->centralWidget()->height()));
animation1->setEndValue(this->centralWidget()->geometry());
QParallelAnimationGroup *group = new QParallelAnimationGroup;
group->addAnimation(animation);
group->addAnimation(animation1);
group->start();*/
}
void animationWidget::playLoadAnimation()
{
/*
opacityLoadAnimation = new QPropertyAnimation(graphicsOpacityEffect,"opacity",this);
opacityLoadAnimation->setDuration(500);
opacityLoadAnimation->setStartValue(0);
opacityLoadAnimation->setEndValue(1.0);
opacityLoadAnimation->start();*/
animation->setDuration(500);
//qDebug() << "parent is " << parent;
//qDebug() << "parent's geometry is " << parent->geometry();
/*
animation->setEndValue(QRect(parent->geometry().x(), parent->geometry().y(), this->width(),this->height()));
animation->setStartValue(QRect(parent->geometry().x() + 50, parent->geometry().y(), this->width(),this->height()));*/
animation->setDuration(750);
animation->setEndValue(QRect(301, 111, this->width(),this->height()));
animation->setStartValue(QRect(301 + 50, 111, this->width(),this->height()));
@ -57,17 +23,10 @@ void animationWidget::playLoadAnimation()
void animationWidget::playExitAnimation()
{
/*
opacityExitAnimation = new QPropertyAnimation(graphicsOpacityEffect,"opacity",this);
opacityExitAnimation->setDuration(500);
opacityExitAnimation->setStartValue(1.0);
opacityExitAnimation->setEndValue(0);
opacityExitAnimation->start();*/
}
animationWidget::~animationWidget()
{
playExitAnimation();
//delete this;
delete animation;
}

View File

@ -73,6 +73,7 @@ basePage::~basePage()
sonPage->~basePage();*/
//qDebug() << "~basePage deleted" << "\n";
delete SPManager;
delete ui;
}
/*

View File

@ -17,17 +17,11 @@ MainWindow::MainWindow(QWidget *parent)
initEnvironmentPATH();
/*加载动画GIF*/
movie = new QMovie(":/gif/image/gif/final.gif");
//sub = new QThread;
/*页面内容更新线程*/
//thread_BPCreator = new thread_createPage;
//thread_BPCreator->moveToThread(sub);
//sub->start();
//movie = new QMovie(":/gif/image/gif/final.gif");
/*currentPage指针*/
currentPage = NULL;
WCMPage = NULL;
//WCMPage = NULL;
/*devList 中的当前设备索引*/
current_device = 0;
@ -51,22 +45,18 @@ MainWindow::MainWindow(QWidget *parent)
process->run("adb server");
refreshDevList();
//displayWelcomePage();
//ui->indexList->setCurrentRow(7);
/*用户未选择设备前,锁定界面*/
this->update();
on_refreshButton_clicked();
//initBasePage(6);
lock();
//qDebug() << "1";
//displayWelcomePage();
//qDebug() << "2";
}
MainWindow::~MainWindow()
{
ui->indexList->clear();
delete process;
delete explainer;
delete maker;
delete ui;
}
@ -82,31 +72,22 @@ void MainWindow::initEnvironmentPATH() //方法:设置环境变
void MainWindow::refreshDevList() //方法:刷新设备列表
{
ui->comboBox->clear();
//qDebug() <<"aft";
devList.clear(); //清空设备列表
//qDebug() <<"affffter";
//qDebug() <<"before";
devList = explainer->getDevList_windows(process->run("adb devices -l")); //重新赋值
//qDebug() <<"after0";
/*将设备信息传入 List l 并将l的值显示在combobox中*/
QStringList l;
l.clear();
//qDebug() <<"beffffffore";
for (int i = 0 ; i < devList.size() ; i++ )
{
//qDebug() <<"beffffffore i = " << i;
QString devItem =devList[i].state + " " + explainer->get_words_after(devList[i].device_product, ":") + " " + explainer->get_words_after(devList[i].model, ":");
l.append(devItem);
}
//qDebug() <<"afttttttttttttttter";
ui->comboBox->addItems(l);
//qDebug() <<"afterrrrrrrr";
if(devList.isEmpty())
{
current_device = -1; //重设当前设备
@ -119,7 +100,6 @@ void MainWindow::refreshDevList() //方法:刷新设备列
void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮
{
//qDebug() <<"before";
refreshDevList();
lock();
@ -129,19 +109,20 @@ void MainWindow::on_refreshButton_clicked() //槽:按下刷新按钮
currentPage->~basePage();
currentPage = NULL;
}*/
initBasePage(6);
//ui->indexList->setCurrentRow(6);
qDebug() <<"8";
}
void MainWindow::setCurrentDevice(int index) //槽:改变所选设备
{
if(index > 0)
if(index >= 0)
{
if(currentPage != NULL)
{
currentPage->~basePage();
delete currentPage;
//currentPage->~basePage();
currentPage = NULL;
}
//initBasePage(6);
@ -151,11 +132,14 @@ void MainWindow::setCurrentDevice(int index) //槽:改变所选设备
//initBasePage(0);
if(ui->indexList->currentRow() == 0)
{
qDebug() << "initBasePage";
initBasePage(0);
}
else
{
qDebug() << "setCurrentRow";
ui->indexList->setCurrentRow(0);
}
}
unlock();
@ -167,32 +151,16 @@ void MainWindow::initBasePage(int key) //槽生成basePages
{
this->setEnabled(false);
if(WCMPage != NULL) //销毁欢迎页面
{
//currentPage->playExitAnimation();
//currentPage->setDisabled(true);
//delete currentPage;
WCMPage->~welcomePage();
WCMPage = NULL;
}
if(currentPage != NULL) //销毁上一个basePage
{
//currentPage->playExitAnimation();
//currentPage->setDisabled(true);
//delete currentPage;
//currentPage->setDisabled(true);
currentPage->~basePage();
delete currentPage;
//currentPage->~basePage();
currentPage = NULL;
}
currentPage = new basePage(this);
//devList[current_device];
//qDebug() <<"aaaaaaaaaaaaaaaaaafter";
qDebug() << "devlist is empty? " << devList.isEmpty();
if(devList.isEmpty())
{
device * noDevice = new device;
@ -201,18 +169,13 @@ void MainWindow::initBasePage(int key) //槽生成basePages
}
else
{
qDebug() << "devlist is not empty ,creating page with key " << key;
currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]);
qDebug() << "page created";
}
//qDebug() <<"aaaaaaaaaaaaaaaaaafterrrrrrrrrrrrrrrrrrrrrr";
//qDebug() << "currentPage = maker->createPageWithKey(key,ui->page,devList[current_device]); ended";
ui->verticalLayout_2->addWidget(currentPage);
currentPage->playLoadAnimation();
currentPage->repaint();
//currentPage->repaint();
this->setEnabled(true);
break;
@ -228,10 +191,6 @@ void MainWindow::addItemToIndex(indexListItem *itemWidget) //方法向indexi
void MainWindow::addIndexItems() //方法初始化向indexList中添加的item完成indexList创建。
{
/*
basePage *wgt = new basePage(this);
currentPage = wgt;*/
indexListItem *devInfo = new indexListItem(this->ui->indexList);
devInfo->setText("设备信息");
devInfo->setPic("image:url(:/ico/image/ico/smartphone-line.svg);background-color:rgba(255,255,255,0);");
@ -325,22 +284,22 @@ void MainWindow::setStyles() //方法:设置样式
ui->iconLabel->setStyleSheet("background-color:transparent;");
ui->fakeSpacer->setStyleSheet("background-color:transparent;");
QGraphicsDropShadowEffect *shadowEffect_refreshButton = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_refreshButton = new QGraphicsDropShadowEffect(this);
shadowEffect_refreshButton->setOffset(0,0);
shadowEffect_refreshButton->setColor(Qt::gray);
shadowEffect_refreshButton->setBlurRadius(5);
QGraphicsDropShadowEffect *shadowEffect_killAdbBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_killAdbBtn = new QGraphicsDropShadowEffect(this);
shadowEffect_killAdbBtn->setOffset(0,0);
shadowEffect_killAdbBtn->setColor(Qt::gray);
shadowEffect_killAdbBtn->setBlurRadius(5);
QGraphicsDropShadowEffect *shadowEffect_testBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_testBtn = new QGraphicsDropShadowEffect(this);
shadowEffect_testBtn->setOffset(0,0);
shadowEffect_testBtn->setColor(Qt::gray);
shadowEffect_testBtn->setBlurRadius(5);
QGraphicsDropShadowEffect *shadowEffect_WSABtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_WSABtn = new QGraphicsDropShadowEffect(this);
shadowEffect_WSABtn->setOffset(0,0);
shadowEffect_WSABtn->setColor(Qt::gray);
shadowEffect_WSABtn->setBlurRadius(5);
@ -369,70 +328,58 @@ void MainWindow::on_adbKillerBtn_clicked() //槽杀死ADB
process->run("adb kill-server");
}
void MainWindow::playLoadingGif() //槽:播放加载动画
{
qDebug() << "playLoadingGif";
ui->loadingLabel->setMovie(movie);
movie->start();
ui->loadingLabel->show();
}
void MainWindow::stopLoadingGif() //槽:隐藏加载动画 + 设置currentpage参数并发出完成basepage创建的信号
{
ui->loadingLabel->setVisible(false);
}
void MainWindow::on_WIFIBtn_clicked() //槽:弹出无线调试连接窗口,获取无线调试参数
{
getInfo = new QWidget();
getInfo->setMaximumSize(500,300);
getInfo->setWindowTitle("无线调试");
getInfo->setStyleSheet("background-color:rgba(255,255,255,1);");
getInfo->setWindowIcon(QIcon(":/ico/image/ico/link.svg"));
getInfo->setWindowIconText("test");
QLabel * title = new QLabel();
QLabel * title = new QLabel(getInfo);
title->setText("通过WI-FI连接设备");
QWidget *outWgt = new QWidget();
QWidget *outWgt = new QWidget(getInfo);
outWgt->setStyleSheet("border-radius: 4px;border:1px solid #BDBDBD;");
QVBoxLayout * outLayout = new QVBoxLayout();
QLabel * step1 = new QLabel();
QLabel * step1 = new QLabel(getInfo);
step1->setText("第一步:打开 [开发者选项 -> 无线调试]");
step1->setStyleSheet("border-radius: 4px;border-bottom:1px solid #BDBDBD;");
QLabel * lb_outIp = new QLabel();
QLabel * lb_outIp = new QLabel(getInfo);
lb_outIp->setText("无线调试IP地址");
lb_outIp->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;");
QLabel * lb_outPort = new QLabel();
QLabel * lb_outPort = new QLabel(getInfo);
lb_outPort->setText("无线调试端口:");
lb_outPort->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;");
le_outIp = new QLineEdit();
le_outIp = new QLineEdit(getInfo);
//le_outIp->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;");
le_outPort = new QLineEdit();
le_outPort = new QLineEdit(getInfo);
//le_outPort->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;");
QWidget *inWgt = new QWidget();
QWidget *inWgt = new QWidget(getInfo);
inWgt->setStyleSheet("border-radius: 4px;border:1px solid #BDBDBD;");
QVBoxLayout * inLayout = new QVBoxLayout();
QLabel * step2 = new QLabel();
QLabel * step2 = new QLabel(getInfo);
step2->setText("第二步:点击 [使用配对码配对设备]");
step2->setStyleSheet("border-radius: 4px;border-bottom:1px solid #BDBDBD;");
QLabel * lb_ipAddr = new QLabel();
QLabel * lb_ipAddr = new QLabel(getInfo);
lb_ipAddr->setText("配对IP地址");
lb_ipAddr->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;border-bottom:2px");
QLabel * lb_port = new QLabel();
QLabel * lb_port = new QLabel(getInfo);
lb_port->setText("配对端口:");
lb_port->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;");
QLabel * lb_code = new QLabel();
QLabel * lb_code = new QLabel(getInfo);
lb_code->setText("配对码:");
lb_code->setStyleSheet("border-radius: 4px;border:0px solid #BDBDBD;");
le_ipAddr = new QLineEdit();
le_ipAddr = new QLineEdit(getInfo);
//le_ipAddr->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;");
le_port = new QLineEdit();
le_port = new QLineEdit(getInfo);
//le_port->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;");
le_code = new QLineEdit();
le_code = new QLineEdit(getInfo);
//le_code->setStyleSheet("border-radius: 4px;border-bottom:2px solid #146AFF;");
QHBoxLayout * lo_outIp = new QHBoxLayout();
@ -455,9 +402,9 @@ void MainWindow::on_WIFIBtn_clicked() //槽:弹出无线调试
QPushButton * getInfoBtn = new QPushButton(getInfo);
getInfoBtn->setText("连接");
getInfoBtn->setStyleSheet("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);}");
QVBoxLayout * mainLayout = new QVBoxLayout();
QVBoxLayout * mainLayout = new QVBoxLayout(getInfo);
QGraphicsDropShadowEffect *shadowEffect_getInfoBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_getInfoBtn = new QGraphicsDropShadowEffect(getInfo);
shadowEffect_getInfoBtn->setOffset(0,0);
shadowEffect_getInfoBtn->setColor(Qt::gray);
shadowEffect_getInfoBtn->setBlurRadius(5);
@ -486,6 +433,7 @@ void MainWindow::on_WIFIBtn_clicked() //槽:弹出无线调试
connect(getInfoBtn,SIGNAL(clicked()),this,SLOT(connectWIFIDev()));
getInfo->show();
qDebug() << "size is " << getInfo->geometry();
}
void MainWindow::connectWIFIDev() //槽:连接无线调试设备
@ -520,35 +468,3 @@ void MainWindow::on_WSABtn_clicked() //槽连接WSA
msgBox->addButton("", QMessageBox::AcceptRole);
msgBox->show();
}
void MainWindow::displayWelcomePage()
{
/*
WCMPage2 = new about(this->ui->page);
WCMPage2->setGeometry(QRect(301,111,WCMPage2->geometry().width(),WCMPage2->geometry().height()));
qDebug() << "initing... page's geometry is " << ui->page->geometry();
currentPage = WCMPage2;*/
//ui->indexList->setCurrentRow(7);
/*
if(WCMPage != NULL) //销毁上一个basePage
{
//currentPage->setDisabled(true);
//delete currentPage;
WCMPage->~welcomePage();
WCMPage = NULL;
}
WCMPage = new welcomePage();
ui->verticalLayout_2->addWidget(WCMPage);
*//*
if(WCMPage2 != NULL) //销毁上一个basePage
{
//currentPage->setDisabled(true);
//delete currentPage;
WCMPage2->~about();
WCMPage2 = NULL;
}
WCMPage2 = new about();
ui->verticalLayout_2->addWidget(WCMPage2);*/
}

View File

@ -14,7 +14,6 @@
#include "basepage.h"
#include "pagemaker.h"
#include "threads/thread_createpage.h"
#include "welcomepage.h"
#include "about.h"
#include <QCoreApplication>
@ -33,7 +32,6 @@ class MainWindow : public QMainWindow
{
Q_OBJECT
signals:
//void createBasePage(int, QWidget*, device, basePage*);
public:
MainWindow(QWidget *parent = nullptr);
@ -42,7 +40,6 @@ public:
adbProcess *process;
textExplainer *explainer;
pageMaker *maker;
QMovie *movie;
QWidget * getInfo;
QLineEdit * le_outIp;
@ -51,8 +48,6 @@ public:
QLineEdit * le_port;
QLineEdit * le_code;
//QThread* sub;
//thread_createPage * thread_BPCreator;
int current_device;
QList<device> devList;
@ -68,18 +63,11 @@ private slots:
void setCurrentDevice(int index);
void initBasePage(int key);
void initSonPage(int key);
void playLoadingGif();
void stopLoadingGif();
void on_adbKillerBtn_clicked();
void on_WIFIBtn_clicked();
void connectWIFIDev();
//void emit_signal_createBasePage(int key);
/*(int key, QWidget *parent, device dev)*/
void on_WSABtn_clicked();
private:
@ -88,11 +76,10 @@ private:
void initEnvironmentPATH();
void addIndexItems();
void setStyles();
void displayWelcomePage();
basePage * currentPage;
animationWidget * tmpPage;
welcomePage * WCMPage;
about * WCMPage2;
};
#endif // MAINWINDOW_H

View File

@ -11,23 +11,6 @@ pageListItem::pageListItem(QWidget *parent) :
ui->widget->setStyleSheet("QWidget{background-color:transparent; border-radius:4px; border-color:gray;border:0px;}");
ui->pic->setStyleSheet("QPushButton{background-color:rgba(255,255,255,0.9);border-radius:4px;border:0px;}");
/*
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
shadowEffect->setOffset(0,0);
shadowEffect->setColor(Qt::gray);
shadowEffect->setBlurRadius(5);
ui->enableLight->setGraphicsEffect(shadowEffect);
QGraphicsOpacityEffect *graphicsOpacityEffect = new QGraphicsOpacityEffect(this);
graphicsOpacityEffect->setOpacity(1.0);
ui->pic->setGraphicsEffect(graphicsOpacityEffect);
QGraphicsDropShadowEffect *shadowEffect_icon = new QGraphicsDropShadowEffect();
shadowEffect_icon->setOffset(0,0);
shadowEffect_icon->setColor(Qt::gray);
shadowEffect_icon->setBlurRadius(5);
ui->pic->setGraphicsEffect(shadowEffect_icon);*/
//this->setGraphicsEffect(shadowEffect);
setStyles();
}
@ -93,7 +76,8 @@ void pageListItem::slot_setText_profile(QString p)
void pageListItem::setStyles()
{
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect(this);
shadowEffect->setOffset(0,0);
shadowEffect->setColor(Qt::gray);
shadowEffect->setBlurRadius(5);
@ -103,7 +87,7 @@ void pageListItem::setStyles()
graphicsOpacityEffect->setOpacity(1.0);
ui->pic->setGraphicsEffect(graphicsOpacityEffect);
QGraphicsDropShadowEffect *shadowEffect_icon = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_icon = new QGraphicsDropShadowEffect(this);
shadowEffect_icon->setOffset(0,0);
shadowEffect_icon->setColor(Qt::gray);
shadowEffect_icon->setBlurRadius(5);

View File

@ -1,9 +1,4 @@
#include "pagemaker.h"
/*
pageMaker::pageMaker()
{
}*/
pageMaker::pageMaker()
{
@ -11,9 +6,15 @@ pageMaker::pageMaker()
explainer = new textExplainer();
}
pageMaker::~pageMaker()
{
//delete process;
//delete explainer;
}
basePage* pageMaker::createPageWithKey(int key, QWidget *parent, device dev)
{
qDebug() << "key in createPageWithKey() is " << key ;
//qDebug() << "key in createPageWithKey() is " << key ;
int k = key;
if(dev.addr.toInt() == -1)
{

View File

@ -16,6 +16,7 @@ class pageMaker
public:
//pageMaker();
pageMaker();
~pageMaker();
adbProcess *process;
textExplainer *explainer;

View File

@ -11,10 +11,10 @@ sp_activator::sp_activator(QWidget *parent) :
connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage()));
QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this);
shadowEffect_runBtn->setOffset(0,0);
shadowEffect_runBtn->setColor(Qt::gray);
@ -37,30 +37,16 @@ sp_activator::sp_activator(QWidget *parent) :
ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn);
ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn);
QGraphicsDropShadowEffect *shadowEffect_textBrowser = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_textBrowser = new QGraphicsDropShadowEffect(this);
shadowEffect_textBrowser->setOffset(0,0);
shadowEffect_textBrowser->setColor(Qt::gray);
shadowEffect_textBrowser->setBlurRadius(5);
ui->textBrowser->setGraphicsEffect(shadowEffect_textBrowser);
/*
QGraphicsDropShadowEffect *shadowEffect_appIcon = new QGraphicsDropShadowEffect();
shadowEffect_appIcon->setOffset(0,0);
shadowEffect_appIcon->setColor(Qt::gray);
shadowEffect_appIcon->setBlurRadius(10);
ui->appIcon->setGraphicsEffect(shadowEffect_appIcon);*/
/*
QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect();
shadowEffect_widget->setOffset(0,0);
shadowEffect_widget->setColor(Qt::gray);
shadowEffect_widget->setBlurRadius(5);
ui->widget->setGraphicsEffect(shadowEffect_widget);*/
//ui->textBrowser->sc
}
sp_activator::~sp_activator()
{
//delete process;
delete ui;
}

View File

@ -10,10 +10,10 @@ sp_customize_cmd::sp_customize_cmd(QWidget *parent) :
connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage()));
QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this);
shadowEffect_runBtn->setOffset(0,0);
shadowEffect_runBtn->setColor(Qt::gray);
@ -36,13 +36,13 @@ sp_customize_cmd::sp_customize_cmd(QWidget *parent) :
ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn);
ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn);
QGraphicsDropShadowEffect *shadowEffect_textBrowser = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_textBrowser = new QGraphicsDropShadowEffect(this);
shadowEffect_textBrowser->setOffset(0,0);
shadowEffect_textBrowser->setColor(Qt::gray);
shadowEffect_textBrowser->setBlurRadius(5);
ui->textBrowser->setGraphicsEffect(shadowEffect_textBrowser);
QGraphicsDropShadowEffect *shadowEffect_label = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_label = new QGraphicsDropShadowEffect(this);
shadowEffect_label->setOffset(0,0);
shadowEffect_label->setColor(Qt::gray);
shadowEffect_label->setBlurRadius(5);

View File

@ -16,11 +16,11 @@ sp_installer::sp_installer(QWidget *parent) :
connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage()));
QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_selectBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_selectBtn = new QGraphicsDropShadowEffect(this);
shadowEffect_runBtn->setOffset(0,0);
shadowEffect_runBtn->setColor(Qt::gray);

View File

@ -155,14 +155,12 @@ border-radius:4px;</string>
border-radius:4px;
text-align:center;
/*border:1px solid #E8EDF2;*/
border:1px solid #E8EDF2;
background-color: rgb(255, 255, 255);
border-color: rgb(180, 180, 180);
border:0px solid #E8EDF2;
background-color: qlineargradient(x1:0,y1:1,x1:1,y1:0,stop:0 #11998e, stop:1 #38ef7d);
}
QProgressBar:chunk{
border-radius:4px;
/*background-color:#1ABC9C;*/
background-color:#BDBDBD;
background-color:rgba(255,255,255,0.2);
}
</string>
</property>

View File

@ -171,7 +171,7 @@ void btnEmulator::on_btn_calc_clicked()
void btnEmulator::setShadow(QWidget* wgt)
{
QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect(this);
shadowEffect_widget->setOffset(0,0);
shadowEffect_widget->setColor(Qt::gray);
shadowEffect_widget->setBlurRadius(5);

View File

@ -17,31 +17,31 @@ sp_devControl_power::sp_devControl_power(QWidget *parent) :
shadowEffect_widget->setBlurRadius(5);
ui->widget->setGraphicsEffect(shadowEffect_widget);*/
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this);
shadowEffect_back_to_basePage->setOffset(0,0);
shadowEffect_back_to_basePage->setColor(Qt::gray);
shadowEffect_back_to_basePage->setBlurRadius(5);
ui->back_to_basePage->setGraphicsEffect(shadowEffect_back_to_basePage);
QGraphicsDropShadowEffect *shadowEffect_btn_powerDown = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_powerDown = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_powerDown->setOffset(0,0);
shadowEffect_btn_powerDown->setColor(Qt::gray);
shadowEffect_btn_powerDown->setBlurRadius(5);
ui->btn_powerDown->setGraphicsEffect(shadowEffect_btn_powerDown);
QGraphicsDropShadowEffect *shadowEffect_btn_rebootToSystem = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_rebootToSystem = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_rebootToSystem->setOffset(0,0);
shadowEffect_btn_rebootToSystem->setColor(Qt::gray);
shadowEffect_btn_rebootToSystem->setBlurRadius(5);
ui->btn_rebootToSystem->setGraphicsEffect(shadowEffect_btn_rebootToSystem);
QGraphicsDropShadowEffect *shadowEffect_rebootToRecovery_clicked = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_rebootToRecovery_clicked = new QGraphicsDropShadowEffect(this);
shadowEffect_rebootToRecovery_clicked->setOffset(0,0);
shadowEffect_rebootToRecovery_clicked->setColor(Qt::gray);
shadowEffect_rebootToRecovery_clicked->setBlurRadius(5);
ui->btn_rebootToRecovery->setGraphicsEffect(shadowEffect_rebootToRecovery_clicked);
QGraphicsDropShadowEffect *shadowEffect_btn_rebootToFastboot = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_btn_rebootToFastboot = new QGraphicsDropShadowEffect(this);
shadowEffect_btn_rebootToFastboot->setOffset(0,0);
shadowEffect_btn_rebootToFastboot->setColor(Qt::gray);
shadowEffect_btn_rebootToFastboot->setBlurRadius(5);

View File

@ -24,10 +24,10 @@ sp_dpiChanger::sp_dpiChanger(QWidget *parent) :
"QPushButton:hover{background-color:rgba(255,255,255,0.7);}"
"QPushButton:pressed{background-color:rgba(255,255,255,0.6);}");
QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this);
shadowEffect_runBtn->setOffset(0,0);
shadowEffect_runBtn->setColor(Qt::gray);
@ -49,13 +49,6 @@ sp_dpiChanger::sp_dpiChanger(QWidget *parent) :
ui->runBtn->setGraphicsEffect(shadowEffect_runBtn);
ui->showOutputBtn->setGraphicsEffect(shadowEffect_showOutputBtn);
ui->refreshBtn->setGraphicsEffect(shadowEffect_refreshBtn);
/*
QGraphicsDropShadowEffect *shadowEffect_widget = new QGraphicsDropShadowEffect();
shadowEffect_widget->setOffset(0,0);
shadowEffect_widget->setColor(Qt::gray);
shadowEffect_widget->setBlurRadius(5);
ui->widget->setGraphicsEffect(shadowEffect_widget);*/
}
sp_dpiChanger::~sp_dpiChanger()

View File

@ -10,11 +10,11 @@ sp_recovery::sp_recovery(QWidget *parent) :
process = new adbProcess();
connect(this->ui->back_to_basePage,SIGNAL(clicked()),parent,SLOT(slot_destroySonPage()));
QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_selectBtn = new QGraphicsDropShadowEffect();
QGraphicsDropShadowEffect *shadowEffect_runBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_showOutputBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_back_to_basePage = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_refreshBtn = new QGraphicsDropShadowEffect(this);
QGraphicsDropShadowEffect *shadowEffect_selectBtn = new QGraphicsDropShadowEffect(this);
shadowEffect_runBtn->setOffset(0,0);
shadowEffect_runBtn->setColor(Qt::gray);

View File

@ -6,6 +6,12 @@ sonPageManager::sonPageManager()
explainer = new textExplainer();
}
sonPageManager::~sonPageManager()
{
//delete process;
//delete explainer;
}
QWidget* sonPageManager::selector(QWidget *parent , QString parentName, int key, device dev)
{
if(parentName == "devInfo")

View File

@ -17,6 +17,7 @@ class sonPageManager
{
public:
sonPageManager();
~sonPageManager();
adbProcess *process;
textExplainer *explainer;