mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2025-04-21 12:27:27 +03:00
First functional example, ADC an Framebuffer Test
This commit is contained in:
36
Software/sie_cg/block_editor/mainwindow.cpp
Normal file → Executable file
36
Software/sie_cg/block_editor/mainwindow.cpp
Normal file → Executable file
@@ -64,6 +64,9 @@ MainWindow::MainWindow()
|
||||
headerTextEdit = new QTextEdit;
|
||||
headerTextEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
headerTextEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
initTextEdit = new QTextEdit;
|
||||
initTextEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
initTextEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
blockTextEdit = new QTextEdit;
|
||||
blockTextEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
blockTextEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
@@ -72,26 +75,36 @@ MainWindow::MainWindow()
|
||||
extraTextEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
prototypeLabel = new QLabel;
|
||||
prototypeLabel->setText("\nvoid BLOCK_NAME () {");
|
||||
QFont proFont = prototypeLabel->font(); proFont.setBold(true);
|
||||
prototypeLabel->setFont(proFont);
|
||||
prototypeLabel->setMaximumWidth(1280);
|
||||
initLabel = new QLabel;
|
||||
initLabel->setText("Code For Initialization Section Here");
|
||||
proFont = initLabel->font(); proFont.setItalic(true);;
|
||||
initLabel->setFont(proFont);
|
||||
headerLabel = new QLabel;
|
||||
headerLabel->setText("Code for Header Section Here");
|
||||
headerLabel->setText("Code For Header Section Here");
|
||||
headerLabel->setFont(proFont);
|
||||
extraLabel = new QLabel;
|
||||
extraLabel->setText("}\n\nCode for Extra Section Here");
|
||||
extraLabel->setText("}\n\nCode For Extra Section Here");
|
||||
extraLabel->setFont(proFont);
|
||||
|
||||
/* Create central widget */
|
||||
QGridLayout *layout = new QGridLayout;
|
||||
layout->addWidget(toolBox,0,0,7,1);
|
||||
layout->addWidget(toolBox,0,0,9,1);
|
||||
view = new QGraphicsView(scene);
|
||||
layout->addWidget(view,0,1,1,1);
|
||||
layout->addWidget(headerLabel,1,1,1,1);
|
||||
layout->addWidget(headerTextEdit,2,1,1,1);
|
||||
layout->addWidget(prototypeLabel,3,1,1,1);
|
||||
layout->addWidget(blockTextEdit,4,1,1,1);
|
||||
layout->addWidget(extraLabel,5,1,1,1);
|
||||
layout->addWidget(extraTextEdit,6,1,1,1);
|
||||
layout->addWidget(initLabel,3,1,1,1);
|
||||
layout->addWidget(initTextEdit,4,1,1,1);
|
||||
layout->addWidget(prototypeLabel,5,1,1,1);
|
||||
layout->addWidget(blockTextEdit,6,1,1,1);
|
||||
layout->addWidget(extraLabel,7,1,1,1);
|
||||
layout->addWidget(extraTextEdit,8,1,1,1);
|
||||
|
||||
QWidget *widget = new QWidget;
|
||||
widget->setLayout(layout);
|
||||
|
||||
setCentralWidget(widget);
|
||||
setWindowTitle(tr("SIE Code Generator (Block Editor)"));
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
@@ -110,6 +123,9 @@ void MainWindow::deleteItem()
|
||||
if (item->type() == Arrow::Type) {
|
||||
qgraphicsitem_cast<Arrow *>(item)->removeLines();
|
||||
scene->removeItem(item);
|
||||
if(qgraphicsitem_cast<Arrow *>(item)==scene->myPolygonPath)
|
||||
scene->myPolygonPath=0;
|
||||
|
||||
delete(item);
|
||||
}
|
||||
//If line is deleted then is romoved from the arrow owner
|
||||
@@ -376,6 +392,10 @@ bool MainWindow::newDiagram(QString filePath)
|
||||
{
|
||||
saveIfNeeded();
|
||||
scene->cleanScene();
|
||||
this->headerTextEdit->clear();
|
||||
this->initTextEdit->clear();
|
||||
this->blockTextEdit->clear();
|
||||
this->extraTextEdit->clear();
|
||||
prototypeLabel->setText("\nvoid BLOCK_NAME () {");
|
||||
myFilePath="";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user