mirror of
https://github.com/YosysHQ/nextpnr.git
synced 2026-01-26 20:22:44 +00:00
initial import of python-console
This commit is contained in:
36
3rdparty/python-console/test_console.cpp
vendored
Normal file
36
3rdparty/python-console/test_console.cpp
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <iostream>
|
||||
#include <QApplication>
|
||||
#include <QMainWindow>
|
||||
#include <QWidget>
|
||||
#include <QGridLayout>
|
||||
#include <QTextEdit>
|
||||
|
||||
#include "Console.h"
|
||||
#include "Interpreter.h"
|
||||
|
||||
Console* console;
|
||||
|
||||
void SetupWindow( int argc, char *argv[] )
|
||||
{
|
||||
QMainWindow* window = new QMainWindow;
|
||||
window->resize( 800, 600 );
|
||||
QWidget* centralWidget = new QWidget(window);
|
||||
QGridLayout* layout = new QGridLayout(centralWidget);
|
||||
console = new Console;
|
||||
layout->addWidget(console, 0, 0, 1, 1);
|
||||
window->setCentralWidget(centralWidget);
|
||||
window->show( );
|
||||
}
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
QApplication app( argc, argv );
|
||||
Interpreter::Initialize( );
|
||||
|
||||
SetupWindow( argc, argv );
|
||||
|
||||
bool res = app.exec( );
|
||||
delete console;
|
||||
Interpreter::Finalize( );
|
||||
return res;
|
||||
}
|
||||
Reference in New Issue
Block a user