title: Export data from qtablewidget to csv
body: <p>I have a little problem with export data to csv (comma-separated values). All data was exported, but headers and name of rows from QTableWidget don't. I need headers of columns and rows. </p>
  
  <p>Do you have any idea how to get name headers of columns and name of rows?
  Here is my code:</p>
  
  <pre><code>QFile f( "money.csv" );
  
  if (f.open(QFile::WriteOnly | QFile::Truncate))
  {
      QTextStream data( &amp;f );
      QStringList strList;
  
      for( int r = 0; r &lt; ui-&gt;tableWidget-&gt;rowCount(); ++r )
      {
          strList.clear();
          for( int c = 0; c &lt; ui-&gt;tableWidget-&gt;columnCount(); ++c )
          {
              strList &lt;&lt; "\" "+ui-&gt;tableWidget-&gt;item( r, c )-&gt;text()+"\" ";
          }
          data &lt;&lt; strList.join( ";" )+"\n";
      }
      f.close();
  }
  </code></pre>