diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part5/main.cpp b/examples/widgets/tutorials/gettingStarted/gsQt/part5/main.cpp index 25ee5d0fbb..5a45edf852 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part5/main.cpp +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part5/main.cpp @@ -89,7 +89,7 @@ void Notepad::open() QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", tr("Text Files (*.txt);;C++ Files (*.cpp *.h)")); - if (fileName != "") { + if (!fileName.isEmpty()) { QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { QMessageBox::critical(this, tr("Error"), tr("Could not open file")); @@ -107,7 +107,7 @@ void Notepad::save() QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "", tr("Text Files (*.txt);;C++ Files (*.cpp *.h)")); - if (fileName != "") { + if (!fileName.isEmpty()) { QFile file(fileName); if (!file.open(QIODevice::WriteOnly)) { // error message