20 #ifndef LIBREPCB_LIBRARY_EDITOR_LIBRARYELEMENTCHECKLISTWIDGET_H 21 #define LIBREPCB_LIBRARY_EDITOR_LIBRARYELEMENTCHECKLISTWIDGET_H 47 std::shared_ptr<const LibraryElementCheckMessage> msg) noexcept = 0;
49 std::shared_ptr<const LibraryElementCheckMessage> msg) noexcept = 0;
51 std::shared_ptr<const LibraryElementCheckMessage> msg) noexcept = 0;
73 std::shared_ptr<const LibraryElementCheckMessage> msg,
75 QWidget* parent =
nullptr) noexcept
79 mIconLabel(new QLabel(this)) {
81 QHBoxLayout* layout =
new QHBoxLayout(
this);
82 layout->setContentsMargins(0, 0, 0, 0);
83 layout->setSpacing(3);
86 mIconLabel->setScaledContents(
true);
87 mIconLabel->setPixmap(msg->getSeverityPixmap());
88 layout->addWidget(mIconLabel.data());
91 QLabel* lblMsg =
new QLabel(msg->getMessage(),
this);
92 lblMsg->setToolTip(msg->getMessage());
93 layout->addWidget(lblMsg);
94 layout->setStretch(1, 100);
97 if (mHandler.libraryElementCheckFixAvailable(mMessage)) {
98 QToolButton* btnFix =
new QToolButton(
this);
99 btnFix->setText(tr(
"Fix"));
100 connect(btnFix, &QToolButton::clicked,
101 [
this]() { mHandler.libraryElementCheckFixRequested(mMessage); });
102 layout->addWidget(btnFix);
106 QToolButton* btnDetails =
new QToolButton(
this);
107 btnDetails->setText(
"?");
108 btnDetails->setToolTip(tr(
"Details"));
109 connect(btnDetails, &QToolButton::clicked, [
this]() {
110 mHandler.libraryElementCheckDescriptionRequested(mMessage);
112 layout->addWidget(btnDetails);
124 QWidget::resizeEvent(event);
125 mIconLabel->setFixedWidth(mIconLabel->height());
129 std::shared_ptr<const LibraryElementCheckMessage>
mMessage;
162 void updateList() noexcept;
163 void itemDoubleClicked(QListWidgetItem* item) noexcept;
165 std::shared_ptr<const LibraryElementCheckMessage> msg) noexcept
override;
167 std::shared_ptr<const LibraryElementCheckMessage> msg) noexcept
override;
169 std::shared_ptr<const LibraryElementCheckMessage> msg) noexcept
override;
185 #endif // LIBREPCB_LIBRARY_EDITOR_LIBRARYELEMENTCHECKLISTWIDGET_H virtual void libraryElementCheckDescriptionRequested(std::shared_ptr< const LibraryElementCheckMessage > msg) noexcept=0
QVector< std::shared_ptr< const LibraryElementCheckMessage > > LibraryElementCheckMessageList
Definition: libraryelementcheckmessage.h:96
virtual bool libraryElementCheckFixAvailable(std::shared_ptr< const LibraryElementCheckMessage > msg) noexcept=0
IF_LibraryElementCheckHandler() noexcept
Definition: libraryelementchecklistwidget.h:54
IF_LibraryElementCheckHandler(const IF_LibraryElementCheckHandler &) noexcept
Definition: libraryelementchecklistwidget.h:55
Definition: airwiresbuilder.cpp:32
virtual ~IF_LibraryElementCheckHandler() noexcept
Definition: libraryelementchecklistwidget.h:57
Definition: libraryelementchecklistwidget.h:44
virtual void libraryElementCheckFixRequested(std::shared_ptr< const LibraryElementCheckMessage > msg) noexcept=0