Examples/Marketplace: Put horizontal ruler into the heading

Avoid the separate line above the heading, which also doesn't
make much sense for the first item.

Change-Id: I2cb4aa270f805552215f4f3dc114103f9f3c313f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2023-04-21 13:41:58 +02:00
parent 654dae486a
commit e596ee2b68

View File

@@ -747,7 +747,11 @@ ListModel *SectionedGridView::addSection(const Section &section, const QList<Lis
auto seeAllLink = new QLabel("<a href=\"link\">" + Tr::tr("Show All") + " &gt;</a>", this); auto seeAllLink = new QLabel("<a href=\"link\">" + Tr::tr("Show All") + " &gt;</a>", this);
seeAllLink->setVisible(gridView->maxRows().has_value()); seeAllLink->setVisible(gridView->maxRows().has_value());
connect(seeAllLink, &QLabel::linkActivated, this, [this, section] { zoomInSection(section); }); connect(seeAllLink, &QLabel::linkActivated, this, [this, section] { zoomInSection(section); });
QWidget *sectionLabel = Column{hr, Row{section.name, st, seeAllLink, Space(HSpacing)}}.emerge( QWidget *line = createHr(this);
QSizePolicy linePolicy(QSizePolicy::Expanding, QSizePolicy::Ignored);
linePolicy.setHorizontalStretch(2);
line->setSizePolicy(linePolicy);
QWidget *sectionLabel = Row{section.name, line, seeAllLink, Space(HSpacing)}.emerge(
Layouting::WithoutMargins); Layouting::WithoutMargins);
m_sectionLabels.append(sectionLabel); m_sectionLabels.append(sectionLabel);
sectionLabel->setContentsMargins(0, ItemGap, 0, 0); sectionLabel->setContentsMargins(0, ItemGap, 0, 0);