Mantid
Loading...
Searching...
No Matches
qt
widgets
common
src
Python
Sip.cpp
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4
// NScD Oak Ridge National Laboratory, European Spallation Source,
5
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#include "
MantidQtWidgets/Common/Python/Sip.h
"
8
#include <QtGlobal>
9
#include <sip.h>
10
11
namespace
MantidQt::Widgets::Common::Python::Detail
{
15
const
sipAPIDef *
sipAPI
() {
16
static
const
sipAPIDef *sip_API =
nullptr
;
17
if
(sip_API)
18
return
sip_API;
19
20
// Some configs have a private sip module inside PyQt. Try this first
21
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
22
sip_API = (
const
sipAPIDef *)PyCapsule_Import(
"PyQt5.sip._C_API"
, 0);
23
#else
24
#error "Unknown sip module for Qt >= 6"
25
#endif
26
// Try plain sip module
27
if
(!sip_API) {
28
PyErr_Clear();
29
sip_API = (
const
sipAPIDef *)PyCapsule_Import(
"sip._C_API"
, 0);
30
}
31
32
assert(sip_API);
33
return
sip_API;
34
}
35
}
// namespace MantidQt::Widgets::Common::Python::Detail
Sip.h
MantidQt::Widgets::Common::Python::Detail
Definition:
Sip.h:19
MantidQt::Widgets::Common::Python::Detail::sipAPI
EXPORT_OPT_MANTIDQT_COMMON const sipAPIDef * sipAPI()
Definition:
Sip.cpp:15
Generated on Tue Jan 3 2023 11:58:02 for Mantid by
1.9.5