Results 1 to 11 of 11

Thread: QStateMachine, not getting entered()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    UK
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: QStateMachine, not getting entered()

    No, no....what I mean is that I put in

    Qt Code:
    1. connect(this, SIGNAL(connectToHost_SM()), this, SLOT(debugConnectToHost_SM()));
    To copy to clipboard, switch view to plain text mode 

    in order to see if connectToHost_SM() is emitted and debugConnectToHost_SM() just outputs a qDebug message so I can see that at runtime connectToHost_SM() is emitted.

    jim

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QStateMachine, not getting entered()

    Please provide a minimal compilable example reproducing the problem. The code you pasted looks correct so the problem is probably elsewhere. Try isolating it from the rest of your code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: QStateMachine, not getting entered()

    I haven't got round to getting a compiled version to post but I have noticed that the state machine does start. I have put a qDebug line after the .start() to check if the state machine is running but it comes back as not running!!!! any suggestions?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QStateMachine, not getting entered()

    It's an asynchronous call. The machine will start next time Qt enters the event loop.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    jimiq (19th November 2009)

  6. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: QStateMachine, not getting entered()

    I have no other events running at that time.
    I checked if it was running later in the app and it still comes back with stopped

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QStateMachine, not getting entered()

    As already said, provide a minimal compilable example reproducing the problem. I can't help you without knowing what you did.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #7
    Join Date
    Sep 2009
    Location
    UK
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: QStateMachine, not getting entered()

    I managed to find the problem. When you mentioned about it being an asynchronous call got me thinking. I found that I was calling the state machine in the constructor of my dialog and was trying to trigger it too early. I then added a slot/signal combination to wait for the started() signal from the state machine before trying to create the TCP socket and now all appears fine.

    Thanks for your help.
    Jim

Similar Threads

  1. Replies: 28
    Last Post: 7th May 2010, 12:29
  2. QStateMachine
    By piotr.dobrogost in forum Qt Programming
    Replies: 3
    Last Post: 6th December 2009, 08:17
  3. QStateMachine and signals
    By rossm in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2009, 10:43
  4. fetching each char entered in Qtextedit??
    By Shuchi Agrawal in forum Newbie
    Replies: 3
    Last Post: 17th February 2007, 11:07
  5. Record update windowd entered data saving
    By MarkoSan in forum Qt Programming
    Replies: 56
    Last Post: 18th January 2006, 18:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.