<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
<!--
@font-face
{font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline}
span.EmailStyle17
{font-family:"Calibri","sans-serif";
color:windowtext}
.MsoChpDefault
{font-family:"Calibri","sans-serif"}
@page WordSection1
{margin:70.85pt 2.0cm 70.85pt 2.0cm}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" lang="FI" link="blue" vlink="purple">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi!<br>
<br>
Either that or use the QSqlQueryModel in your c++ and expose that to QML ; just like in :<br>
<a href="http://qt-project.org/wiki/How_to_use_a_QSqlQueryModel_in_QML" target="_blank">http://qt-project.org/wiki/How_to_use_a_QSqlQueryModel_in_QML</a><br>
<br>
thanks, Jarko<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF664095"><font color="#000000" face="Tahoma" size="2"><b>From:</b> devel-bounces@lists.sailfishos.org [devel-bounces@lists.sailfishos.org] on behalf of Kimmo Lindholm [Kimmo.Lindholm@eke.fi]<br>
<b>Sent:</b> Friday, May 23, 2014 9:17 AM<br>
<b>To:</b> devel@lists.sailfishos.org<br>
<b>Subject:</b> [SailfishDevel] Technical question: populating ListModel from C++<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi All,</span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Arial","sans-serif"" lang="EN-GB"> </span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Arial","sans-serif"" lang="EN-GB">What would be the best method to populate ListModel in QML from the C++ side?</span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Arial","sans-serif"" lang="EN-GB"> </span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Arial","sans-serif"" lang="EN-GB">I have sqlite database, which contents I would like to put on ListView.</span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Arial","sans-serif"" lang="EN-GB"> </span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Arial","sans-serif"" lang="EN-GB">List is changed only by user when deleting or adding entry, upon this action I would like to update sqlite and then refresh listmodel.</span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Arial","sans-serif"" lang="EN-GB"> </span></p>
<p class="MsoNormal"><span style="font-size:8.0pt; font-family:"Arial","sans-serif"" lang="EN-GB">-kimmo</span><span lang="EN-US"></span></p>
</div>
</div>
</div>
</div>
</body>
</html>