10 #include <QPushButton>
11 #include <QToolButton>
14 #include <QSpacerItem>
36 QSize iconSize(20, 20);
47 mHeaderLayout->
addWidget(mNewCommentButton);
61 mCommentsContainer =
new QWidget();
62 mCommentsContainer->
show();
63 mCommentsContainer->
setLayout(mCommentsLayout);
65 mScrollArea->
setWidget(mCommentsContainer);
96 mScrollArea->
setWidget(createAndFillCommentContainerFactory(nd));
99 QWidget *CommentWidget::createAndFillCommentContainerFactory(
const Node &nd)
110 for(
const auto& entry : commentList)
117 mEntryItems.append(item);
124 void CommentWidget::handleSearchbarTriggered()
128 mSearchButton->
hide();
134 mSearchButton->
show();
138 void CommentWidget::handleNewCommentTriggered()
140 CommentDialog commentDialog(
"New Comment");
145 commentDialog.close();
148 void CommentWidget::handleCommentEntryDeleteRequest(CommentItem *item)
151 mEntryItems.removeOne(item);
161 void CommentWidget::handleCommentAboutToBeDeleted(CommentEntry *entry)
164 CommentItem* commentItem =
nullptr;
165 for(
const auto& item : mEntryItems)
167 if(item->getEntry() == entry)
174 if(commentItem ==
nullptr)
178 mEntryItems.removeOne(commentItem);
180 commentItem->deleteLater();
183 void CommentWidget::handleEntryModified(CommentEntry *entry)
185 if(entry->getNode() != mCurrentNode)
188 for(
const auto& item : mEntryItems)
190 if(item->getEntry() == entry)
192 item->updateCurrentEntry();
198 void CommentWidget::handleCommentAdded(CommentEntry *entry)
200 if(entry->getNode() != mCurrentNode)
213 void CommentWidget::handleSearchbarTextEdited(
const QString &text, SearchOptions opts)
215 for(
const auto &item : mEntryItems)
217 if(item->search(text, opts))
The Node class object represents a module or a gate.
A QFrame with a QLineEdit that can be used to input a substring to search for.
void setEmitTextWithFlags(bool)
void triggerNewSearch(const QString &text, int searchOptions)
QIcon getStyledSvgIcon(const QString &from_to_colors_enabled, const QString &svg_path, QString from_to_colors_disabled=QString())
CommentManager * gCommentManager
void addStretch(int stretch)
void setSpacing(int spacing)
void addLayout(QLayout *layout, int row, int column, Qt::Alignment alignment)
void setRowStretch(int row, int stretch)
void setSpacing(int spacing)
void setMargin(int margin)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual void polish(QWidget *widget)
virtual void unpolish(QWidget *widget)