Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当用户单击它时,我需要一个将 QLabel 更改为可编辑组合框的建议。类似安卓人。我计划在隐藏 QLable 时覆盖 QLabel mousPress 并显示 QComboBox。这样对吗 ..?
你的解决方案是正确的。另一种方法是仅使用组合框并为其设置样式表,以便在未选择时隐藏边框、背景和箭头:
QComboBox:!focus{background-color: transparent; border: 0px;} QComboBox::drop-down:!focus {border-width: 0px;}