1. Henning Schröder
  2. embeddedpyqt

Source

embeddedpyqt / src / mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QObject>
#include "test.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setObjectName("mainWindow");

    embpyqt = new EmbeddedPyQt();
    embpyqt->registerMetaObject(Test::staticMetaObject);
    embpyqt->init("embpyqt/python/initembpyqt.py");
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_actionExit_triggered()
{
    close();
}

void MainWindow::on_actionConsole_triggered()
{
    embpyqt->execute("embpyqt_console.Visible = True", true);
}