Skip to content

Commit

Permalink
iiodebugger: Fix path title button
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei-Fabian-Pop <[email protected]>
  • Loading branch information
Andrei-Fabian-Pop committed Sep 18, 2024
1 parent fe5fe23 commit 9700f9b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/debugger/src/iioexplorer/pathtitle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ void PathTitle::setTitle(QString title)
QStringList segmentStrings = title.split(SPLIT_CHAR, Qt::SkipEmptyParts);
QString auxPath;

for(QString segment : segmentStrings) {
QPushButton *btn = new QPushButton(segment, this);
for(int i = 0; i < segmentStrings.size(); ++i) {
QPushButton *btn = new QPushButton(segmentStrings[i], this);
StyleHelper::GrayButton(btn, "SegmentButton");
auxPath.append(segment);
auxPath.append(segmentStrings[i]);
connect(btn, &QPushButton::clicked, this, [this, auxPath]() { Q_EMIT pathSelected(auxPath); });
layout()->addWidget(btn);

if(i < segmentStrings.size() - 1) {
auxPath.append("/");
}
}
}

Expand Down

0 comments on commit 9700f9b

Please sign in to comment.