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
sip_API =
static_cast<
const
sipAPIDef *
>
(PyCapsule_Import(
"PyQt6.sip._C_API"
, 0));
22
// Try plain sip module
23
if
(!sip_API) {
24
PyErr_Clear();
25
sip_API =
static_cast<
const
sipAPIDef *
>
(PyCapsule_Import(
"sip._C_API"
, 0));
26
}
27
28
assert(sip_API);
29
return
sip_API;
30
}
31
}
// namespace MantidQt::Widgets::Common::Python::Detail
Sip.h
MantidQt::Widgets::Common::Python::Detail
Definition
Sip.h:20
MantidQt::Widgets::Common::Python::Detail::sipAPI
EXPORT_OPT_MANTIDQT_COMMON const sipAPIDef * sipAPI()
Definition
Sip.cpp:15
Generated by
1.9.8