7 #include <QApplication>
10 #include <QPushButton>
23 bool PinDelegate::containsLutType(
const PinItem* item)
38 bool PinDelegate::containsInputDirection(
const PinItem* item)
43 for(
const BaseTreeItem* child : item->getChildren())
61 switch(
index.column()){
74 comboBox->addItem(
"input");
75 comboBox->addItem(
"output");
76 comboBox->addItem(
"inout");
77 comboBox->addItem(
"internal");
88 comboBox->addItem(
"none");
89 comboBox->addItem(
"power");
90 comboBox->addItem(
"ground");
92 comboBox->addItem(
"lut");
93 comboBox->addItem(
"state");
94 comboBox->addItem(
"neg_state");
95 comboBox->addItem(
"clock");
96 comboBox->addItem(
"enable");
97 comboBox->addItem(
"set");
98 comboBox->addItem(
"reset");
99 comboBox->addItem(
"data");
100 comboBox->addItem(
"address");
101 comboBox->addItem(
"io_pad");
102 comboBox->addItem(
"select");
103 comboBox->addItem(
"carry");
104 comboBox->addItem(
"sum");
109 qInfo() <<
"create editor for 3";
121 auto pinItem =
static_cast<PinItem*
>(
index.internalPointer());
124 switch(
index.column()){
127 auto lineEdit =
static_cast<QLineEdit*
>(editor);
129 lineEdit->
setText(pinItem->getName());
138 auto comboBox =
static_cast<QComboBox*
>(editor);
146 auto comboBox =
static_cast<QComboBox*
>(editor);
158 auto pinModel =
static_cast<PinModel*
>(model);
160 switch(
index.column()){
163 auto lineEdit =
static_cast<QLineEdit*
>(editor);
164 QString text = lineEdit->text();
166 pinModel->handleEditName(
index, text);
174 auto comboBox =
static_cast<QComboBox*
>(editor);
175 QString text = comboBox->currentText();
177 pinModel->handleEditDirection(
index, text);
184 auto comboBox =
static_cast<QComboBox*
>(editor);
185 QString text = comboBox->currentText();
187 pinModel->handleEditType(
index, text);
(Future) Base class for all tree models related to the details widget.
virtual QList< BaseTreeItem * > getChildren() const
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
PinDelegate(QObject *parent=0)
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
void setEditorData(QWidget *editor, const QModelIndex &index) const override
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
PinDirection getDirection() const
TreeItemType getItemType() const
PinType getPinType() const
void setCurrentText(const QString &text)
void setText(const QString &)
QObject * parent() const const
void fillRect(const QRectF &rectangle, const QBrush &brush)
bool isEmpty() const const
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const const override