[Qt-interest] QtStateMachine Dependency on QtQui

Will Rutherdale (rutherw) rutherw at cisco.com
Thu Oct 29 16:44:20 CET 2009


I don't use any of those classes.

Someone at work looked around and found a more direct answer to the
question.  The files qtstatemachine.pri and statemachine.pri contain
some controls where you can turn off gui dependency when building the
state machine library.

I haven't yet looked into Qt 4.6 to see whether their QtStateMachine
module is built in a way that forces you to link with QtGui.

-Will


> -----Original Message-----
> From: qt-interest-bounces at trolltech.com 
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Sean Harmer
> Sent: 28 October 2009 11:53
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] QtStateMachine Dependency on QtQui
> 
> Hi,
> 
> Looking at the Qt source I see that some state machine 
> classes are part of the 
> GUI lib. In particular these files:
> 
> qbasickeyeventtransition.cpp
> qbasickeyeventtransition_p.h
> qbasicmouseeventtransition.cpp
> qbasicmouseeventtransition_p.h
> qguistatemachine.cpp
> qkeyeventtransition.cpp
> qkeyeventtransition.h
> qmouseeventtransition.cpp
> qmouseeventtransition.h
> 
> Do you use any of the contained classes in your code?
> 
> The attached trivial application shows that it works here 
> without linking to 
> QtGui. Start from a small example and work your way up to see 
> what it is that 
> is bringing in your dependency on the QtGui lib.
> 
> HTH,
> 
> Sean
> 
> On Wednesday 28 Oct 2009 15:12:47 Will Rutherdale (rutherw) wrote:
> > Hi.
> > 
> > I attempted to bring QtStateMachine into some embedded code 
> that uses
> > only QCoreApplication and doesn't touch gui classes.  The .pro file
> > contains the line
> > QT -= gui
> > 
> > It worked so far as I tested it in a Fedora environment.  However,
> > bringing it onto an embedded platform exposed a problem.
> > 
> > That embedded platform does not have the Gui part of Qt 
> installed.  The
> > build broke, because linking with the QtStateMachine 
> library brought in
> > a dependency on part of the QtGui module.  There is a 
> (hidden?  Or maybe
> > I just missed it) dependency between QtStateMachine and QtGui.
> > 
> > Version details:  I am using Qt 4.5, with QtStateMachine 
> downloaded in
> > source-code form from the Qt add-on products web site.  (I haven't
> > switched to Qt 4.6 at this point, which I know includes 
> QtStateMachine
> > as a module.)
> > 
> > Does anyone know why this dependency exists and what can be 
> done about
> > it?
> > 
> > -Will
> > 
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
> > 
> 




More information about the Qt-interest-old mailing list