<div dir="ltr">Hi Tadeusz,<div><br><div style>Although Qt docs don't mention it specifically, I suspect that QSqlTableModel's setFilter method resets the model causing the attached views redrawing themselves, including their headers. You clould use a QSortFilterProxyModel which would not reset upon setting its filter, resulting in the desired behaviour.</div><div style><br></div><div style>Regards Kris</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 February 2015 at 14:49, Tadeusz Sośnierz <span dir="ltr"><<a href="mailto:tadeusz.sosnierz@onet.pl" target="_blank">tadeusz.sosnierz@onet.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey,<br>
I started writing myself a little app with D&D spell list. Worked well<br>
enough until I tried the search functionality. I'm using SilicaListView<br>
with SearchField in it to grep through the QSqlTableModel, and when I<br>
type one letter into the search box it clears itself and defocuses the<br>
keyboard. The search still occurs, for that single letter that got typed in.<br>
<br>
[1] is where I react on keyboard input. If I comment out spells.search()<br>
line the issue with SearchField no longer occurs (but it's pretty<br>
useless for obvious reasons). That makes me think that something on the<br>
C++ side is wrong ([2]), but I don't see why it would affect the view so<br>
dramatically.<br>
<br>
Could anyone point out where did I screw it up? General code criticism<br>
is welcome too :)<br>
<br>
Best regards,<br>
Tadeusz Sośnierz<br>
<br>
[1]<br>
<a href="https://github.com/tadzik/harbour-dndhelper/blob/master/qml/pages/SpellList.qml#L16" target="_blank">https://github.com/tadzik/<u></u>harbour-dndhelper/blob/master/<u></u>qml/pages/SpellList.qml#L16</a><br>
[2]<br>
<a href="https://github.com/tadzik/harbour-dndhelper/blob/master/src/Spells.cpp#L74" target="_blank">https://github.com/tadzik/<u></u>harbour-dndhelper/blob/master/<u></u>src/Spells.cpp#L74</a><br>
<br>
<br>
______________________________<u></u>_________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">devel-unsubscribe@lists.<u></u>sailfishos.org</a></blockquote></div><br></div>