<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/118918/">https://git.reviewboard.kde.org/r/118918/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On June 24th, 2014, 9:35 p.m. UTC, <b>Sven Brauch</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/118918/diff/2/?file=284451#file284451line1122" style="color: black; font-weight: bold; text-decoration: underline;">duchain/declarationbuilder.cpp</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void DeclarationBuilder::closeAndAssignType()</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1122</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span> <span class="p">(</span><span class="n">name</span> <span class="o">==</span> <span class="n">QLatin1String</span><span class="p">(</span><span class="s">"QFont"</span><span class="p">))</span> <span class="p">{</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Where does this C++ style name come from ...? What file is it read from?</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">QML module files use the C++ type names. For instance, this snippet comes from QtQuick.Controls_1.0.qml:
Component {
name: "QQuickStyleItem"
prototype: "QQuickItem"
...
Property { name: "font"; type: "QFont"; isReadonly: true }
}
"QFont" cannot be kept as is, because the Qt documentation says that the "font" property of StyleItems is of type "Font". The line you highlight therefore replaces "QFont" with "Font" so that every font-like property will have the same type. Moreover, QML properties and values have a definite type, so maybe it would be possible, one day, to have strict type checking in QML. If this happens, having properties of type "QFont" and values of type "font" would be a bit difficult to handle.
Having Font inheriting from QFont or the other way around is also possible, but which type should inherit from the other? The two are conceptually exactly the same, hence the renaming.</pre>
<br />
<p>- Denis</p>
<br />
<p>On June 24th, 2014, 1:46 p.m. UTC, Denis Steckelmacher wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for KDevelop.</div>
<div>By Denis Steckelmacher.</div>
<p style="color: grey;"><i>Updated June 24, 2014, 1:46 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kdev-qmljs
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The QML language contains several built-in types, listed on this page: http://qt-project.org/doc/qt-5/qtqml-typesystem-basictypes.html. These types are not declared inside any module, so this patch adds a "built-in" module that declares these types.
Because most of the QML built-in types also exist in a C++ version (rect = QRect, Font = QFont, etc), this patch also adds a small translation layer between the C++ type names and the QML type names. This way, QML modules (that use the C++ names) can declares properties that will end up having the right type. A property declared of type "QRect" will have the type "rect", and all the attributes expected by the user.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">A new code-completion unit test has been added. It ensures that typing "font." in a QML component having a font property of type Font displays the properties of QFont. The unit tests don't test all the type names and all the attributes of the types (it would be huge), but Font is the most interesting type.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>qmlplugins/builtins_1.0.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>tests/files/test.qml <span style="color: grey">(a36cfdb)</span></li>
<li>qmlplugins/QtQuick_2.0.qml <span style="color: grey">(6d20f7a)</span></li>
<li>qmlplugins/QtQuick_1.0.qml <span style="color: grey">(50c08b9)</span></li>
<li>codecompletion/tests/qmlcompletiontest.cpp <span style="color: grey">(e129b09)</span></li>
<li>duchain/declarationbuilder.cpp <span style="color: grey">(aab8aeb)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/118918/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>