title: No member named 'setResizeMode' in 'QHeaderView' - Convert Qt 4.7 to Qt 5.8
body: <p>I need to <strong>convert Qt legacy code from 4.7 to 5.8</strong>, I have a compilation error in Qt Creator 4.2.1 Clang 7.0(Apple) 64bit.  </p>
  
  <p><strong>Looking in .cpp file</strong></p>
  
  <pre><code>#include "frmMainTableView_UI.h"
  #include &lt;QHeaderView&gt;
  
  void frmMainTableView_UI::setupUI(const QMap&lt;int, QString&gt; &amp;columnNames_, bool hasRowLabels_, QWidget *parent_)
  {
      widget = new QWidget(parent_);
  
      layout = new QVBoxLayout(widget);
      layout-&gt;setSpacing(0);
      layout-&gt;setMargin(1);
  
      frmMainToolbar_UI::setupUI(columnNames_, widget);
  
      tableSplitter = new QSplitter(widget);
  
      table = new mpiTableView(hasRowLabels_, widget);
      tableCopy = new QShortcut(Qt::CTRL + Qt::Key_C, table);
      if (!hasRowLabels_)
          table-&gt;verticalHeader()-&gt;hide();
      table-&gt;setSelectionMode(QAbstractItemView::ExtendedSelection);
      table-&gt;setSelectionBehavior(QAbstractItemView::SelectRows);
      table-&gt;setAlternatingRowColors(true);
      table-&gt;horizontalHeader()-&gt;setHighlightSections(false);
      table-&gt;verticalHeader()-&gt;setResizeMode(QHeaderView::ResizeToContents);  // Error convert Qt4 to Qt5 ??
      table-&gt;horizontalHeader()-&gt;setResizeMode(QHeaderView::ResizeToContents);  // Error convert Qt4 to Qt5  ??
      tableSplitter-&gt;addWidget(table);
      tableSplitter-&gt;setStretchFactor(0, 3);
  
      layout-&gt;addWidget(toolbar);
      layout-&gt;addWidget(tableSplitter);
  }
  </code></pre>
  
  <p><strong>2 Errors in .cpp</strong></p>
  
  <p>In file included from ../src/ui/frmMainTableView_UI.cpp:1:
  ../src/ui/frmMainTableView_UI.h:21:18: <strong>warning</strong> : 'frmMainTableView_UI::setupUI' hides overloaded virtual function [-Woverloaded-virtual]
      virtual void setupUI(const QMap &amp;columnNames_, bool hasRowLabels_, QWidget *parent_ = 0);
                   ^</p>
  
  <p>../src/ui/frmMainToolbar_UI.h:31:18: note: hidden overloaded virtual function 'frmMainToolbar_UI::setupUI' declared here: different number of parameters (2 vs 3)
      virtual void setupUI(const QMap &amp;columnNames_, QWidget *parent_ = 0);
                   ^</p>
  
  <p>../src/ui/frmMainTableView_UI.cpp:24:30: <strong>error: no member named 'setResizeMode' in 'QHeaderView'</strong> ; did you mean 'sectionResizeMode'?
      table->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);  // JDL Error convert Qt4 to Qt5 ??
                               ^~~~~~~~~~~~~
                               sectionResizeMode
  /Users/john/Qt/5.8/clang_64/lib/QtWidgets.framework/Headers/qheaderview.h:133:16: note: 'sectionResizeMode' declared here
      ResizeMode sectionResizeMode(int logicalIndex) const;
                 ^</p>
  
  <p>../src/ui/frmMainTableView_UI.cpp:25:32: <strong>error: no member named 'setResizeMode' in 'QHeaderView'</strong> ; did you mean 'sectionResizeMode'?
      table->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);  // JDL Error convert Qt4 to Qt5  ??
                                 ^~~~~~~~~~~~~
                                 sectionResizeMode
  /Users/john/Qt/5.8/clang_64/lib/QtWidgets.framework/Headers/qheaderview.h:133:16: note: 'sectionResizeMode' declared here
      ResizeMode sectionResizeMode(int logicalIndex) const;
                 ^</p>
  
  <p><strong>1 warning and 2 errors generated</strong>
  make: *** [frmMainTableView_UI.o] Error 1
  18:29:48: The process "/usr/bin/make" exited with code 2.
  Error while building/deploying project mypersonalindex (kit: Desktop Qt 5.8.0 clang 64bit)
  When executing step "Make"</p>
  
  <p>The Qt5 Docs mentioned <strong>Obsolete Members for QHeaderView</strong>
  The following members of class QHeaderView are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.</p>
  
  <p><strong>(obsolete) void setResizeMode(ResizeMode mode)</strong></p>
  
  <p>My C++ skill is pretty limited, do you see any minor tweaks that could convert this from Qt4 to Qt5. ... so what is the replacement?</p>