Skip to content
  • 0 Votes
    2 Posts
    1k Views
    M

    I figured it out. I needed to set my QObject and QCore stuff properly. In the .pro file of the shared library, I added:

    QT += core

    In the shared library's .h file, I switched this:

    class CTSCANSHARED_EXPORT ctScan { public: ...blah blah...

    with this:

    class CTSCANSHARED_EXPORT ctScan: public QObject { Q_OBJECT public: ...blah blah...

    And then ensured the shared library's .h file had this:

    #include <QObject>

    And then it compiled properly.

  • 0 Votes
    4 Posts
    2k Views
    R

    @JohanSolo Thanks for the suggestion. I had done some reading about blockSignals() but I went back and looked again. The problem with blockSignals() is that it still leaves me needing to know that I wanted to emit a particular signal but couldn't. I somehow need to know how to re-emit the signal later when the server interaction completes.

    An event filter would almost work. I could add a filter for my QState objects. In that case what comes to the eventFilter() method is a QSignalEvent. If I could detect in the filter that my server operation was in progress, then I could save away the event (or the event parameters) then use them to post the event equivalent of the original signal at the correct time. I could dynamic cast the event pointer and even peel off the arguments, but there does not appear to be any public constructor for a QStateMachine::SignalEvent, so I have no way to reconstruct a copy of the original event.

    I also looked at using QAbstractTransition or QSignalTransition, but those basically have the same problem. There's no way to store the event to use later.

  • 0 Votes
    3 Posts
    1k Views
    L

    Thanks! I fix the problem. All works fine, but I have a Rectangle over that hide the window background and that was the problem.