Results 1 to 5 of 5

Thread: QState Transition in c++/clr environment

  1. #1
    Join Date
    Dec 2016
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default QState Transition in c++/clr environment

    Because of using dll, I changed Common Language Runtime Support in my QT project into Common Language Runtime Support (/clr).

    i used: stateExploring->addTransition(ui.startExperiment, &QPushButton::clicked, stateRunning); to change from state "stateExploring" into "stateRunning" when button clicked, it seems that this function doesn't work

    for debugging, I changed into No Common language support, this function worked well.

    it is clear to there is problem in "addtransition" function when using runtime common language clr.

    any one please help me an opinion to run this function in clr support environment
    Last edited by quangabcd; 27th December 2016 at 08:42.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QState Transition in c++/clr environment

    No idea what this common language runtime stuff is, sounds like some .NET thing, but is the button itself working?

    If you connect a slot or function to the button's clicked signal, does it get invoked?

    Cheers,
    _

  3. #3
    Join Date
    Dec 2016
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QState Transition in c++/clr environment

    HI,

    I tried a slot for button event function, it worked well ( it shows message box when button clicked)

    it seems that problem is only in QState transition

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QState Transition in c++/clr environment

    Hmm, strange.

    If the event loop is running and other signal receivers work, then the signal transition should work as well.

    Does the transition object retured from addTransition() emit its triggered() signal?

    Cheers,
    _

  5. #5
    Join Date
    Dec 2016
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QState Transition in c++/clr environment

    HI

    i tried adding a QsignalStransition as return of addtransition as:

    qttran=stateExploring->addTransition(ui.startExperiment, &QPushButton::clicked, stateRunning); ( with QsignalStransition * qttran)

    I also created a button click slot function, in there I show a messagebox "msgBox.setText(qttran->signal())"

    In case of not clr support, messagebox showed "clicked(bool)" when button is clicked
    In case of clr support, program was broken when button is clicked

    Any idea? I think addTransition cannot detect signal
    Last edited by quangabcd; 29th December 2016 at 07:04.

Similar Threads

  1. Creating a qstate machine using QT
    By andreahmed in forum Qt Programming
    Replies: 9
    Last Post: 15th April 2016, 19:50
  2. QState
    By cszawisza in forum Newbie
    Replies: 7
    Last Post: 9th November 2014, 12:04
  3. How to know the signal which caused a qstate transition
    By ClintEastwood in forum Qt Programming
    Replies: 6
    Last Post: 24th April 2013, 15:27
  4. Replies: 4
    Last Post: 25th March 2010, 10:32
  5. rotate in QState
    By estel in forum Qt Programming
    Replies: 0
    Last Post: 21st October 2009, 12:39

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.