title: How to get the dialog background color (window color) in a Qt Gui application?
body: <p>My Qt version is 4.7.1 and I want to set the background color of a QLineEdit the same as window color, and I use this way:</p>
  
  <pre><code>QString bgColorName = palette().color(QPalette::Normal, QPalette::Window).name();
  QString strStyleSheet = QString("QLineEdit {background-color: ").append(bgColorName).append("}");
  ui-&gt;lineEdit-&gt;setStyleSheet(strStyleSheet);
  </code></pre>
  
  <p>I tried to get the background colors name and then set the stylesheet of the QLineEdit, however, after running the application, I found the QLineEdit's color is a little different, that is, if you look at it carefully, you can see the difference, both on Win7 and Mac.
  Could anyone help me to find a way to get the right background color of the dialog, thank you in advance.</p>