Commit f13fbf4b authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Fix warnings when opening the isotope viewer

There the LegendItems don't have parents so we should not connect

Also use the modern connect syntax while at it
parent 3f392080
Pipeline #145228 passed with stage
in 58 seconds
......@@ -174,14 +174,16 @@ bool LegendWidget::isElementMatch(int element, QColor &color){
LegendItem::LegendItem(const QPair<QString, QColor>& pair, QWidget * parent)
LegendItem::LegendItem(const QPair<QString, QColor>& pair, LegendWidget * parent)
QHBoxLayout *ItemLayout = new QHBoxLayout(this);
ItemLayout->setContentsMargins(0, 0, 0, 0);
if (pair.second.isValid()) {
legendItemColor = pair.second;
connect(this, SIGNAL(legenItemHoovered(QColor)), parent, SLOT(legendItemAction(QColor)));
if (parent) {
connect(this, &LegendItem::legenItemHoovered, parent, &LegendWidget::legendItemAction);
QPixmap LegendPixmap(20, height());
......@@ -68,7 +68,7 @@ class LegendItem : public QLabel
LegendItem(const QPair<QString, QColor>& pair, QWidget * parent = nullptr);
LegendItem(const QPair<QString, QColor>& pair, LegendWidget * parent = nullptr);
~LegendItem() {}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment