【问题标题】:QPushButton in Qt designerQt 设计器中的 QPushButton
【发布时间】:2021-01-20 18:03:03
【问题描述】:

如何在选中模式下从我的 QPush Button 中移除这个黑暗区域? 按钮是扁平的

【问题讨论】:

  • 我很难找到解决您问题的方法。你想分享更多细节吗?

标签: qt qt5 qt-designer


【解决方案1】:

如果你想去掉背景色和按钮的边框,你可以像这样使用样式表:

auto button = new QPushButton;
button->setCheckable(true);
button->setStyleSheet("QPushButton:checked"
                      "{"
                      "    background-color: transparent;"
                      "    border: none;"
                      "}");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-23
    • 2012-12-04
    • 2020-10-03
    • 1970-01-01
    • 1970-01-01
    • 2012-05-17
    相关资源
    最近更新 更多