Results 1 to 4 of 4

Thread: QStateMachine

  1. #1
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QStateMachine

    I'm trying to use QStateMachine with QWebPage and I'm stuck in the middle of nowhere.

    I'm using qwebpage to load and navigate through a site. During this navigation I have to make a series of actions like connect, login, query, logout, login, query, query, logout, disconnect. So I have my class Session modeling this with abstract methods login, query, logout etc. I also created a state machine inside this class using QStateMachine class. Loading each page is signaled by emitting loadFinished(bool) signal by qwebpage. I have to make sure the next action is not taken until after the previous page is loaded (what means waiting for loadFinished(bool) signal).

    What should I do inside loadFinished(bool) and in my methods so that they make use of a state machine to control what actions are made in what moments?

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QStateMachine

    You have to implement your slot, which will be connected to loadFinished. Once the page is loaded completely the signal will be emitted and your slot will start execution.
    I'm a rebel in the S.D.G.

  3. #3
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QStateMachine

    How can be checked in which state is statemachine, I cannot get this info form docs ...?
    Qt 5.3 Opensource & Creator 3.1.2

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

    Default Re: QStateMachine

    Listen for entered() signal from the states.
    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:

    MarkoSan (6th December 2009)

Similar Threads

  1. QStateMachine and signals
    By rossm in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2009, 10:43

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.