gpt4 book ai didi

c++ - 在 Ubuntu 的 Qt 窗口中突出显示的选项卡

转载 作者:行者123 更新时间:2023-11-28 06:02:14 25 4
gpt4 key购买 nike

我正在用 C++ 创建一个应用程序,使用 QT 和样式表来设计我的应用程序。它工作得很好。但我有一个快速的问题,我想知道是否有任何方法可以在选择选项卡时丢弃它的突出显示。我正在构建一个 Qt 应用程序,结果很糟糕:

Button selected

我的 qss 是这样的:

QTabWidget::tab-bar {
alignment: center;
}

QTabBar::tab {
background-color: #F5FCFE;
border-bottom-color: #C2C7CB;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
min-width: 8ex;
padding: 2px;
height: 60px;
width: 200px;
margin: 10px;
}

QTabBar::tab:selected, QTabBar::tab:hover {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #fafafa, stop: 0.4 #f4f4f4,
stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
}

QTabBar::tab:selected {
border-color: #CFEFFC;
}

谢谢你的帮助

最佳答案

这是一个对焦框。要删除它,您应该将标签栏的焦点策略设置为“NoFocus”:

tabWidget.tabBar()->setFocusPolicy(Qt::NoFocus);

关于c++ - 在 Ubuntu 的 Qt 窗口中突出显示的选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33037322/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com