frm_managetoolsimpl.cpp

来自「qt4.4.3下编写的嵌入式UI界面」· C++ 代码 · 共 132 行

CPP
132
字号
#include "frm_managetoolsimpl.h"#include "frm_restoreImpldialogimpl.h"#include "frm_SysParmimpl.h"#include "frm_driverimpl.h"#include "frm_onlineuserimpl.h"#include "functions.h"#include <QMessageBox>#include <QTextCodec>#include <QPushButton>#include <QString>#include <QFont>//frm_managetoolsImpl::frm_managetoolsImpl( QWidget * parent, Qt::WFlags f) 	: QWidget(parent, f){	setupUi(this);	m_restoreForm = new frm_restoreImpl(); //出厂设置	m_sysParmImpl = new Frm_SysParmImpl(); //系统参数	m_driverImpl = new frm_driverImpl(); //磁盘管理 	m_onlineuserimpl = new frm_onlineUserImpl(); //在线用户		connect(tbtn_sysparm,SIGNAL(clicked()), this, SLOT(tbtn_sysparm_clicked()));	connect(m_sysParmImpl->pbtn_ok,SIGNAL(clicked()), this, SLOT(tbtn_sysparm_accept()));		connect(tbtn_hardmanage,SIGNAL(clicked()), this, SLOT(tbtn_drive_clicked()));	connect(m_driverImpl->pbtn_ok,SIGNAL(clicked()), this, SLOT(tbtn_drive_format()));		connect(tbtn_onlineUser,SIGNAL(clicked()), this, SLOT(tbtn_onlneUser_clicked()));		connect(tbtn_stopAlarm,SIGNAL(clicked()), this, SLOT(tbtn_clearAlarm_clicked()));		connect(m_restoreForm->buttonBox,SIGNAL(accepted()), this, SLOT(tbtn_restore_accept()));	connect(m_restoreForm->buttonBox,SIGNAL(rejected()), this, SLOT(tbtn_restore_reject()));    connect(tbtn_restore,SIGNAL(clicked()), this, SLOT(tbtn_restore_clicked()));	}frm_managetoolsImpl::~frm_managetoolsImpl(){    if (m_restoreForm)    {    	delete(m_restoreForm);   	}   	    if (m_sysParmImpl)    {    	delete(m_sysParmImpl);   	}   	   	if (m_driverImpl)    {    	delete(m_driverImpl);   	}     	if (m_onlineuserimpl)    {    	delete(m_onlineuserimpl);   	}     	   	 }void frm_managetoolsImpl::tbtn_sysparm_clicked() //系统参数{   m_sysParmImpl->showNormal();	}	void frm_managetoolsImpl::tbtn_sysparm_accept()  //系统参数确认{		}void frm_managetoolsImpl::tbtn_drive_clicked()   //磁盘管理{	m_driverImpl->showNormal();}	void frm_managetoolsImpl::tbtn_drive_format()    //磁盘格式化{		}void frm_managetoolsImpl::tbtn_onlneUser_clicked() //在线用户{	m_onlineuserimpl->showNormal();	}        //清除报警void frm_managetoolsImpl::tbtn_clearAlarm_clicked(){	QMessageBox msgBox;	char first_str[] ="清除报警";	char second_str[] ="成功清除报警!";	char thread_str[] ="关闭";		QTextCodec* codec = QTextCodec::codecForName("utf8"); 	QString unicodeString = codec->toUnicode(first_str);	msgBox.setWindowTitle(unicodeString);	unicodeString = codec->toUnicode(second_str);	 	msgBox.setInformativeText(unicodeString); 	    unicodeString = codec->toUnicode(thread_str); 	    QPushButton *connectButton = msgBox.addButton(unicodeString, QMessageBox::ActionRole);    	msgBox.setIcon(QMessageBox::Information); 	msgBox.exec(); 	delete(connectButton);	}//恢复出厂设置void frm_managetoolsImpl::tbtn_restore_clicked(){	m_restoreForm->showNormal();} void frm_managetoolsImpl::tbtn_restore_accept(){	}void frm_managetoolsImpl::tbtn_restore_reject(){	}  	//

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?