开发者

QT Breadcrumb Navigation

开发者 https://www.devze.com 2023-02-20 00:30 出处:网络
I would like to add a breadcrumb navig开发者_Python百科ation bar to a QT application. In KDE there is KUrlNavigator which is used by dolphin. Is there a native QT widget?qxtcrumbview in libqxt.org

I would like to add a breadcrumb navig开发者_Python百科ation bar to a QT application. In KDE there is KUrlNavigator which is used by dolphin. Is there a native QT widget?


qxtcrumbview in libqxt.org

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


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号