1 #include "InterfacePropertiesDialog.h"
3 #include "ConnectedInterface.h"
5 InterfacePropertiesDialog::InterfacePropertiesDialog(InterfaceItem *_inter, QWidget *parent) : QDialog(parent) {
7 QGroupBox* box = new QGroupBox("Properties");
8 okButton = new QPushButton(tr("OK"));
10 QGridLayout* layProp = new QGridLayout;
12 int w = inter->refInter->getWidth();
15 wStr = "invalid_size";
18 if (w == 0) w++; // 0 means a boolean thus, size of 1 bit
22 layProp->addWidget(new QLabel("Interface properties"), 0, 0);
23 layProp->addWidget(new QLabel(" "), 1, 0);
25 layProp->addWidget(new QLabel("Name :"), 2, 0);
26 layProp->addWidget(new QLabel(inter->getName()), 2, 1);
27 layProp->addWidget(new QLabel("Width :"), 3, 0);
28 layProp->addWidget(new QLabel(wStr), 3, 1);
29 layProp->addWidget(new QLabel("Direction :"), 4, 0);
30 layProp->addWidget(new QLabel(inter->refInter->getDirectionString()), 4, 1);
31 layProp->addWidget(new QLabel("Purpose :"), 5, 0);
32 layProp->addWidget(new QLabel(inter->refInter->getPurposeString()), 5, 1);
33 layProp->addWidget(new QLabel("Type :"), 6, 0);
34 layProp->addWidget(new QLabel(inter->refInter->getTypeString()), 6, 1);
35 layProp->addWidget(new QLabel("related to clock :"), 7, 0);
36 layProp->addWidget(new QLabel(inter->refInter->getClockIfaceString()), 7, 1);
38 QHBoxLayout* layBottom = new QHBoxLayout;
39 layBottom->addStretch();
40 layBottom->addWidget(okButton);
42 QVBoxLayout* layAll = new QVBoxLayout;
43 layAll->addLayout(layProp);
44 layAll->addLayout(layBottom);
48 connect(okButton,SIGNAL(clicked()),this, SLOT(accept()));