#ifndef QGPYTHON_H
#define QGPYTHON_H

#include <QObject>

#include "PythonQt.h"

class QWidget;

class QgPython: public QObject
{
    Q_OBJECT

    Q_PROPERTY(QObject* mw READ mw WRITE setMainWindow)

public:
    static QgPython& instance();
    static void initialize();

    PythonQt& self() const;

    PythonQtObjectPtr mainContext();

    PythonQtObjectPtr createMainApplicationModule(const QString& module_name);

    PythonQtObjectPtr mainModule();

    QObject* mw() const;

public Q_SLOTS:
    void importQtAll();

    void setMainWindow(QObject*);

    //void eval(const QString&);

private:
    QgPython();

    mutable QObject* mainWindow;
};

#endif // QGPYTHON_H
