Review Request: Make it possible to use QtCreator QML profiler and debugger with KDE Applications

Aurélien Gâteau agateau at kde.org
Mon Sep 24 14:45:28 BST 2012



> 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
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20120924/c172779d/attachment.htm>


More information about the kde-core-devel mailing list