File: test_console.cpp

package info (click to toggle)
nextpnr 0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 23,908 kB
  • sloc: cpp: 219,642; python: 21,427; ansic: 10,274; sh: 779; makefile: 493; tcl: 116; vhdl: 44; objc: 42
file content (36 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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;
}