Border color of Qt components

£可爱£侵袭症+ 提交于 2021-02-18 12:11:29

问题


I want to change border color of QFrame component. Also tried with style sheet but no effect at run time. In my project there are various Dialog UI are there which are basically QFrame and i want to change the border color of selected dialog i.e. QFrame border color. Is there any workaround for that in QT. As shown below there are two dialog when any one of selected it's respective frame border color should get changed

Here is the snippet of which something i want to do


回答1:


Try this:

frame->setObjectName("myObject");
frame->setStyleSheet("#myObject { border: 5px solid black; }");


来源:https://stackoverflow.com/questions/24696850/border-color-of-qt-components

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!