<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div>Hi all,</div><div><br></div><div>Are there any other ways to specify a table model's section position, other than by using the db schema's column order?</div><div><br></div><div>I'm referring to methods like:</div><div><br></div><div><span style=" font-size:large; font-weight:600; color:#000000;">b</span><span style=" font-size:large; font-weight:600; color:#000000;">ool QSqlQueryModel::setHeaderData ( int </span><span style=" font-size:large; font-weight:600; font-style:italic; color:#000000;">section</span><span style=" font-size:large; font-weight:600; color:#000000;">, </span><a href="qt.html#Orientation-enum"><span style=" font-size:large; font-weight:600; color:#004faf;">Qt::Orientation</span></a><span style=" font-size:large; font-weight:600; color:#000000;"> </span><span style=" font-size:large; font-weight:600; font-style:italic; color:#000000;">orientation</span><span style=" font-size:large; font-weight:600; color:#000000;">, const </span><a href="qvariant.html"><span style=" font-size:large; font-weight:600; color:#004faf;">QVariant</span></a><span style=" font-size:large; font-weight:600; color:#000000;"> & </span><span style=" font-size:large; font-weight:600; font-style:italic; color:#000000;">value</span><span style=" font-size:large; font-weight:600; color:#000000;">, int </span><span style=" font-size:large; font-weight:600; font-style:italic; color:#000000;">role</span><span style=" font-size:large; font-weight:600; color:#000000;"> = Qt::EditRole ) </span></div><div><span class="Apple-style-span" style="font-size: large; font-weight: 600;"><br></span></div><div>With the method's "int section" arg, if table columns in my db schema get reordered, my code breaks. For example, today this line works properly:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self.theModel.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("Name"))</div><div><br></div><div>If the table's name field changes from the 1st to the 3rd column during an update, then the statement reads incorrect data.</div><div><br></div><div>Thanks in advance!</div><div>Scott</div><div><br></div><div><br></div></body></html>