All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
eafd18dac0
commit
25c3ba7338
@@ -21,8 +21,8 @@
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
# include <unordered_map>
|
||||
# include <stdexcept>
|
||||
#include <unordered_map>
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
#include <Base/Interpreter.h>
|
||||
@@ -35,16 +35,28 @@
|
||||
using namespace Gui;
|
||||
namespace sp = std::placeholders;
|
||||
|
||||
namespace Gui {
|
||||
namespace Gui
|
||||
{
|
||||
|
||||
class MDIViewPyWrapImp
|
||||
{
|
||||
public:
|
||||
MDIViewPyWrapImp(Py::Object pyobject)
|
||||
: pyobject{pyobject}
|
||||
: pyobject {pyobject}
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
std::vector<std::string> methods = {"widget", "onMsg", "onHasMsg", "canClose", "printDocument", "print", "printPdf", "printPreview", "redoActions", "undoActions"};
|
||||
std::vector<std::string> methods = {
|
||||
"widget",
|
||||
"onMsg",
|
||||
"onHasMsg",
|
||||
"canClose",
|
||||
"printDocument",
|
||||
"print",
|
||||
"printPdf",
|
||||
"printPreview",
|
||||
"redoActions",
|
||||
"undoActions"
|
||||
};
|
||||
|
||||
for (const auto& it : methods) {
|
||||
if (pyobject.hasAttr(it)) {
|
||||
@@ -159,14 +171,19 @@ private:
|
||||
Py::Object pyobject;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace Gui
|
||||
|
||||
|
||||
TYPESYSTEM_SOURCE_ABSTRACT(Gui::MDIViewPyWrap,Gui::MDIView)
|
||||
TYPESYSTEM_SOURCE_ABSTRACT(Gui::MDIViewPyWrap, Gui::MDIView)
|
||||
|
||||
MDIViewPyWrap::MDIViewPyWrap(const Py::Object& py, Gui::Document* pcDocument,QWidget* parent, Qt::WindowFlags wflags)
|
||||
: MDIView(pcDocument, parent, wflags)
|
||||
, ptr(std::make_unique<MDIViewPyWrapImp>(py))
|
||||
MDIViewPyWrap::MDIViewPyWrap(
|
||||
const Py::Object& py,
|
||||
Gui::Document* pcDocument,
|
||||
QWidget* parent,
|
||||
Qt::WindowFlags wflags
|
||||
)
|
||||
: MDIView(pcDocument, parent, wflags)
|
||||
, ptr(std::make_unique<MDIViewPyWrapImp>(py))
|
||||
{
|
||||
try {
|
||||
QWidget* widget = ptr->widget();
|
||||
@@ -195,7 +212,7 @@ PyObject* MDIViewPyWrap::getPyObject()
|
||||
return MDIView::getPyObject();
|
||||
}
|
||||
|
||||
bool MDIViewPyWrap::onMsg(const char* pMsg,const char** ppReturn)
|
||||
bool MDIViewPyWrap::onMsg(const char* pMsg, const char** ppReturn)
|
||||
{
|
||||
try {
|
||||
if (ptr->onMsg(pMsg)) {
|
||||
|
||||
Reference in New Issue
Block a user