6

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

foxt7ot
  • 2,465
  • 1
  • 19
  • 30

1 Answers1

8

Try this:

frame->setObjectName("myObject");
frame->setStyleSheet("#myObject { border: 5px solid black; }");
Leo Chapiro
  • 13,678
  • 8
  • 61
  • 92
  • Thanks that had worked. Can you suggest me how can apply glowing effect on border. Is it possible in QT? – foxt7ot Jul 11 '14 at 11:51
  • Yes, it is possible - I have not used this feature yet but take a look: http://qt-project.org/doc/qt-5/qml-qtgraphicaleffects-glow.html – Leo Chapiro Jul 11 '14 at 12:00