diff options
author | Cristian Maureira-Fredes <[email protected]> | 2021-04-30 17:49:36 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <[email protected]> | 2021-05-05 20:44:49 +0200 |
commit | 57e681930f6b4c7c311fc70a66317ef64dee4cb1 (patch) | |
tree | bb74a1c956c54be258ccb79eb2e13fdb82107301 /examples/sql | |
parent | 36431b071095b8999347df87621bf23ffcc2ac3d (diff) |
examples: use exec() instead of exec_()
Change-Id: I07dd4339093be8fcc80e63a2ff0448e998356203
Reviewed-by: Friedemann Kleint <[email protected]>
Diffstat (limited to 'examples/sql')
-rw-r--r-- | examples/sql/books/createdb.py | 12 | ||||
-rw-r--r-- | examples/sql/books/main.py | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/sql/books/createdb.py b/examples/sql/books/createdb.py index d1f624ae0..48784a88e 100644 --- a/examples/sql/books/createdb.py +++ b/examples/sql/books/createdb.py @@ -48,19 +48,19 @@ def add_book(q, title, year, authorId, genreId, rating): q.addBindValue(authorId) q.addBindValue(genreId) q.addBindValue(rating) - q.exec_() + q.exec() def add_genre(q, name): q.addBindValue(name) - q.exec_() + q.exec() return q.lastInsertId() def add_author(q, name, birthdate): q.addBindValue(name) q.addBindValue(str(birthdate)) - q.exec_() + q.exec() return q.lastInsertId() @@ -103,9 +103,9 @@ def init_db(): check(db.open) q = QSqlQuery() - check(q.exec_, BOOKS_SQL) - check(q.exec_, AUTHORS_SQL) - check(q.exec_, GENRES_SQL) + check(q.exec, BOOKS_SQL) + check(q.exec, AUTHORS_SQL) + check(q.exec, GENRES_SQL) check(q.prepare, INSERT_AUTHOR_SQL) asimovId = add_author(q, "Isaac Asimov", date(1920, 2, 1)) diff --git a/examples/sql/books/main.py b/examples/sql/books/main.py index e957869ac..3994a66b4 100644 --- a/examples/sql/books/main.py +++ b/examples/sql/books/main.py @@ -50,4 +50,4 @@ if __name__ == "__main__": window.resize(800, 600) window.show() - sys.exit(app.exec_()) + sys.exit(app.exec()) |