4

I would like to add a breadcrumb navigation bar to a QT application. In KDE there is KUrlNavigator which is used by dolphin. Is there a native QT widget?

Wienczny
  • 3,958
  • 4
  • 30
  • 35

2 Answers2

4

qxtcrumbview in libqxt.org

Not documented, you need to download the source code in order to find this one.

Mason Zhang
  • 3,423
  • 24
  • 35
1

This may be achieved with QLabel: There may be multiple links in a single QLabel, see QLabel::openExternalLinks() and Qt::TextInteractionFlags.
Or in more detail:

auto label = new QLabel(); 
label->setText(
  "<a href=\"https://doc.qt.io/qt-5/qlabel.html\">"
  "QLabel</a>::"
  "<a href=\"https://doc.qt.io/qt-5/qlabel.html#textInteractionFlags-prop\">"
  "textInteractionFlags</a>");
label->setTextFormat(Qt::RichText);
label->setTextInteractionFlags(Qt::TextBrowserInteraction);
label->setOpenExternalLinks(true);
StefanQ
  • 708
  • 10
  • 16
  • So you can add multiple html links to the label, use `setTextInteractionFlags(Qt::TextBrowserInteraction)` and then listen on the `linkActivated` signal to get the clicked entry? – Wienczny Nov 15 '19 at 14:10