title: How to select a specific entire colum of a QTableView
body: <p>I have a QTableView with three columns like the example below: </p>
  
  <p>|   <strong>Id</strong>    |    <strong>name</strong>    |    <strong>ACoord</strong>    |</p>
  
  <p>I am trying to highlight the entire ACoord column no matter which cell I am clicking on in the ACoord only.</p>
  
  <p>I have tried several examples but nothing is helpful.
  The most promising (also from official QT documentation) seems to be <code>setSelectionBehavior(QAbstractItemView::SelectColumns)</code> but didn't work exactly as I need. </p>
  
  <p>Here is the snipped of code:</p>
  
  <pre><code>connect(mTurnIntoExcelData, &amp;QAction::triggered, [&amp;]() {
          int row = -1, column = -1;
          QString reference;
          QString type;
          QModelIndex index;
          int rowModel = index.row();
          SelectionData currentData;
  
          for(int i = 0; i &lt; ui-&gt;tableViewLeft-&gt;model()-&gt;columnCount(); i++)
          {
            if(ui-&gt;tableViewLeft-&gt;model()-&gt;headerData(i, Qt::Horizontal).toString() == "ACoord") {
                column = i;
                ui-&gt;tableViewLeft-&gt;setSelectionBehavior(QAbstractItemView::SelectColumns);
                ui-&gt;tableViewLeft-&gt;setSelectionMode(QAbstractItemView::SingleSelection);
                type = "ACoord";
        }
  </code></pre>
  
  <p>The expected result is: I click on any cell of the ACoord and the entire column becomes selectable.</p>
  
  <p>However, the actual result is that if I click on any cell of ACoord column I am not able to select the entire column, but only the single cell.</p>
  
  <p>Thanks for any insight.</p>