[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Review Request: Make it possible to use QtCreator QML profiler and debugger with KDE Application
From:       Aurélien Gâteau <agateau () kde ! org>
Date:       2012-09-24 13:45:28
Message-ID: 20120924134528.31961.54179 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Sept. 23, 2012, 8:56 a.m., David Faure wrote:
> > kdecore/kernel/kcmdlineargs.cpp, line 1413
> > <http://git.reviewboard.kde.org/r/106527/diff/1/?file=86675#file86675line1413>
> > 
> > Pff, this is completely inconsistent in Qt, and Qt should really be fixed to \
> > accept ' ' as a separator [in addition, to keep compat]. 
> > Yes for this patch in kdelibs for now, but please please submit a fix for Qt too, \
> > so that one day this can all be cleaned up (and in particular so that it can all \
> > use the same command-line args parser).

OK thanks, will submit a patch to Qt as well.


- Aurélien


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106527/#review19352
-----------------------------------------------------------


On Sept. 21, 2012, 3:29 p.m., Aurélien Gâteau wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/106527/
> -----------------------------------------------------------
> 
> (Updated Sept. 21, 2012, 3:29 p.m.)
> 
> 
> Review request for kdelibs, Plasma, Marco Martin, and David Faure.
> 
> 
> Description
> -------
> 
> QtCreator comes with a handy QML profiler and debugger, but it relies on tricky \
> command-line parsing and #define setup. This patch makes it possible to use it with \
> KDE applications. It does two things: 
> 1. Add the "qmljsdebugger" option to the list of qt command-line options, with a \
> hack to ensure it is passed unaltered (as in, using '=' to separate argument from \
> value, rather than ' ') 2. Add a static method to KDeclarative to enable the \
> debugger when the "qmljsdebugger" command-line option is defined. 
> I am not entirely sure about #2 as it means linking to libkdeclarative even if it \
> is not used (do we expect all KDE apps to use KDeclarative?). The alternative to \
> using it is to tell developers who want to use the QML debugger to add one of the \
> following snippets in their code. 
> Either:
> 
> // Add this snippet in one of your .cpp file.
> // Me sure it appears before any QDeclarative include.
> #define QT_DECLARATIVE_DEBUG
> #include <QtDeclarative/qdeclarativedebug.h>
> 
> or:
> 
> // Add this include to the file containing your main() function
> #include <QtDeclarative/qdeclarativedebug.h>
> 
> // Add this to your main() function.
> // Make sure it is called before instantiating a QDeclarativeView.
> QDeclarativeDebuggingEnabler enabler;
> 
> 
> Diffs
> -----
> 
> experimental/libkdeclarative/kdeclarative.h 5e404c7 
> experimental/libkdeclarative/kdeclarative.cpp 34383c0 
> kdecore/kernel/kcmdlineargs.cpp 2da636f 
> 
> Diff: http://git.reviewboard.kde.org/r/106527/diff/
> 
> 
> Testing
> -------
> 
> - Patch plasmoidviewer to call KDeclarative::setupQmlJsDebugger()
> - Run it through qmlprofiler:
> 
> qmlprofiler plasmoidviewer org.kde.example.widgetgallery
> 
> - Press r<return> (in the terminal) while it is running to start recording
> - Press q<return> to stop recording => application should stop and a file named \
>                 "plasmoidviewer_$date_$time.qtd" should be created
> - Open Qt Creator, click the "Analyze" sidebar button
> - Right click in the profiler area (bottom right) and select "Load QML Trace"
> - Select the "plasmoidviewer_$date_$time.qtd" file
> 
> 
> Thanks,
> 
> Aurélien Gâteau
> 
> 


[Attachment #5 (text/html)]

<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="http://git.reviewboard.kde.org/r/106527/">http://git.reviewboard.kde.org/r/106527/</a>
  </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On September 23rd, 2012, 8:56 a.m., <b>David \
Faure</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="http://git.reviewboard.kde.org/r/106527/diff/1/?file=86675#file86675line1413" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kdecore/kernel/kcmdlineargs.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </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; \
">KCmdLineArgsPrivate::setOption(const QByteArray &amp;opt, const QByteArray \
&amp;value)</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">1413</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">          \
<span class="c1">// passed using a &#39;=&#39; separator rather than a space, so we \
recreate it</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;">Pff, this is completely \
inconsistent in Qt, and Qt should really be fixed to accept &#39; &#39; as a \
separator [in addition, to keep compat].

Yes for this patch in kdelibs for now, but please please submit a fix for Qt too, so \
that one day this can all be cleaned up (and in particular so that it can all use the \
same command-line args parser).</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;">OK thanks, \
will submit a patch to Qt as well.</pre> <br />




<p>- Aurélien</p>


<br />
<p>On September 21st, 2012, 3:29 p.m., Aurélien Gâteau wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kdelibs, Plasma, Marco Martin, and David Faure.</div>
<div>By Aurélien Gâteau.</div>


<p style="color: grey;"><i>Updated Sept. 21, 2012, 3:29 p.m.</i></p>






<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;">QtCreator comes with a handy QML profiler and debugger, but it relies on \
tricky command-line parsing and #define setup. This patch makes it possible to use it \
with KDE applications. It does two things:

1. Add the &quot;qmljsdebugger&quot; option to the list of qt command-line options, \
with a hack to ensure it is passed unaltered (as in, using &#39;=&#39; to separate \
argument from value, rather than &#39; &#39;) 2. Add a static method to KDeclarative \
to enable the debugger when the &quot;qmljsdebugger&quot; command-line option is \
defined.

I am not entirely sure about #2 as it means linking to libkdeclarative even if it is \
not used (do we expect all KDE apps to use KDeclarative?). The alternative to using \
it is to tell developers who want to use the QML debugger to add one of the following \
snippets in their code.

Either:

    // Add this snippet in one of your .cpp file.
    // Me sure it appears before any QDeclarative include.
    #define QT_DECLARATIVE_DEBUG
    #include &lt;QtDeclarative/qdeclarativedebug.h&gt;

or:

    // Add this include to the file containing your main() function
    #include &lt;QtDeclarative/qdeclarativedebug.h&gt;

    // Add this to your main() function.
    // Make sure it is called before instantiating a QDeclarativeView.
    QDeclarativeDebuggingEnabler enabler;</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;">- Patch plasmoidviewer to call \
                KDeclarative::setupQmlJsDebugger()
- Run it through qmlprofiler:

    qmlprofiler plasmoidviewer org.kde.example.widgetgallery

- Press r&lt;return&gt; (in the terminal) while it is running to start recording
- Press q&lt;return&gt; to stop recording =&gt; application should stop and a file \
                named &quot;plasmoidviewer_$date_$time.qtd&quot; should be created
- Open Qt Creator, click the &quot;Analyze&quot; sidebar button
- Right click in the profiler area (bottom right) and select &quot;Load QML \
                Trace&quot;
- Select the &quot;plasmoidviewer_$date_$time.qtd&quot; file</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>experimental/libkdeclarative/kdeclarative.h <span style="color: \
grey">(5e404c7)</span></li>

 <li>experimental/libkdeclarative/kdeclarative.cpp <span style="color: \
grey">(34383c0)</span></li>

 <li>kdecore/kernel/kcmdlineargs.cpp <span style="color: grey">(2da636f)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/106527/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic