From 2daf7c2dc2741a9f59cf5afd9b66a41c8f100808 Mon Sep 17 00:00:00 2001 From: Joseph Mirabel <jmirabel@laas.fr> Date: Mon, 5 Mar 2018 17:32:38 +0100 Subject: [PATCH] Update PythonQt decorators. --- include/gepetto/gui/mainwindow.hh | 1 - src/gui/mainwindow.cc | 5 ----- src/gui/python-decorator.hh | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/gepetto/gui/mainwindow.hh b/include/gepetto/gui/mainwindow.hh index e92f887..9453723 100644 --- a/include/gepetto/gui/mainwindow.hh +++ b/include/gepetto/gui/mainwindow.hh @@ -139,7 +139,6 @@ signals: /// \param text text to log void logJobFailed (int id, const QString& text); - OSGWidget* createView (const QString& name); /// Request a refresh of the interface. /// \param refreshType tells what to refresh. See RefreshType void requestRefresh (); diff --git a/src/gui/mainwindow.cc b/src/gui/mainwindow.cc index 6c4a1ee..5973824 100644 --- a/src/gui/mainwindow.cc +++ b/src/gui/mainwindow.cc @@ -210,11 +210,6 @@ namespace gepetto { emit logErrorString (QString ("Job ") + QString::number (id) + " failed: " + text); } - OSGWidget *MainWindow::createView(const QString& name) - { - return createView (name.toStdString()); - } - OSGWidget *MainWindow::createView(const std::string& name) { if (thread() != QThread::currentThread()) { diff --git a/src/gui/python-decorator.hh b/src/gui/python-decorator.hh index 0fb50c5..35ff55e 100644 --- a/src/gui/python-decorator.hh +++ b/src/gui/python-decorator.hh @@ -13,9 +13,23 @@ namespace gepetto { Q_OBJECT public slots: + /// \name MainWindow + /// \{ + MainWindow* static_MainWindow_instance () const { return MainWindow::instance (); } + QList <OSGWidget*> osgWindows (MainWindow* w) const { return w->osgWindows(); } + + OSGWidget* createView (MainWindow* w, const QString& name) const { return w->createView(name.toStdString()); } + + /// \} + + /// \name OSGWidget + /// \{ + int windowID (OSGWidget* o) const { return o->windowID(); } + + /// \} }; } // namespace gui } // namespace gepetto -- GitLab