<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Willem,<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 18, 2020, at 3:48 AM, Willem Ferguson <<a href="mailto:willemferguson@zoology.up.ac.za" class="">willemferguson@zoology.up.ac.za</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  

    <meta http-equiv="content-type" content="text/html; charset=UTF-8" class="">
  
  <div class=""><p class="">Following excellent review of a recent PR, I was asked to update
      the conventional string-based Qt connections to the new-style Qt
      connections. (<a class="moz-txt-link-freetext" href="https://wiki.qt.io/New_Signal_Slot_Syntax">https://wiki.qt.io/New_Signal_Slot_Syntax</a>) The old
      style is: <br class="">
    </p>
    <pre class="">connect(
    sender, SIGNAL( valueChanged( QString, QString ) ),
    receiver, SLOT( updateValue( QString ) )
);
</pre><p class="">My old-style connection is:</p><p class=""><tt class="">connect(ui.timeDiffEdit, SIGNAL(timeChanged(const QTime)),
        this, SLOT(timeDiffEditChanged()));</tt><br class="">
    </p><p class="">For the new style the specification in the Qt documentation is:<br class="">
    </p>
    <pre class="">connect(
    sender, &Sender::valueChanged,
    receiver, &Receiver::updateValue
);</pre></div></div></blockquote><div><br class=""></div><div>So as you see here, the documentation wants you to use the function address as argument...</div><blockquote type="cite" class=""><div class=""><div class=""><p class="">My formulation, reflecting my strong deficiencies in Qt coding
      but following the above, for the new connection is:</p><p class="">   <tt class=""> connect(this,
        ui.timeDiffEdit->timeChanged(ui.timeDiffEdit->time()),</tt><tt class="">
        this, this->timeDiffEditChanged());</tt></p>
    The second parameter needs to be a pointer, for which I used <tt class="">ui</tt><tt class="">.timeDiffEdit.</tt>
    The <tt class="">timeChanged()</tt> signal needs a <tt class="">QTime</tt> value, so
    I provided that with <tt class="">ui.timeDeffEdit->time(),</tt> the
    actual amount of time by which the <tt class="">timeDiffEdit</tt> has been
    changed.<br class=""><p class="">The last parameter also needs an address, provided by <tt class="">this-></tt><tt class="">timeDiffEditChanged()</tt>
      is the response to the signal from<tt class=""> </tt><tt class="">timeDiffEdit->timeChanged().</tt>
      It is a void function and the source of build problems. The
      compiler generates an error:</p><p class=""><tt class="">/home/willem/src/subsurface/desktop-widgets/importgps.cpp:30:104:
        error: invalid use of void expression</tt><tt class=""><br class="">
      </tt> <tt class=""> connect(this,
        ui.timeDiffEdit->timeChanged(ui.timeDiffEdit->time()),
        this, this->timeDiffEditChanged());</tt><tt class=""><br class="">
      </tt><tt class="">                                                                                                       
        ^</tt><tt class=""><br class="">
      </tt></p><p class="">Obviously, accessing the pointer <tt class="">this->timeDiffEditChanged()</tt>
      should not return a void value. I have no idea of how to respond
      to this error. Any suggestions are very welcome. For completeness
      I attach the code for the full object to this email.</p><div class=""><br class=""></div></div></div></blockquote><br class=""></div><div><br class=""></div><div>How about  </div><div><tt class=""><br class=""></tt></div><div><tt class="">connect(this, &QTimeEdit::timeChanged,</tt><tt class=""> this, &ImportGPS::timeDiffEditChanged);</tt></div><br class=""><div class="">That seems like it would follow the syntax suggested above, right?</div><div class=""><br class=""></div><div class="">/D</div></body></html>