📄 dzkdialog.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.
*****************************************************************************/
void DzkDialog::yesClickedSlot() //*******程希望*******编的
{
QDate d=QDate::currentDate(); //QT::LocalTime
saveStr=QString("%1,%2,%3\n").arg(enterNamelineEdit->text())
.arg(saveScoretr).arg(QString(d.toString()));
saveText("savefile.txt");
close();
DzkList *dl=new DzkList();
dl->raise();
dl->show();
}
void DzkDialog::setScore( const int scoreNum )//*******程希望*******编的
{
saveScoretr=QString::number(scoreNum);
scoreDisLabel->setText(tr(saveScoretr));
}
void DzkDialog::error( const QFile &file, const QString &message )//*******程希望*******编的
{
QMessageBox::warning(0,tr("dzkdialog"),message.arg(file.name()));
}
void DzkDialog::ioError( const QFile &file, const QString &message )//*******程希望*******编的
{
error(file,message);
}
bool DzkDialog::saveText( const QString & fileName )//*******程希望*******编的
{
QFile file(fileName);
if(!file.open(IO_WriteOnly| IO_Append)) {
//if(!file.open(IO_WriteOnly| IO_Translate)) {
ioError(file,tr("Can not open file %1 for writing"));
return false;
}
QTextStream out(&file); //用那个能输出中文?
out.setEncoding(QTextStream::Locale);//test: UnicodeUTF8 ,Unicode Latin1 RawUnicode
out<<saveStr; //write to stream;
if(file.status() !=IO_Ok) {
ioError(file,tr("Error writing to file %1"));
return false;
}
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -