代码拉取完成,页面将自动刷新
同步操作将从 我是唐/SuperDT 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "CMainWindow.h"
#include "ui_CMainWindow.h"
#include <QDebug>
#include "VSettings.h"
#include "VAbout.h"
#include <QSizePolicy>
#include "CUIHelper.h"
#include "VDialogProtocal.h"
#include "VDialogAscii.h"
#include "CSettings.h"
#include "VDialogPay.h"
CMainWindow::CMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::CMainWindow)
{
ui->setupUi(this);
QIcon iconVer;
iconVer.addFile(":UI/btn_v_n.png",QSize(32,32),QIcon::Normal);
iconVer.addFile(":UI/ver_c.png",QSize(32,32),QIcon::Active);
ui->toolBar->addAction(iconVer,tr("垂直分屏"));
ui->toolBar->addAction(QIcon(":UI/btn_h_n.png"),tr("水平分屏"));
ui->toolBar->addAction(QIcon(":UI/btn_close_n.png"),tr("关闭分屏"));
connect(ui->toolBar,&QToolBar::actionTriggered,[=](QAction *pAction){
// qDebug()<<pAction->text();
QString strText = pAction->text();
if(tr("垂直分屏") == strText){
ui->vwindowsplitter->slotVSplitScreen();
}else if(tr("水平分屏") == strText){
ui->vwindowsplitter->slotHSplitScreen();
}else if(tr("关闭分屏") == strText){
ui->vwindowsplitter->slotMergeScreen();
}
});
connect(ui->menu_help,&QMenu::triggered,[=](QAction *pAction){
// qDebug()<<pAction->text();
if("action_about" == pAction->objectName()){
VAbout vabout;
vabout.exec();
}else if("action_wave" == pAction->objectName()){
//非模态形式创建
VDialogProtocal dialog;
dialog.exec();
}else if("action_ascii" == pAction->objectName()){
VDialogAscii dialog;
dialog.exec();
}else if("action_zfb" == pAction->objectName()){
VDialogPay dialog(VDialogPay::ENM_PAY_ZFB);
dialog.exec();
}else if("action_wx" == pAction->objectName()){
VDialogPay dialog(VDialogPay::ENM_PAY_WX);
dialog.exec();
}else if("action_list" == pAction->objectName()){
VDialogPay dialog(VDialogPay::ENM_LIST);
dialog.exec();
}
});
connect(ui->menu_settings,&QMenu::triggered,[=](QAction *pAction){
if("action_preference" == pAction->objectName()){
VSettings vsettings;
vsettings.exec();
}
});
// CUIHelper::installQss("D:/TempPro/SuperDTV2/style.qss");
//初始化状态栏
initStatusBar();
}
CMainWindow::~CMainWindow()
{
delete ui;
}
CMainWindow *CMainWindow::getInstance()
{
static CMainWindow *pInstance = nullptr;
if(nullptr == pInstance) {
pInstance = new CMainWindow();
}
return pInstance;
}
void CMainWindow::slotSendBytes(int nBytes)
{
m_pSendLabel->setText(tr("发送:") + QString::number(nBytes) + tr("字节"));
}
void CMainWindow::slotRecvBytes(int nBytes)
{
m_pRecvLabel->setText(tr("接收:") + QString::number(nBytes) + tr("字节"));
}
void CMainWindow::slotTextCode(QString strTextCode)
{
m_pTextCodeLabel->setText(strTextCode);
}
void CMainWindow::initStatusBar()
{
QStatusBar *pBar = this->statusBar();
if(nullptr == pBar)
return ;
m_pTextCodeLabel = new QLabel();
m_pSendLabel = new QLabel(pBar);
m_pRecvLabel = new QLabel(pBar);
m_pBtnRecount = new QPushButton(pBar);
m_pBtnRecount->setText(tr("重新计数"));
connect(m_pBtnRecount,&QPushButton::clicked,[=]{
emit sigRecount();
});
pBar->addPermanentWidget(m_pTextCodeLabel);
pBar->addPermanentWidget(m_pSendLabel);
pBar->addPermanentWidget(m_pRecvLabel);
pBar->addPermanentWidget(m_pBtnRecount);
slotSendBytes(0);
slotRecvBytes(0);
slotTextCode(CSettings::getInstance()->textCode());
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。