?? dzkdialog.ui.h
字號(hào):
/****************************************************************************
** 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); //用那個(gè)能輸出中文?
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;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -