10 #include <QHBoxLayout>
11 #include <QPushButton>
12 #include <QToolButton>
15 #include <QSpacerItem>
37 QSize iconSize(20, 20);
48 mHeaderLayout->
addWidget(mNewCommentButton);
62 mCommentsContainer =
new QWidget();
63 mCommentsContainer->
show();
64 mCommentsContainer->
setLayout(mCommentsLayout);
66 mScrollArea->
setWidget(mCommentsContainer);
97 mScrollArea->
setWidget(createAndFillCommentContainerFactory(nd));
100 QWidget *CommentWidget::createAndFillCommentContainerFactory(
const Node &nd)
111 for(
const auto& entry : commentList)
118 mEntryItems.append(item);
125 void CommentWidget::handleSearchbarTriggered()
129 mSearchButton->
hide();
135 mSearchButton->
show();
139 void CommentWidget::handleNewCommentTriggered()
141 CommentDialog commentDialog(
"New Comment");
146 commentDialog.close();
149 void CommentWidget::handleCommentEntryDeleteRequest(CommentItem *item)
152 mEntryItems.removeOne(item);
162 void CommentWidget::handleCommentAboutToBeDeleted(CommentEntry *entry)
165 CommentItem* commentItem =
nullptr;
166 for(
const auto& item : mEntryItems)
168 if(item->getEntry() == entry)
175 if(commentItem ==
nullptr)
179 mEntryItems.removeOne(commentItem);
181 commentItem->deleteLater();
184 void CommentWidget::handleEntryModified(CommentEntry *entry)
186 if(entry->getNode() != mCurrentNode)
189 for(
const auto& item : mEntryItems)
191 if(item->getEntry() == entry)
193 item->updateCurrentEntry();
199 void CommentWidget::handleCommentAdded(CommentEntry *entry)
201 if(entry->getNode() != mCurrentNode)
214 void CommentWidget::handleSearchbarTextEdited(
const QString &text, SearchOptions opts)
216 for(
const auto &item : mEntryItems)
218 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)
void setMarginWidth(QLayout *layout, int marginWidth)
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)
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)