title: how to set color of frame of Qframe?
body: <p>I want to set a color of the frame provide by QFrame in pyside2.</p>
  
  <p>Below document provide complete details, how to create a frame with the different style, like a box, panel, Hline, etc...</p>
  
  <p><a href="https://doc-snapshots.qt.io/qtforpython/PySide2/QtWidgets/QFrame.html#detailed-description" rel="nofollow noreferrer">https://doc-snapshots.qt.io/qtforpython/PySide2/QtWidgets/QFrame.html#detailed-description</a></p>
  
  <p>My question is how I can set the color of that frame. 
  I tried to set the color using "background-color" and "border" stylesheet, but not get output which I want.</p>
  
  <p>Below is my code.</p>
  
  <pre><code>class HLine(QFrame):
      def __init__(self, parent=None, color="black"):
          super(HLine, self).__init__(parent)
          self.setFrameShape(QFrame.HLine)
          self.setFrameShadow(QFrame.Plain)
          self.setLineWidth(0)
          self.setMidLineWidth(3)
          self.setContentsMargins(0, 0, 0, 0)
          self.setStyleSheet("border:1px solid %s" % color)
  
      def setColor(self, color):
          self.setStyleSheet("background-color: %s" % color)
          pass
  </code></pre>
  
  <p>Out without any stylesheet.</p>
  
  <p><a href="https://i.stack.imgur.com/6T73a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6T73a.png" alt="enter image description here"></a></p>
  
  <p>Output with border style sheet</p>
  
  <p><a href="https://i.stack.imgur.com/jvzIT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jvzIT.png" alt="enter image description here"></a></p>
  
  <p>Out with background-color stylesheet</p>
  
  <p><a href="https://i.stack.imgur.com/p61BL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p61BL.png" alt="enter image description here"></a></p>
  
  <p>both are stylesheet giving unwanted output. </p>
  
  <p>How can I set color without changing the look of the frame?</p>