From 3d67793a9ec01f15e3dcf6b59e6e0df5f59bdfad Mon Sep 17 00:00:00 2001 From: Michael Winkelmann Date: Thu, 20 Jul 2017 16:39:01 +0200 Subject: Revamp SQL examples to C++11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed signals and slots to new syntax, used nullptr and replaced foreach with new C++11 range based for loops. Also fixed a few minor flaws. Task-number: QTBUG-60633 Change-Id: Ice4030133971912f96752d9d84c638c70fd73e35 Reviewed-by: Jesus Fernandez Reviewed-by: André Hartmann Reviewed-by: Friedemann Kleint --- examples/sql/connection.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'examples/sql/connection.h') diff --git a/examples/sql/connection.h b/examples/sql/connection.h index 3bedf4b061..482feff5b4 100644 --- a/examples/sql/connection.h +++ b/examples/sql/connection.h @@ -70,12 +70,12 @@ static bool createConnection() QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(":memory:"); if (!db.open()) { - QMessageBox::critical(0, qApp->tr("Cannot open database"), - qApp->tr("Unable to establish a database connection.\n" - "This example needs SQLite support. Please read " - "the Qt SQL driver documentation for information how " - "to build it.\n\n" - "Click Cancel to exit."), QMessageBox::Cancel); + QMessageBox::critical(nullptr, QObject::tr("Cannot open database"), + QObject::tr("Unable to establish a database connection.\n" + "This example needs SQLite support. Please read " + "the Qt SQL driver documentation for information how " + "to build it.\n\n" + "Click Cancel to exit."), QMessageBox::Cancel); return false; } -- cgit v1.2.3