title: Qt use palette color in stylesheet
body: <p>In qt you normally set the color of a <code>QWidget</code> with the <code>QPalette</code>.</p>
  
  <p>Example:</p>
  
  <pre><code>QPalette palette = new QPalette();
  palette.setBrush(QPalette::Base, this-&gt;palette().backgorund());
  
  QLineEdit *line = new QLineEdit();
  line-&gt;setPalette(palette);
  </code></pre>
  
  <p>Now I have a little problem. It is not possible to change the bordercolor of a QLineEdit with the <code>QPalette</code>. That means, that I have to use a <code>QStyleSheet</code>.</p>
  
  <p>Example:</p>
  
  <pre><code>QLineEdit *line = new QLineEdit();
  line.setStyleSheet("border: 1px solid green");
  </code></pre>
  
  <p>But now I can't set the basecolor of the QLineEdit with <code>QPalette</code>, because the background-color of QLineEdit is not longer connected to <code>QPalette::base</code>.
  That means, that the following code wouldn't change the <code>background-color</code> of the <code>QLineEdit</code>:</p>
  
  <pre><code>QPalette palette = new QPalette();
  palette.setBrush(QPalette::Base, this-&gt;palette().backgorund());
  
  QLineEdit *line = new QLineEdit();
  line-&gt;setPalette(palette);
  line-&gt;setStyleSheet("border: 1px solid green");
  </code></pre>
  
  <p>But it is not possible, to define the <code>background-color</code> of the QLineEdit in the StyleSheet, because the <code>background-color</code> of the <code>QLineEdit</code> have to be dynamically.</p>
  
  <p>My question: How to connect the background-color of the <code>QLineEdit</code> with <code>QPalette::base</code> to define the <code>background-color</code> of <code>QLineEdit</code> dynamically with <code>QPalette</code>?</p>