Mantid
Loading...
Searching...
No Matches
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 +
8#include <QtGlobal>
9#include <sip.h>
10
15const 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
EXPORT_OPT_MANTIDQT_COMMON const sipAPIDef * sipAPI()
Definition Sip.cpp:15