Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelSchneid3r committed Oct 3, 2023
1 parent 734971c commit 5da3566
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions python/src/pypluginloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,12 @@ QString PyPluginLoader::load()
module_.attr("md_id") = metadata_.id;

// Attach logcat functions
#if QT_VERSION != 0x060502
py::setattr(module_,"debug", py::cpp_function([this](const QString &s){ qCDebug(logging_category_factory) << s; }));
py::setattr(module_,"info", py::cpp_function([this](const QString &s){ qCInfo(logging_category_factory) << s; }));
py::setattr(module_,"warning", py::cpp_function([this](const QString &s){ qCWarning(logging_category_factory) << s; }));
py::setattr(module_,"critical", py::cpp_function([this](const QString &s){ qCCritical(logging_category_factory) << s; }));
#else
py::setattr(module_,"debug", py::cpp_function([this](const QString &s){ qCDebug(*logging_category) << s; }));
py::setattr(module_,"info", py::cpp_function([this](const QString &s){ qCInfo(*logging_category) << s; }));
py::setattr(module_,"warning", py::cpp_function([this](const QString &s){ qCWarning(*logging_category) << s; }));
py::setattr(module_,"critical", py::cpp_function([this](const QString &s){ qCCritical(*logging_category) << s; }));
#endif
// https://bugreports.qt.io/browse/QTBUG-117153
// https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?h=6.5&id=2823763072ce3a2da0210dbc014c6ad3195fbeff
py::setattr(module_,"debug", py::cpp_function([this](const QString &s){ qCDebug((*logging_category)) << s; }));
py::setattr(module_,"info", py::cpp_function([this](const QString &s){ qCInfo((*logging_category)) << s; }));
py::setattr(module_,"warning", py::cpp_function([this](const QString &s){ qCWarning((*logging_category)) << s; }));
py::setattr(module_,"critical", py::cpp_function([this](const QString &s){ qCCritical((*logging_category)) << s; }));

// Execute module
pyspec.attr("loader").attr("exec_module")(module_);
Expand Down

0 comments on commit 5da3566

Please sign in to comment.