[Development] State of QtDeclarative (noob question)

Alan Alpert alan.alpert at nokia.com
Fri Dec 23 02:31:53 CET 2011


On Fri, 23 Dec 2011 10:20:56 ext Holger Hans Peter Freyther wrote:
> Hi,
> 
> I am somehow stuck with the state of Qt Declarative and I wonder if I do
> something very stupid, should use a different version/branch or what is
> wrong.... For my MIPS target I have some rendering problems and now tried
> to use QtDeclarative on my desktop.
> 
> I attempted to use qmlscene with
> examples/tutorial/gettingStarted/textedit.qml but the gettingStarted
> appears to be still broken,

Works fine for me. Note that it needs to be built (qmake && make) because it 
includes a plugin, and since this isn't being tested except for in-source 
builds at the moment install paths may be broken for shadow builds.

> so next I tried the snake example but somehow
> the UI 'jumps' (New Game toggles visibility.. present, hidden, present),

That one's actually broken. Whoops. QTBUG-23328 has been filed, thanks for 
bringing this up.

> okay I move to samegame as I remember someone told me that is _the_
> testcase. It displays nicely but somehow qmlscene is at 98% CPU (explains
> that I see things jump) manually sampling with gdb shows it is in the
> swrast of DRI/MESA (this is the GPU embedded in the i5).
> 
> 
> (gdb) bt
> #0  0xb19d7451 in ?? () from /usr/lib/i386-linux-gnu/dri/swrast_dri.so
> ... same lib
> #12 0xb19a71b1 in ?? () from /usr/lib/i386-linux-gnu/dri/swrast_dri.so
> #13 0xb7c6c4f4 in QSGRenderer::draw (this=0x850cff0, shader=0x813fb48,
> g=0x850de84) at
> ../../../qtdeclarative/src/quick/scenegraph/coreapi/qsgrenderer.cpp:713

It is a known issue that sometimes graphics drivers don't have vsync enabled 
by default. In this case, it will render as fast as possible, usually giving 
1000s of FPS and 100% CPU usage. On my machine (ubuntu 10.04 with nvida 
drivers), I was able to fix this by toggling 'sync to vblank' in the nvidia-
settings applications.
 
> 
> So I tried to go back to qmlviewer to at least have some quick1 display and
> besides the warning about QGuiApplication/QApplication it would be nice if
> qmlviewer would warn when someone tries to import QtQuick 2.0.

It does, the warning message is "QDeclarativeView only supports loading of 
root objects that derive from QGraphicsObject". Perhaps not the clearest 
message if you haven't written C++ QML elements now that I think about it...


-- 
Alan Alpert
Senior Engineer
Nokia, Qt Development Frameworks



More information about the Development mailing list