📄 faultrecorderform.ui.h
字号:
/****************************************************************************** ui.h extension file, included from the uic-generated form implementation.**** If you wish to add, delete or rename functions or slots use** Qt Designer which will update this file, preserving your code. Create an** init() function in place of a constructor, and a destroy() function in** place of a destructor.*****************************************************************************/QString Faut[3];void FaultrecorderForm::init(){ QDir::setCurrent("/root/FaultRecorder/"); QFile file( "faut_ratedvalue.DAT" ); file.open( IO_ReadOnly ); QTextStream stream( &file ); stream>>Faut[0]; stream>>Faut[1]; stream>>Faut[2]; lineEdit0->setText(Faut[0]); lineEdit1->setText(Faut[1]); lineEdit2->setText(Faut[2]); lineEdit0->setEnabled(FALSE); lineEdit1->setEnabled(FALSE); lineEdit2->setEnabled(FALSE); savepushButton->setEnabled(FALSE); file.close();}//定值修改;void FaultrecorderForm::edit(){ lineEdit0->setEnabled(TRUE); lineEdit1->setEnabled(TRUE); lineEdit2->setEnabled(TRUE); savepushButton->setEnabled(TRUE);}//定值保存;void FaultrecorderForm::save(){ QDir::setCurrent("/root/FaultRecorder/"); QFile file( "faut_ratedvalue.DAT" ); file.open( IO_WriteOnly ); QTextStream stream( &file ); Faut[0] = lineEdit0->text(); if (Faut[0] == ""){ Faut[0] = "0"; } Faut[1] = lineEdit1->text(); if (Faut[1] == ""){ Faut[1] = "0"; } Faut[2] = lineEdit2->text(); if (Faut[2] == ""){ Faut[2] = "0"; } stream<<Faut[0]; stream<<"\n"; stream<<Faut[1]; stream<<"\n"; stream<<Faut[2]; stream<<"\n"; lineEdit0->setEnabled(FALSE); lineEdit1->setEnabled(FALSE); lineEdit2->setEnabled(FALSE); savepushButton->setEnabled(FALSE); file.close();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -