title: How to set Qtextedit background color?
body: <p>I noticed that if in HTML we use type bgcolor="#ffd814" then in textedit the background color will change to the color. How can I get same result from QAction and QColorDialog?</p>
  
  <p>I used this</p>
  
  <pre><code>void MainWindow::on_actionBackground_Color_triggered()
  {    
      QColor color = QColorDialog::getColor(Qt::white,this);
      QPalette palette;
      palette.setColor(QPalette::Base,color);
      if(color.isValid())
          ui-&gt;textEdit-&gt;setPalette(palette);
  }
  </code></pre>
  
  <p>But it does not change HTML, so after closing and opening the file background is white.</p>
  
  <p><strong>Remark:</strong> using bgcolor="#ffd814" in &lt; body bgcolor="#ffd814" > does not change the scrollbar color in textedit.</p>
  
  <p>If we use QColor::name it will return in QString format color name (#ffd814) how can we put it in a html. for example</p>
  
  <pre><code>void MainWindow::on_actionText_Color_triggered()
  {
      QColor color = QColorDialog::getColor(Qt::white,this);
      if(color.isValid())
          ui-&gt;textEdit-&gt;setTextColor(color);
  }
  </code></pre>
  
  <p>this changes color of selected text and saves it in html, so changes we made in textedit are remembered.</p>