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.
我想更改 QFrame 组件的边框颜色。也尝试使用样式表,但在运行时没有效果。在我的项目中,有各种对话框 UI,它们基本上是 QFrame,我想更改所选对话框的边框颜色,即 QFrame 边框颜色。QT中是否有任何解决方法。如下所示,当任何一个选择它的相应框架边框颜色应该改变时,有两个对话框
尝试这个:
frame->setObjectName("myObject"); frame->setStyleSheet("#myObject { border: 5px solid black; }");