【问题标题】:QToolButton - html textQToolButton - html 文本
【发布时间】:2013-03-24 15:24:06
【问题描述】:

是否可以像在QLabel 中那样使用 HTML 格式化 QToolButton 文本? toolbutton.SetText("Text <b>Test</b>") 不起作用

【问题讨论】:

    标签: qt


    【解决方案1】:

    如果不继承 QToolButton 并覆盖 paintEvent,我认为这是不可能的,但如果您只想设置按钮中的文本样式,可以像这样使用 Qt Style Sheets

    toolButton->setStyleSheet("font-weight: bold");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-04
      • 1970-01-01
      • 2013-04-07
      • 2013-08-07
      • 1970-01-01
      • 2015-04-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多