qtsql.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright (C) 2021 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. // @snippet simple-exec
  4. if (PyErr_WarnEx(PyExc_DeprecationWarning,
  5. "'exec_' will be removed in the future. "
  6. "Use 'exec' instead.",
  7. 1)) {
  8. return nullptr;
  9. }
  10. %BEGIN_ALLOW_THREADS
  11. bool cppResult = %CPPSELF.exec();
  12. %END_ALLOW_THREADS
  13. %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
  14. // @snippet simple-exec
  15. // @snippet qsqldatabase-exec
  16. if (PyErr_WarnEx(PyExc_DeprecationWarning,
  17. "'exec_' will be removed in the future. "
  18. "Use 'exec' instead.",
  19. 1)) {
  20. return nullptr;
  21. }
  22. %BEGIN_ALLOW_THREADS
  23. QSqlQuery cppResult = %CPPSELF.exec(%1);
  24. %END_ALLOW_THREADS
  25. %PYARG_0 = %CONVERTTOPYTHON[QSqlQuery](cppResult);
  26. // @snippet qsqldatabase-exec
  27. // @snippet qsqlquery-exec
  28. if (PyErr_WarnEx(PyExc_DeprecationWarning,
  29. "'exec_' will be removed in the future. "
  30. "Use 'exec' instead.",
  31. 1)) {
  32. return nullptr;
  33. }
  34. %BEGIN_ALLOW_THREADS
  35. bool cppResult = %CPPSELF.exec(%1);
  36. %END_ALLOW_THREADS
  37. %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
  38. // @snippet qsqlquery-exec
  39. // @snippet qsqlresult-exec
  40. if (PyErr_WarnEx(PyExc_DeprecationWarning,
  41. "'exec_' will be removed in the future. "
  42. "Use 'exec' instead.",
  43. 1)) {
  44. return nullptr;
  45. }
  46. %BEGIN_ALLOW_THREADS
  47. #ifndef AVOID_PROTECTED_HACK
  48. bool cppResult = %CPPSELF.exec();
  49. #else
  50. bool cppResult = static_cast<::QSqlResultWrapper *>(cppSelf)->QSqlResultWrapper::exec_protected();
  51. #endif
  52. %END_ALLOW_THREADS
  53. %PYARG_0 = %CONVERTTOPYTHON[bool](cppResult);
  54. // @snippet qsqlresult-exec